@iexec/web3mail 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/generateUniqueId.d.ts +1 -1
- package/dist/utils/generateUniqueId.js +3 -3
- package/dist/utils/validators.d.ts +1 -0
- package/dist/utils/validators.js +2 -0
- package/dist/web3mail/sendEmail.d.ts +1 -1
- package/dist/web3mail/sendEmail.js +6 -3
- package/dist/web3mail/types.d.ts +1 -0
- package/package.json +8 -12
- package/src/utils/generateUniqueId.ts +4 -4
- package/src/utils/validators.ts +3 -0
- package/src/web3mail/sendEmail.ts +6 -2
- package/src/web3mail/types.ts +1 -0
- package/dist/bundle.js +0 -23
- package/dist/bundle.js.LICENSE.txt +0 -35
package/dist/bundle.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*! For license information please see bundle.js.LICENSE.txt */
|
|
2
|
-
var e,t,r={8709:function(e){!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t<e.length;t++)if(!r(e[t])||e[t]<0||e[t]>255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function a(e){return new Uint8Array(e)}function s(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var o,u={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r<e.length;){var n=e.charCodeAt(r++);37===n?(t.push(parseInt(e.substr(r,2),16)),r+=2):t.push(n)}return i(t)},fromBytes:function(e){for(var t=[],r=0;r<e.length;){var n=e[r];n<128?(t.push(String.fromCharCode(n)),r++):n>191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},l=(o="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},fromBytes:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(o[(240&n)>>4]+o[15&n])}return t.join("")}}),h={16:10,24:12,32:14},c=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],f=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],y=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],b=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],_=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],M=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],T=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],E=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],A=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function x(e){for(var t=[],r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}var k=function(e){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(e,!0)}),this._prepare()};k.prototype._prepare=function(){var e=h[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(e+1),i=this.key.length/4,a=x(this.key);for(t=0;t<i;t++)r=t>>2,this._Ke[r][t%4]=a[t],this._Kd[e-r][t%4]=a[t];for(var s,o=0,u=i;u<n;){if(s=a[i-1],a[0]^=d[s>>16&255]<<24^d[s>>8&255]<<16^d[255&s]<<8^d[s>>24&255]^c[o]<<24,o+=1,8!=i)for(t=1;t<i;t++)a[t]^=a[t-1];else{for(t=1;t<i/2;t++)a[t]^=a[t-1];for(s=a[i/2-1],a[i/2]^=d[255&s]^d[s>>8&255]<<8^d[s>>16&255]<<16^d[s>>24&255]<<24,t=i/2+1;t<i;t++)a[t]^=a[t-1]}for(t=0;t<i&&u<n;)l=u>>2,f=u%4,this._Ke[l][f]=a[t],this._Kd[e-l][f]=a[t++],u++}for(var l=1;l<e;l++)for(var f=0;f<4;f++)s=this._Kd[l][f],this._Kd[l][f]=M[s>>24&255]^T[s>>16&255]^E[s>>8&255]^A[255&s]},k.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var s=1;s<t;s++){for(i=0;i<4;i++)r[i]=p[n[i]>>24&255]^y[n[(i+1)%4]>>16&255]^m[n[(i+2)%4]>>8&255]^b[255&n[(i+3)%4]]^this._Ke[s][i];n=r.slice()}var o,u=a(16);for(i=0;i<4;i++)o=this._Ke[t][i],u[4*i]=255&(d[n[i]>>24&255]^o>>24),u[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^o>>16),u[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^o>>8),u[4*i+3]=255&(d[255&n[(i+3)%4]]^o);return u},k.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var s=1;s<t;s++){for(i=0;i<4;i++)r[i]=g[n[i]>>24&255]^v[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^_[255&n[(i+1)%4]]^this._Kd[s][i];n=r.slice()}var o,u=a(16);for(i=0;i<4;i++)o=this._Kd[t][i],u[4*i]=255&(f[n[i]>>24&255]^o>>24),u[4*i+1]=255&(f[n[(i+3)%4]>>16&255]^o>>16),u[4*i+2]=255&(f[n[(i+2)%4]>>8&255]^o>>8),u[4*i+3]=255&(f[255&n[(i+1)%4]]^o);return u};var S=function(e){if(!(this instanceof S))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(e)};S.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16)s(e,r,0,n,n+16),s(r=this._aes.encrypt(r),t,n);return t},S.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16)s(e,r,0,n,n+16),s(r=this._aes.decrypt(r),t,n);return t};var I=function(e,t){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=a(16);this._lastCipherblock=i(t,!0),this._aes=new k(e)};I.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16){s(e,r,0,n,n+16);for(var o=0;o<16;o++)r[o]^=this._lastCipherblock[o];this._lastCipherblock=this._aes.encrypt(r),s(this._lastCipherblock,t,n)}return t},I.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16){s(e,r,0,n,n+16),r=this._aes.decrypt(r);for(var o=0;o<16;o++)t[n+o]=r[o]^this._lastCipherblock[o];s(e,this._lastCipherblock,0,n,n+16)}return t};var C=function(e,t,r){if(!(this instanceof C))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 size)")}else t=a(16);r||(r=1),this.segmentSize=r,this._shiftRegister=i(t,!0),this._aes=new k(e)};C.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)r[n+a]^=t[a];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},C.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)r[n+a]^=t[a];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var O=function(e,t){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=a(16);this._lastPrecipher=i(t,!0),this._lastPrecipherIndex=16,this._aes=new k(e)};O.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},O.prototype.decrypt=O.prototype.encrypt;var R=function(e){if(!(this instanceof R))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=a(16),this.setValue(e)):this.setBytes(e)};R.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");for(var t=15;t>=0;--t)this._counter[t]=e%256,e>>=8},R.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},R.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var N=function(e,t){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof R||(t=new R(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(e)};N.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[r]^=this._remainingCounter[this._remainingCounterIndex++];return t},N.prototype.decrypt=N.prototype.encrypt;var P={AES:k,Counter:R,ModeOfOperation:{ecb:S,cbc:I,cfb:C,ofb:O,ctr:N},utils:{hex:l,utf8:u},padding:{pkcs7:{pad:function(e){var t=16-(e=i(e,!0)).length%16,r=a(e.length+t);s(e,r);for(var n=e.length;n<r.length;n++)r[n]=t;return r},strip:function(e){if((e=i(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n<t;n++)if(e[r+n]!==t)throw new Error("PKCS#7 invalid padding byte");var o=a(r);return s(e,o,0,0,r),o}}},_arrayTest:{coerceArray:i,createArray:a,copyArray:s}};e.exports=P}()},8826:function(e){!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t<e.length;t++)if(!r(e[t])||e[t]<0||e[t]>255)return!1;return!0}function i(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function a(e){return new Uint8Array(e)}function s(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var o,u={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r<e.length;){var n=e.charCodeAt(r++);37===n?(t.push(parseInt(e.substr(r,2),16)),r+=2):t.push(n)}return i(t)},fromBytes:function(e){for(var t=[],r=0;r<e.length;){var n=e[r];n<128?(t.push(String.fromCharCode(n)),r++):n>191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},l=(o="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},fromBytes:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(o[(240&n)>>4]+o[15&n])}return t.join("")}}),h={16:10,24:12,32:14},c=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],f=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],y=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],b=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],_=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],M=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],T=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],E=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],A=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function x(e){for(var t=[],r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}var k=function(e){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(e,!0)}),this._prepare()};k.prototype._prepare=function(){var e=h[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(e+1),i=this.key.length/4,a=x(this.key);for(t=0;t<i;t++)r=t>>2,this._Ke[r][t%4]=a[t],this._Kd[e-r][t%4]=a[t];for(var s,o=0,u=i;u<n;){if(s=a[i-1],a[0]^=d[s>>16&255]<<24^d[s>>8&255]<<16^d[255&s]<<8^d[s>>24&255]^c[o]<<24,o+=1,8!=i)for(t=1;t<i;t++)a[t]^=a[t-1];else{for(t=1;t<i/2;t++)a[t]^=a[t-1];for(s=a[i/2-1],a[i/2]^=d[255&s]^d[s>>8&255]<<8^d[s>>16&255]<<16^d[s>>24&255]<<24,t=i/2+1;t<i;t++)a[t]^=a[t-1]}for(t=0;t<i&&u<n;)l=u>>2,f=u%4,this._Ke[l][f]=a[t],this._Kd[e-l][f]=a[t++],u++}for(var l=1;l<e;l++)for(var f=0;f<4;f++)s=this._Kd[l][f],this._Kd[l][f]=M[s>>24&255]^T[s>>16&255]^E[s>>8&255]^A[255&s]},k.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var s=1;s<t;s++){for(i=0;i<4;i++)r[i]=p[n[i]>>24&255]^y[n[(i+1)%4]>>16&255]^m[n[(i+2)%4]>>8&255]^b[255&n[(i+3)%4]]^this._Ke[s][i];n=r.slice()}var o,u=a(16);for(i=0;i<4;i++)o=this._Ke[t][i],u[4*i]=255&(d[n[i]>>24&255]^o>>24),u[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^o>>16),u[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^o>>8),u[4*i+3]=255&(d[255&n[(i+3)%4]]^o);return u},k.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var s=1;s<t;s++){for(i=0;i<4;i++)r[i]=g[n[i]>>24&255]^v[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^_[255&n[(i+1)%4]]^this._Kd[s][i];n=r.slice()}var o,u=a(16);for(i=0;i<4;i++)o=this._Kd[t][i],u[4*i]=255&(f[n[i]>>24&255]^o>>24),u[4*i+1]=255&(f[n[(i+3)%4]>>16&255]^o>>16),u[4*i+2]=255&(f[n[(i+2)%4]>>8&255]^o>>8),u[4*i+3]=255&(f[255&n[(i+1)%4]]^o);return u};var S=function(e){if(!(this instanceof S))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(e)};S.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16)s(e,r,0,n,n+16),s(r=this._aes.encrypt(r),t,n);return t},S.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16)s(e,r,0,n,n+16),s(r=this._aes.decrypt(r),t,n);return t};var I=function(e,t){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=a(16);this._lastCipherblock=i(t,!0),this._aes=new k(e)};I.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16){s(e,r,0,n,n+16);for(var o=0;o<16;o++)r[o]^=this._lastCipherblock[o];this._lastCipherblock=this._aes.encrypt(r),s(this._lastCipherblock,t,n)}return t},I.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16){s(e,r,0,n,n+16),r=this._aes.decrypt(r);for(var o=0;o<16;o++)t[n+o]=r[o]^this._lastCipherblock[o];s(e,this._lastCipherblock,0,n,n+16)}return t};var C=function(e,t,r){if(!(this instanceof C))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 size)")}else t=a(16);r||(r=1),this.segmentSize=r,this._shiftRegister=i(t,!0),this._aes=new k(e)};C.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)r[n+a]^=t[a];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},C.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)r[n+a]^=t[a];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var O=function(e,t){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=a(16);this._lastPrecipher=i(t,!0),this._lastPrecipherIndex=16,this._aes=new k(e)};O.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},O.prototype.decrypt=O.prototype.encrypt;var R=function(e){if(!(this instanceof R))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=a(16),this.setValue(e)):this.setBytes(e)};R.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},R.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},R.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var N=function(e,t){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof R||(t=new R(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(e)};N.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[r]^=this._remainingCounter[this._remainingCounterIndex++];return t},N.prototype.decrypt=N.prototype.encrypt;var P={AES:k,Counter:R,ModeOfOperation:{ecb:S,cbc:I,cfb:C,ofb:O,ctr:N},utils:{hex:l,utf8:u},padding:{pkcs7:{pad:function(e){var t=16-(e=i(e,!0)).length%16,r=a(e.length+t);s(e,r);for(var n=e.length;n<r.length;n++)r[n]=t;return r},strip:function(e){if((e=i(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n<t;n++)if(e[r+n]!==t)throw new Error("PKCS#7 invalid padding byte");var o=a(r);return s(e,o,0,0,r),o}}},_arrayTest:{coerceArray:i,createArray:a,copyArray:s}};e.exports=P}()},9809:(e,t,r)=>{const n=t;n.bignum=r(4590),n.define=r(2500).define,n.base=r(1979),n.constants=r(6826),n.decoders=r(8307),n.encoders=r(6579)},2500:(e,t,r)=>{const n=r(6579),i=r(8307),a=r(5717);function s(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new s(e,t)},s.prototype._createNamed=function(e){const t=this.name;function r(e){this._initNamed(e,t)}return a(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(this)},s.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},s.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},s.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},s.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},6625:(e,t,r)=>{const n=r(5717),i=r(8465).b,a=r(2399).Buffer;function s(e,t){i.call(this,t),a.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function o(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return o.isEncoderBuffer(e)||(e=new o(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(s,i),t.C=s,s.isDecoderBuffer=function(e){return e instanceof s||"object"==typeof e&&a.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},s.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},s.prototype.restore=function(e){const t=new s(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},s.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.R=o,o.isEncoderBuffer=function(e){return e instanceof o||"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},o.prototype.join=function(e,t){return e||(e=a.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(e,t),t+=r.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):a.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},1979:(e,t,r)=>{const n=t;n.Reporter=r(8465).b,n.DecoderBuffer=r(6625).C,n.EncoderBuffer=r(6625).R,n.Node=r(1949)},1949:(e,t,r)=>{const n=r(8465).b,i=r(6625).R,a=r(6625).C,s=r(9746),o=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);function l(e,t,r){const n={};this._baseState=n,n.name=r,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=l;const h=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){const e=this._baseState,t={};h.forEach((function(r){t[r]=e[r]}));const r=new this.constructor(t.parent);return r._baseState=t,r},l.prototype._wrap=function(){const e=this._baseState;u.forEach((function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},l.prototype._init=function(e){const t=this._baseState;s(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),s.equal(t.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(e){const t=this._baseState,r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==r.length&&(s(null===t.children),t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(s(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(r){r==(0|r)&&(r|=0);const n=e[r];t[n]=r})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){l.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),o.forEach((function(e){l.prototype[e]=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===t.tag),t.tag=e,this._useArgs(r),this}})),l.prototype.use=function(e){s(e);const t=this._baseState;return s(null===t.use),t.use=e,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(e){const t=this._baseState;return s(null===t.default),t.default=e,t.optional=!0,this},l.prototype.explicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.explicit=e,this},l.prototype.implicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.implicit=e,this},l.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},l.prototype.key=function(e){const t=this._baseState;return s(null===t.key),t.key=e,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(e){const t=this._baseState;return s(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},l.prototype.contains=function(e){const t=this._baseState;return s(null===t.use),t.contains=e,this},l.prototype._decode=function(e,t){const r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));let n,i=r.default,s=!0,o=null;if(null!==r.key&&(o=e.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(s=this._peekTag(e,n,r.any),e.isError(s))return s}else{const n=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),s=!0}catch(e){s=!1}e.restore(n)}}if(r.obj&&s&&(n=e.enterObject()),s){if(null!==r.explicit){const t=this._decodeTag(e,r.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(null===r.use&&null===r.choice){let t;r.any&&(t=e.save());const n=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(n))return n;r.any?i=e.raw(t):e=n}if(t&&t.track&&null!==r.tag&&t.track(e.path(),n,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(e,t)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new a(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(n,t)}}return r.obj&&s&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==s?null!==o&&e.exitKey(o):e.leaveKey(o,r.key,i),i},l.prototype._decodeGeneric=function(e,t,r){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},l.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},l.prototype._decodeChoice=function(e,t){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(a){const s=e.save(),o=r.choice[a];try{const r=o._decode(e,t);if(e.isError(r))return!1;n={type:a,value:r},i=!0}catch(t){return e.restore(s),!1}return!0}),this),i?n:e.error("Choice not matched")},l.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},l.prototype._encode=function(e,t,r){const n=this._baseState;if(null!==n.default&&n.default===e)return;const i=this._encodeValue(e,t,r);return void 0===i||this._skipDefault(i,t,r)?void 0:i},l.prototype._encodeValue=function(e,t,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new n);let a=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}let s=null,o=!1;if(i.any)a=this._createEncoderBuffer(e);else if(i.choice)a=this._encodeChoice(e,t);else if(i.contains)s=this._getUse(i.contains,r)._encode(e,t),o=!0;else if(i.children)s=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");const n=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const i=r._encode(e[r._baseState.key],t,e);return t.leaveKey(n),i}),this).filter((function(e){return e})),s=this._createEncoderBuffer(s);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,s=this._createEncoderBuffer(e.map((function(r){const n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)}),r))}else null!==i.use?a=this._getUse(i.use,r)._encode(e,t):(s=this._encodePrimitive(i.tag,e),o=!0);if(!i.any&&null===i.choice){const e=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===e?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(a=this._encodeComposite(e,o,r,s))}return null!==i.explicit&&(a=this._encodeComposite(i.explicit,!1,"context",a)),a},l.prototype._encodeChoice=function(e,t){const r=this._baseState,n=r.choice[e.type];return n||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},l.prototype._encodePrimitive=function(e,t){const r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},l.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},l.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},8465:(e,t,r)=>{const n=r(5717);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function a(e,t){this.path=e,this.rethrow(t)}t.b=i,i.prototype.isError=function(e){return e instanceof a},i.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){const t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){let t;const r=this._reporterState,n=e instanceof a;if(t=n?e:new a(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(a,Error),a.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,a),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},160:(e,t)=>{function r(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=r(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=r(t.tag)},6826:(e,t,r)=>{const n=t;n._reverse=function(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r})),t},n.der=r(160)},1671:(e,t,r)=>{const n=r(5717),i=r(4590),a=r(6625).C,s=r(1949),o=r(160);function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){s.call(this,"der",e)}function h(e,t){let r=e.readUInt8(t);if(e.isError(r))return r;const n=o.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){let n=r;for(r=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:o.tag[r]}}function c(e,t,r){let n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;const i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(let t=0;t<i;t++){n<<=8;const t=e.readUInt8(r);if(e.isError(t))return t;n|=t}return n}e.exports=u,u.prototype.decode=function(e,t){return a.isDecoderBuffer(e)||(e=new a(e,t)),this.tree._decode(e,t)},n(l,s),l.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;const n=e.save(),i=h(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(n),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||r)},l.prototype._decodeTag=function(e,t,r){const n=h(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;let i=c(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');const a=e.save(),s=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(s)?s:(i=e.offset-a.offset,e.restore(a),e.skip(i,'Failed to match body of: "'+t+'"'))},l.prototype._skipUntilEnd=function(e,t){for(;;){const r=h(e,t);if(e.isError(r))return r;const n=c(e,r.primitive,t);if(e.isError(n))return n;let i;if(i=r.primitive||null!==n?e.skip(n):this._skipUntilEnd(e,t),e.isError(i))return i;if("end"===r.tagStr)break}},l.prototype._decodeList=function(e,t,r,n){const i=[];for(;!e.isEmpty();){const t=this._peekTag(e,"end");if(e.isError(t))return t;const a=r.decode(e,"der",n);if(e.isError(a)&&t)break;i.push(a)}return i},l.prototype._decodeStr=function(e,t){if("bitstr"===t){const t=e.readUInt8();return e.isError(t)?t:{unused:t,data:e.raw()}}if("bmpstr"===t){const t=e.raw();if(t.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");let r="";for(let e=0;e<t.length/2;e++)r+=String.fromCharCode(t.readUInt16BE(2*e));return r}if("numstr"===t){const t=e.raw().toString("ascii");return this._isNumstr(t)?t:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){const t=e.raw().toString("ascii");return this._isPrintstr(t)?t:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},l.prototype._decodeObjid=function(e,t,r){let n;const i=[];let a=0,s=0;for(;!e.isEmpty();)s=e.readUInt8(),a<<=7,a|=127&s,0==(128&s)&&(i.push(a),a=0);128&s&&i.push(a);const o=i[0]/40|0,u=i[0]%40;if(n=r?i:[o,u].concat(i.slice(1)),t){let e=t[n.join(" ")];void 0===e&&(e=t[n.join(".")]),void 0!==e&&(n=e)}return n},l.prototype._decodeTime=function(e,t){const r=e.raw().toString();let n,i,a,s,o,u;if("gentime"===t)n=0|r.slice(0,4),i=0|r.slice(4,6),a=0|r.slice(6,8),s=0|r.slice(8,10),o=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),a=0|r.slice(4,6),s=0|r.slice(6,8),o=0|r.slice(8,10),u=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,a,s,o,u,0)},l.prototype._decodeNull=function(){return null},l.prototype._decodeBool=function(e){const t=e.readUInt8();return e.isError(t)?t:0!==t},l.prototype._decodeInt=function(e,t){const r=e.raw();let n=new i(r);return t&&(n=t[n.toString(10)]||n),n},l.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},8307:(e,t,r)=>{const n=t;n.der=r(1671),n.pem=r(9631)},9631:(e,t,r)=>{const n=r(5717),i=r(2399).Buffer,a=r(1671);function s(e){a.call(this,e),this.enc="pem"}n(s,a),e.exports=s,s.prototype.decode=function(e,t){const r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/;let o=-1,u=-1;for(let e=0;e<r.length;e++){const t=r[e].match(s);if(null!==t&&t[2]===n){if(-1!==o){if("END"!==t[1])break;u=e;break}if("BEGIN"!==t[1])break;o=e}}if(-1===o||-1===u)throw new Error("PEM section not found for: "+n);const l=r.slice(o+1,u).join("");l.replace(/[^a-z0-9+/=]+/gi,"");const h=i.from(l,"base64");return a.prototype.decode.call(this,h,t)}},6984:(e,t,r)=>{const n=r(5717),i=r(2399).Buffer,a=r(1949),s=r(160);function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new u,this.tree._init(e.body)}function u(e){a.call(this,"der",e)}function l(e){return e<10?"0"+e:e}e.exports=o,o.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(u,a),u.prototype._encodeComposite=function(e,t,r,n){const a=function(e,t,r,n){let i;if("seqof"===e?e="seq":"setof"===e&&(e="set"),s.tagByName.hasOwnProperty(e))i=s.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}return i>=31?n.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=s.tagClassByName[r||"universal"]<<6,i)}(e,t,r,this.reporter);if(n.length<128){const e=i.alloc(2);return e[0]=a,e[1]=n.length,this._createEncoderBuffer([e,n])}let o=1;for(let e=n.length;e>=256;e>>=8)o++;const u=i.alloc(2+o);u[0]=a,u[1]=128|o;for(let e=1+o,t=n.length;t>0;e--,t>>=8)u[e]=255&t;return this._createEncoderBuffer([u,n])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=i.alloc(2*e.length);for(let r=0;r<e.length;r++)t.writeUInt16BE(e.charCodeAt(r),2*r);return this._createEncoderBuffer(t)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},u.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let t=0;t<e.length;t++)e[t]|=0}else if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let t=0;t<e.length;t++){let r=e[t];for(n++;r>=128;r>>=7)n++}const a=i.alloc(n);let s=a.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];for(a[s--]=127&r;(r>>=7)>0;)a[s--]=128|127&r}return this._createEncoderBuffer(a)},u.prototype._encodeTime=function(e,t){let r;const n=new Date(e);return"gentime"===t?r=[l(n.getUTCFullYear()),l(n.getUTCMonth()+1),l(n.getUTCDate()),l(n.getUTCHours()),l(n.getUTCMinutes()),l(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[l(n.getUTCFullYear()%100),l(n.getUTCMonth()+1),l(n.getUTCDate()),l(n.getUTCHours()),l(n.getUTCMinutes()),l(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=i.from(t)}if(i.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=i.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let t=e;t>=256;t>>=8)r++;const n=new Array(r);for(let t=n.length-1;t>=0;t--)n[t]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){const n=this._baseState;let i;if(null===n.default)return!1;const a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i<a.length;i++)if(a[i]!==n.defaultBuffer[i])return!1;return!0}},6579:(e,t,r)=>{const n=t;n.der=r(6984),n.pem=r(2883)},2883:(e,t,r)=>{const n=r(5717),i=r(6984);function a(e){i.call(this,e),this.enc="pem"}n(a,i),e.exports=a,a.prototype.encode=function(e,t){const r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"];for(let e=0;e<r.length;e+=64)n.push(r.slice(e,e+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},4590:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(950).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function l(e,t,r,n){for(var i=0,a=Math.min(e.length,r),s=t;s<a;s++){var o=e.charCodeAt(s)-48;i*=n,i+=o>=49?o-49+10:o>=17?o-17+10:o}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,s,o=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,s=a%n,o=Math.min(a,a-s)+r,u=0,h=r;h<o;h+=n)u=l(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=l(e,h,e.length,t),h=0;h<s;h++)c*=t;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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"],c=[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],d=[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];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],s=i*a,o=67108863&s,u=s/67108864|0;r.words[0]=o;for(var l=1;l<n;l++){for(var h=u>>>26,c=67108863&u,d=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=d;f++){var p=l-f|0;h+=(s=(i=0|e.words[p])*(a=0|t.words[f])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,u=0|h}return 0!==u?r.words[l]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,s=0;s<this.length;s++){var o=this.words[s],u=(16777215&(o<<i|a)).toString(16);r=0!=(a=o>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=c[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?y+r:h[l-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var s,o,u="le"===t,l=new e(a),h=this.clone();if(u){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),l[o]=s;for(;o<a;o++)l[o]=0}else{for(o=0;o<a-i;o++)l[o]=0;for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),l[a-o-1]=s}return l},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,s=0;s<n.length;s++)a=(t=(0|r.words[s])-(0|n.words[s])+a)>>26,this.words[s]=67108863&t;for(;0!==a&&s<r.length;s++)a=(t=(0|r.words[s])+a)>>26,this.words[s]=67108863&t;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,a,s=e.words,o=t.words,u=r.words,l=0,h=0|s[0],c=8191&h,d=h>>>13,f=0|s[1],p=8191&f,y=f>>>13,m=0|s[2],b=8191&m,g=m>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],T=8191&M,E=M>>>13,A=0|s[5],x=8191&A,k=A>>>13,S=0|s[6],I=8191&S,C=S>>>13,O=0|s[7],R=8191&O,N=O>>>13,P=0|s[8],B=8191&P,D=P>>>13,L=0|s[9],F=8191&L,U=L>>>13,j=0|o[0],q=8191&j,z=j>>>13,G=0|o[1],K=8191&G,H=G>>>13,$=0|o[2],V=8191&$,W=$>>>13,Z=0|o[3],J=8191&Z,Y=Z>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,ie=0|o[6],ae=8191&ie,se=ie>>>13,oe=0|o[7],ue=8191&oe,le=oe>>>13,he=0|o[8],ce=8191&he,de=he>>>13,fe=0|o[9],pe=8191&fe,ye=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(l+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;l=((a=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(y,q)|0,a=Math.imul(y,z);var be=(l+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(d,K)|0))<<13)|0;l=((a=a+Math.imul(d,H)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(g,q)|0,a=Math.imul(g,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,H)|0;var ge=(l+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(d,V)|0))<<13)|0;l=((a=a+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,H)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,V)|0,a=a+Math.imul(y,W)|0;var ve=(l+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;l=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(E,q)|0,a=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,H)|0,n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Y)|0;var we=(l+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,a=Math.imul(k,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,H)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,W)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,ee)|0;var _e=(l+(n=n+Math.imul(c,re)|0)|0)+((8191&(i=(i=i+Math.imul(c,ne)|0)+Math.imul(d,re)|0))<<13)|0;l=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,a=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,H)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(E,V)|0,a=a+Math.imul(E,W)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0;var Me=(l+(n=n+Math.imul(c,ae)|0)|0)+((8191&(i=(i=i+Math.imul(c,se)|0)+Math.imul(d,ae)|0))<<13)|0;l=((a=a+Math.imul(d,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,z))+Math.imul(N,q)|0,a=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,H)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,V)|0,a=a+Math.imul(k,W)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,se)|0;var Te=(l+(n=n+Math.imul(c,ue)|0)|0)+((8191&(i=(i=i+Math.imul(c,le)|0)+Math.imul(d,ue)|0))<<13)|0;l=((a=a+Math.imul(d,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,H)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(C,V)|0,a=a+Math.imul(C,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(y,ue)|0,a=a+Math.imul(y,le)|0;var Ee=(l+(n=n+Math.imul(c,ce)|0)|0)+((8191&(i=(i=i+Math.imul(c,de)|0)+Math.imul(d,ce)|0))<<13)|0;l=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,z))+Math.imul(U,q)|0,a=Math.imul(U,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,H)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,V)|0,a=a+Math.imul(N,W)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Y)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,le)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,le)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,ce)|0,a=a+Math.imul(y,de)|0;var Ae=(l+(n=n+Math.imul(c,pe)|0)|0)+((8191&(i=(i=i+Math.imul(c,ye)|0)+Math.imul(d,pe)|0))<<13)|0;l=((a=a+Math.imul(d,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,K),i=(i=Math.imul(F,H))+Math.imul(U,K)|0,a=Math.imul(U,H),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,W)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Y)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,le)|0,n=n+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,de)|0;var xe=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;l=((a=a+Math.imul(y,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,V),i=(i=Math.imul(F,W))+Math.imul(U,V)|0,a=Math.imul(U,W),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Q)|0,a=a+Math.imul(N,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,le)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,ce)|0,a=a+Math.imul(_,de)|0;var ke=(l+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ye)|0)+Math.imul(g,pe)|0))<<13)|0;l=((a=a+Math.imul(g,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,J),i=(i=Math.imul(F,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,a=a+Math.imul(N,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,le)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(E,ce)|0,a=a+Math.imul(E,de)|0;var Se=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;l=((a=a+Math.imul(_,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(U,Q)|0,a=Math.imul(U,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(C,ue)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(k,ce)|0,a=a+Math.imul(k,de)|0;var Ie=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ye)|0)+Math.imul(E,pe)|0))<<13)|0;l=((a=a+Math.imul(E,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(U,re)|0,a=Math.imul(U,ne),n=n+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,se)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,le)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,de)|0;var Ce=(l+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(k,pe)|0))<<13)|0;l=((a=a+Math.imul(k,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(F,ae),i=(i=Math.imul(F,se))+Math.imul(U,ae)|0,a=Math.imul(U,se),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,le)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,ce)|0,a=a+Math.imul(N,de)|0;var Oe=(l+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(C,pe)|0))<<13)|0;l=((a=a+Math.imul(C,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,le))+Math.imul(U,ue)|0,a=Math.imul(U,le),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,de)|0;var Re=(l+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(N,pe)|0))<<13)|0;l=((a=a+Math.imul(N,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(F,ce),i=(i=Math.imul(F,de))+Math.imul(U,ce)|0,a=Math.imul(U,de);var Ne=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,ye)|0)+Math.imul(D,pe)|0))<<13)|0;l=((a=a+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Pe=(l+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,ye))+Math.imul(U,pe)|0))<<13)|0;return l=((a=Math.imul(U,ye))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=me,u[1]=be,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Te,u[8]=Ee,u[9]=Ae,u[10]=xe,u[11]=ke,u[12]=Se,u[13]=Ie,u[14]=Ce,u[15]=Oe,u[16]=Re,u[17]=Ne,u[18]=Pe,0!==l&&(u[19]=l,r.length++),r};function y(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=f),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var s=i;i=0;for(var o=67108863&n,u=Math.min(a,t.length-1),l=Math.max(0,a-e.length+1);l<=u;l++){var h=a-l,c=(0|e.words[h])*(0|t.words[l]),d=67108863&c;o=67108863&(d=d+o|0),i+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[a]=o,n=s,s=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,a){for(var s=0;s<a;s++)n[s]=t[e[s]],i[s]=r[e[s]]},m.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),h=0;h<i;h+=o)for(var c=u,d=l,f=0;f<s;f++){var p=r[h+f],y=n[h+f],m=r[h+f+s],b=n[h+f+s],g=c*m-d*b;b=c*b+d*m,m=g,r[h+f]=p+m,n[h+f]=y+b,r[h+f+s]=p-m,n[h+f+s]=y-b,f!==o&&(g=u*c-l*d,d=u*d+l*c,c=g)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var a=0,s=0;s<t;s++)a+=0|e[s],r[2*s]=8191&a,a>>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===a),n(0==(-8192&a))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),s=new Array(n),o=new Array(n),u=new Array(n),l=new Array(n),h=new Array(n),c=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,l,n),this.transform(s,a,o,u,n,i),this.transform(l,a,h,c,n,i);for(var f=0;f<n;f++){var p=o[f]*h[f]-u[f]*c[f];u[f]=o[f]*c[f]+u[f]*h[f],o[f]=p}return this.conjugate(o,u,n),this.transform(o,u,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),y(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&a,u=(0|this.words[t])-o<<r;this.words[t]=u|s,s=o>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<<a,u=r;if(i-=s,i=Math.max(0,i),u){for(var l=0;l<s;l++)u.words[l]=this.words[l];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var h=0;for(l=this.length-1;l>=0&&(0!==h||l>=i);l--){var c=0|this.words[l];this.words[l]=h<<26-a|c>>>a,h=c&o}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i,a,s=e.length+r;this._expand(s);var o=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+o;var u=(0|e.words[i])*t;o=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)o=(a=(0|this.words[i+r])+o)>>26,this.words[i+r]=67108863&a;if(0===o)return this.strip();for(n(-1===o),o=0,i=0;i<this.length;i++)o=(a=-(0|this.words[i])+o)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var o,u=n.length-i.length;if("mod"!==t){(o=new a(null)).length=u+1,o.words=new Array(o.length);for(var l=0;l<o.length;l++)o.words[l]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,o&&(o.words[u]=1));for(var c=u-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);o&&(o.words[c]=d)}return o&&o.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,o},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),s=new a(0),o=new a(0),u=new a(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var h=r.clone(),c=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(h),u.isub(c)),o.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o),s.isub(u)):(r.isub(t),o.isub(i),u.isub(s))}return{a:o,b:u,gcd:r.iushln(l)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new a(1),o=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(i=0===t.cmpn(1)?s:o).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,s=r;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new T(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}g.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|a>>>22,a=s}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,g),i(_,g),i(M,g),M.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return b[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var o=new a(1).toRed(this),u=o.redNeg(),l=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new a(2*h*h).toRed(this);0!==this.pow(h,l).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),d=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(o);){for(var y=f,m=0;0!==y.cmp(o);m++)y=y.redSqr();n(m<p);var b=this.pow(c,new a(1).iushln(p-m-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=m}return d},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,o=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],h=u-1;h>=0;h--){var c=l>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++o||0===n&&0===h)&&(i=this.mul(i,r[s]),o=0,s=0)):o=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new E(e)},i(E,T),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},3407:e=>{e.exports={newInvalidAsn1Error:function(e){var t=new Error;return t.name="InvalidAsn1Error",t.message=e||"",t}}},279:(e,t,r)=>{var n=r(3407),i=r(4478),a=r(4578),s=r(3609);for(var o in e.exports={Reader:a,Writer:s},i)i.hasOwnProperty(o)&&(e.exports[o]=i[o]);for(var u in n)n.hasOwnProperty(u)&&(e.exports[u]=n[u])},4578:(e,t,r)=>{var n=r(9282),i=r(2399).Buffer,a=r(4478),s=r(3407).newInvalidAsn1Error;function o(e){if(!e||!i.isBuffer(e))throw new TypeError("data must be a node Buffer");this._buf=e,this._size=e.length,this._len=0,this._offset=0}Object.defineProperty(o.prototype,"length",{enumerable:!0,get:function(){return this._len}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){return this._offset}}),Object.defineProperty(o.prototype,"remain",{get:function(){return this._size-this._offset}}),Object.defineProperty(o.prototype,"buffer",{get:function(){return this._buf.slice(this._offset)}}),o.prototype.readByte=function(e){if(this._size-this._offset<1)return null;var t=255&this._buf[this._offset];return e||(this._offset+=1),t},o.prototype.peek=function(){return this.readByte(!0)},o.prototype.readLength=function(e){if(void 0===e&&(e=this._offset),e>=this._size)return null;var t=255&this._buf[e++];if(null===t)return null;if(128==(128&t)){if(0==(t&=127))throw s("Indefinite length not supported");if(t>4)throw s("encoding too long");if(this._size-e<t)return null;this._len=0;for(var r=0;r<t;r++)this._len=(this._len<<8)+(255&this._buf[e++])}else this._len=t;return e},o.prototype.readSequence=function(e){var t=this.peek();if(null===t)return null;if(void 0!==e&&e!==t)throw s("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);return null===r?null:(this._offset=r,t)},o.prototype.readInt=function(){return this._readTag(a.Integer)},o.prototype.readBoolean=function(){return 0!==this._readTag(a.Boolean)},o.prototype.readEnumeration=function(){return this._readTag(a.Enumeration)},o.prototype.readString=function(e,t){e||(e=a.OctetString);var r=this.peek();if(null===r)return null;if(r!==e)throw s("Expected 0x"+e.toString(16)+": got 0x"+r.toString(16));var n=this.readLength(this._offset+1);if(null===n)return null;if(this.length>this._size-n)return null;if(this._offset=n,0===this.length)return t?i.alloc(0):"";var o=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,t?o:o.toString("utf8")},o.prototype.readOID=function(e){e||(e=a.OID);var t=this.readString(e,!0);if(null===t)return null;for(var r=[],n=0,i=0;i<t.length;i++){var s=255&t[i];n<<=7,n+=127&s,0==(128&s)&&(r.push(n),n=0)}return n=r.shift(),r.unshift(n%40),r.unshift(n/40>>0),r.join(".")},o.prototype._readTag=function(e){n.ok(void 0!==e);var t=this.peek();if(null===t)return null;if(t!==e)throw s("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var r=this.readLength(this._offset+1);if(null===r)return null;if(this.length>4)throw s("Integer too long: "+this.length);if(this.length>this._size-r)return null;this._offset=r;for(var i=this._buf[this._offset],a=0,o=0;o<this.length;o++)a<<=8,a|=255&this._buf[this._offset++];return 128==(128&i)&&4!==o&&(a-=1<<8*o),a>>0},e.exports=o},4478:e=>{e.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},3609:(e,t,r)=>{var n=r(9282),i=r(2399).Buffer,a=r(4478),s=r(3407).newInvalidAsn1Error,o={size:1024,growthFactor:8};function u(e){var t,r;t=o,r=e||{},n.ok(t),n.equal(typeof t,"object"),n.ok(r),n.equal(typeof r,"object"),Object.getOwnPropertyNames(t).forEach((function(e){if(!r[e]){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n)}})),e=r,this._buf=i.alloc(e.size||1024),this._size=this._buf.length,this._offset=0,this._options=e,this._seq=[]}Object.defineProperty(u.prototype,"buffer",{get:function(){if(this._seq.length)throw s(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),u.prototype.writeByte=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=e},u.prototype.writeInt=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");"number"!=typeof t&&(t=a.Integer);for(var r=4;(0==(4286578688&e)||-8388608==(4286578688&e))&&r>1;)r--,e<<=8;if(r>4)throw s("BER ints cannot be > 0xffffffff");for(this._ensure(2+r),this._buf[this._offset++]=t,this._buf[this._offset++]=r;r-- >0;)this._buf[this._offset++]=(4278190080&e)>>>24,e<<=8},u.prototype.writeNull=function(){this.writeByte(a.Null),this.writeByte(0)},u.prototype.writeEnumeration=function(e,t){if("number"!=typeof e)throw new TypeError("argument must be a Number");return"number"!=typeof t&&(t=a.Enumeration),this.writeInt(e,t)},u.prototype.writeBoolean=function(e,t){if("boolean"!=typeof e)throw new TypeError("argument must be a Boolean");"number"!=typeof t&&(t=a.Boolean),this._ensure(3),this._buf[this._offset++]=t,this._buf[this._offset++]=1,this._buf[this._offset++]=e?255:0},u.prototype.writeString=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string (was: "+typeof e+")");"number"!=typeof t&&(t=a.OctetString);var r=i.byteLength(e);this.writeByte(t),this.writeLength(r),r&&(this._ensure(r),this._buf.write(e,this._offset),this._offset+=r)},u.prototype.writeBuffer=function(e,t){if("number"!=typeof t)throw new TypeError("tag must be a number");if(!i.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t),this.writeLength(e.length),this._ensure(e.length),e.copy(this._buf,this._offset,0,e.length),this._offset+=e.length},u.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach((function(e){t.writeString(e)}))},u.prototype.writeOID=function(e,t){if("string"!=typeof e)throw new TypeError("argument must be a string");if("number"!=typeof t&&(t=a.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");var r=e.split("."),n=[];n.push(40*parseInt(r[0],10)+parseInt(r[1],10)),r.slice(2).forEach((function(e){!function(e,t){t<128?e.push(t):t<16384?(e.push(t>>>7|128),e.push(127&t)):t<2097152?(e.push(t>>>14|128),e.push(255&(t>>>7|128)),e.push(127&t)):t<268435456?(e.push(t>>>21|128),e.push(255&(t>>>14|128)),e.push(255&(t>>>7|128)),e.push(127&t)):(e.push(255&(t>>>28|128)),e.push(255&(t>>>21|128)),e.push(255&(t>>>14|128)),e.push(255&(t>>>7|128)),e.push(127&t))}(n,parseInt(e,10))}));var i=this;this._ensure(2+n.length),this.writeByte(t),this.writeLength(n.length),n.forEach((function(e){i.writeByte(e)}))},u.prototype.writeLength=function(e){if("number"!=typeof e)throw new TypeError("argument must be a Number");if(this._ensure(4),e<=127)this._buf[this._offset++]=e;else if(e<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=e;else if(e<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e;else{if(!(e<=16777215))throw s("Length too long (> 4 bytes)");this._buf[this._offset++]=131,this._buf[this._offset++]=e>>16,this._buf[this._offset++]=e>>8,this._buf[this._offset++]=e}},u.prototype.startSequence=function(e){"number"!=typeof e&&(e=a.Sequence|a.Constructor),this.writeByte(e),this._seq.push(this._offset),this._ensure(3),this._offset+=3},u.prototype.endSequence=function(){var e=this._seq.pop(),t=e+3,r=this._offset-t;if(r<=127)this._shift(t,r,-2),this._buf[e]=r;else if(r<=255)this._shift(t,r,-1),this._buf[e]=129,this._buf[e+1]=r;else if(r<=65535)this._buf[e]=130,this._buf[e+1]=r>>8,this._buf[e+2]=r;else{if(!(r<=16777215))throw s("Sequence too long");this._shift(t,r,1),this._buf[e]=131,this._buf[e+1]=r>>16,this._buf[e+2]=r>>8,this._buf[e+3]=r}},u.prototype._shift=function(e,t,r){n.ok(void 0!==e),n.ok(void 0!==t),n.ok(r),this._buf.copy(this._buf,e+r,e,e+t),this._offset+=r},u.prototype._ensure=function(e){if(n.ok(e),this._size-this._offset<e){var t=this._size*this._options.growthFactor;t-this._offset<e&&(t+=e);var r=i.alloc(t);this._buf.copy(r,0,0,this._offset),this._buf=r,this._size=t}},e.exports=u},476:(e,t,r)=>{var n=r(279);e.exports={Ber:n,BerReader:n.Reader,BerWriter:n.Writer}},9282:(e,t,r)=>{var n=r(4155);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var a,s,o=r(2136).codes,u=o.ERR_AMBIGUOUS_ARGUMENT,l=o.ERR_INVALID_ARG_TYPE,h=o.ERR_INVALID_ARG_VALUE,c=o.ERR_INVALID_RETURN_VALUE,d=o.ERR_MISSING_ARGS,f=r(5961),p=r(9539).inspect,y=r(9539).types,m=y.isPromise,b=y.isRegExp,g=Object.assign?Object.assign:r(8091).assign,v=Object.is?Object.is:r(609);function w(){var e=r(9158);a=e.isDeepEqual,s=e.isDeepStrictEqual}new Map;var _=!1,M=e.exports=x,T={};function E(e){if(e.message instanceof Error)throw e.message;throw new f(e)}function A(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var a=new f({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw a.generatedMessage=i,a}}function x(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];A.apply(void 0,[x,t.length].concat(t))}M.fail=function e(t,r,i,a,s){var o,u=arguments.length;if(0===u?o="Failed":1===u?(i=t,t=void 0):(!1===_&&(_=!0,(n.emitWarning?n.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===u&&(a="!=")),i instanceof Error)throw i;var l={actual:t,expected:r,operator:void 0===a?"fail":a,stackStartFn:s||e};void 0!==i&&(l.message=i);var h=new f(l);throw o&&(h.message=o,h.generatedMessage=!0),h},M.AssertionError=f,M.ok=x,M.equal=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t!=r&&E({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},M.notEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t==r&&E({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},M.deepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===a&&w(),a(t,r)||E({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},M.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===a&&w(),a(t,r)&&E({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},M.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===a&&w(),s(t,r)||E({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},M.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===a&&w(),s(t,r)&&E({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},M.strictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");v(t,r)||E({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},M.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");v(t,r)&&E({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var k=function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&b(t[e])&&t[e].test(n[e])?i[e]=n[e]:i[e]=t[e])}))};function S(e,t,r,n){if("function"!=typeof t){if(b(t))return t.test(e);if(2===arguments.length)throw new l("expected",["Function","RegExp"],t);if("object"!==i(e)||null===e){var o=new f({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw o.operator=n.name,o}var u=Object.keys(t);if(t instanceof Error)u.push("name","message");else if(0===u.length)throw new h("error",t,"may not be an empty object");return void 0===a&&w(),u.forEach((function(i){"string"==typeof e[i]&&b(t[i])&&t[i].test(e[i])||function(e,t,r,n,i,a){if(!(r in e)||!s(e[r],t[r])){if(!n){var o=new k(e,i),u=new k(t,i,e),l=new f({actual:o,expected:u,operator:"deepStrictEqual",stackStartFn:a});throw l.actual=e,l.expected=t,l.operator=a.name,l}E({actual:e,expected:t,message:n,operator:a.name,stackStartFn:a})}}(e,t,i,r,u,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function I(e){if("function"!=typeof e)throw new l("fn","Function",e);try{e()}catch(e){return e}return T}function C(e){return m(e)||null!==e&&"object"===i(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function O(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!C(t=e()))throw new c("instance of Promise","promiseFn",t)}else{if(!C(e))throw new l("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return T})).catch((function(e){return e}))}))}function R(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new l("error",["Object","Error","Function","RegExp"],r);if("object"===i(t)&&null!==t){if(t.message===r)throw new u("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new u("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!=typeof r)throw new l("error",["Object","Error","Function","RegExp"],r);if(t===T){var a="";r&&r.name&&(a+=" (".concat(r.name,")")),a+=n?": ".concat(n):".";var s="rejects"===e.name?"rejection":"exception";E({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(s).concat(a),stackStartFn:e})}if(r&&!S(t,r,n,e))throw t}function N(e,t,r,n){if(t!==T){if("string"==typeof r&&(n=r,r=void 0),!r||S(t,r)){var i=n?": ".concat(n):".",a="doesNotReject"===e.name?"rejection":"exception";E({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(a).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function P(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];A.apply(void 0,[P,t.length].concat(t))}M.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];R.apply(void 0,[e,I(t)].concat(n))},M.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return O(t).then((function(t){return R.apply(void 0,[e,t].concat(n))}))},M.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];N.apply(void 0,[e,I(t)].concat(n))},M.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return O(t).then((function(t){return N.apply(void 0,[e,t].concat(n))}))},M.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===i(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=p(t);var n=new f({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),a=t.stack;if("string"==typeof a){var s=a.split("\n");s.shift();for(var o=n.stack.split("\n"),u=0;u<s.length;u++){var l=o.indexOf(s[u]);if(-1!==l){o=o.slice(0,l);break}}n.stack="".concat(o.join("\n"),"\n").concat(s.join("\n"))}throw n}},M.strict=g(P,M,{equal:M.strictEqual,deepEqual:M.deepStrictEqual,notEqual:M.notStrictEqual,notDeepEqual:M.notDeepStrictEqual}),M.strict.strict=M.strict},5961:(e,t,r)=>{var n=r(4155);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?o(e):t}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return l(e,arguments,c(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},u(e)}function l(e,t,r){return l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&h(i,r.prototype),i},l.apply(null,arguments)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}var f=r(9539).inspect,p=r(2136).codes.ERR_INVALID_ARG_TYPE;function y(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var m="",b="",g="",v="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function M(e){return f(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var T=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==d(e)||null===e)throw new p("options","Object",e);var i=e.message,a=e.operator,u=e.stackStartFn,l=e.actual,h=e.expected,f=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=s(this,c(t).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(m="[34m",b="[32m",v="[39m",g="[31m"):(m="",b="",v="",g="")),"object"===d(l)&&null!==l&&"object"===d(h)&&null!==h&&"stack"in l&&l instanceof Error&&"stack"in h&&h instanceof Error&&(l=_(l),h=_(h)),"deepStrictEqual"===a||"strictEqual"===a)r=s(this,c(t).call(this,function(e,t,r){var i="",a="",s=0,o="",u=!1,l=M(e),h=l.split("\n"),c=M(t).split("\n"),f=0,p="";if("strictEqual"===r&&"object"===d(e)&&"object"===d(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===h.length&&1===c.length&&h[0]!==c[0]){var _=h[0].length+c[0].length;if(_<=10){if(!("object"===d(e)&&null!==e||"object"===d(t)&&null!==t||0===e&&0===t))return"".concat(w[r],"\n\n")+"".concat(h[0]," !== ").concat(c[0],"\n")}else if("strictEqualObject"!==r&&_<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;h[0][f]===c[0][f];)f++;f>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",f),"^"),f=0)}}for(var T=h[h.length-1],E=c[c.length-1];T===E&&(f++<2?o="\n ".concat(T).concat(o):i=T,h.pop(),c.pop(),0!==h.length&&0!==c.length);)T=h[h.length-1],E=c[c.length-1];var A=Math.max(h.length,c.length);if(0===A){var x=l.split("\n");if(x.length>30)for(x[26]="".concat(m,"...").concat(v);x.length>27;)x.pop();return"".concat(w.notIdentical,"\n\n").concat(x.join("\n"),"\n")}f>3&&(o="\n".concat(m,"...").concat(v).concat(o),u=!0),""!==i&&(o="\n ".concat(i).concat(o),i="");var k=0,S=w[r]+"\n".concat(b,"+ actual").concat(v," ").concat(g,"- expected").concat(v),I=" ".concat(m,"...").concat(v," Lines skipped");for(f=0;f<A;f++){var C=f-s;if(h.length<f+1)C>1&&f>2&&(C>4?(a+="\n".concat(m,"...").concat(v),u=!0):C>3&&(a+="\n ".concat(c[f-2]),k++),a+="\n ".concat(c[f-1]),k++),s=f,i+="\n".concat(g,"-").concat(v," ").concat(c[f]),k++;else if(c.length<f+1)C>1&&f>2&&(C>4?(a+="\n".concat(m,"...").concat(v),u=!0):C>3&&(a+="\n ".concat(h[f-2]),k++),a+="\n ".concat(h[f-1]),k++),s=f,a+="\n".concat(b,"+").concat(v," ").concat(h[f]),k++;else{var O=c[f],R=h[f],N=R!==O&&(!y(R,",")||R.slice(0,-1)!==O);N&&y(O,",")&&O.slice(0,-1)===R&&(N=!1,R+=","),N?(C>1&&f>2&&(C>4?(a+="\n".concat(m,"...").concat(v),u=!0):C>3&&(a+="\n ".concat(h[f-2]),k++),a+="\n ".concat(h[f-1]),k++),s=f,a+="\n".concat(b,"+").concat(v," ").concat(R),i+="\n".concat(g,"-").concat(v," ").concat(O),k+=2):(a+=i,i="",1!==C&&0!==f||(a+="\n ".concat(R),k++))}if(k>20&&f<A-2)return"".concat(S).concat(I,"\n").concat(a,"\n").concat(m,"...").concat(v).concat(i,"\n")+"".concat(m,"...").concat(v)}return"".concat(S).concat(u?I:"","\n").concat(a).concat(i).concat(o).concat(p)}(l,h,a)));else if("notDeepStrictEqual"===a||"notStrictEqual"===a){var T=w[a],E=M(l).split("\n");if("notStrictEqual"===a&&"object"===d(l)&&null!==l&&(T=w.notStrictEqualObject),E.length>30)for(E[26]="".concat(m,"...").concat(v);E.length>27;)E.pop();r=1===E.length?s(this,c(t).call(this,"".concat(T," ").concat(E[0]))):s(this,c(t).call(this,"".concat(T,"\n\n").concat(E.join("\n"),"\n")))}else{var A=M(l),x="",k=w[a];"notDeepEqual"===a||"notEqual"===a?(A="".concat(w[a],"\n\n").concat(A)).length>1024&&(A="".concat(A.slice(0,1021),"...")):(x="".concat(M(h)),A.length>512&&(A="".concat(A.slice(0,509),"...")),x.length>512&&(x="".concat(x.slice(0,509),"...")),"deepEqual"===a||"equal"===a?A="".concat(k,"\n\n").concat(A,"\n\nshould equal\n\n"):x=" ".concat(a," ").concat(x)),r=s(this,c(t).call(this,"".concat(A).concat(x)))}return Error.stackTraceLimit=f,r.generatedMessage=!i,Object.defineProperty(o(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=l,r.expected=h,r.operator=a,Error.captureStackTrace&&Error.captureStackTrace(o(r),u),r.stack,r.name="AssertionError",s(r)}var r,u;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),r=t,u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:f.custom,value:function(e,t){return f(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],u&&a(r.prototype,u),t}(u(Error));e.exports=T},2136:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s,o,u={};function l(e,t,r){r||(r=Error);var s=function(r){function s(r,a,o){var u;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),u=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i(s).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,a,o))),u.code=e,u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,r),s}(r);u[e]=s}function h(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",(function(e,t,i){var a,o,u,l,c;if(void 0===s&&(s=r(9282)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(o="not ",t.substr(0,o.length)===o)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))u="The ".concat(e," ").concat(a," ").concat(h(t,"type"));else{var d=("number"!=typeof c&&(c=0),c+".".length>(l=e).length||-1===l.indexOf(".",c)?"argument":"property");u='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(h(t,"type"))}return u+". Received type ".concat(n(i))}),TypeError),l("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===o&&(o=r(9539));var i=o.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),l("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(9282)),s(t.length>0,"At least one arg needs to be specified");var i="The ",a=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),a){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,a-1).join(", "),i+=", and ".concat(t[a-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=u},9158:(e,t,r)=>{function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw a}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var a=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},o=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},u=Object.is?Object.is:r(609),l=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},h=Number.isNaN?Number.isNaN:r(360);function c(e){return e.call.bind(e)}var d=c(Object.prototype.hasOwnProperty),f=c(Object.prototype.propertyIsEnumerable),p=c(Object.prototype.toString),y=r(9539).types,m=y.isAnyArrayBuffer,b=y.isArrayBufferView,g=y.isDate,v=y.isMap,w=y.isRegExp,_=y.isSet,M=y.isNativeError,T=y.isBoxedPrimitive,E=y.isNumberObject,A=y.isStringObject,x=y.isBooleanObject,k=y.isBigIntObject,S=y.isSymbolObject,I=y.isFloat32Array,C=y.isFloat64Array;function O(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function R(e){return Object.keys(e).filter(O).concat(l(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function N(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}var P=0,B=1,D=2,L=3;function F(e,t,r,n){if(e===t)return 0!==e||!r||u(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&h(e)&&h(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var s,o,l,c,d=p(e);if(d!==p(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var f=R(e),y=R(t);return f.length===y.length&&j(e,t,r,n,B,f)}if("[object Object]"===d&&(!v(e)&&v(t)||!_(e)&&_(t)))return!1;if(g(e)){if(!g(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(l=e,c=t,!(a?l.source===c.source&&l.flags===c.flags:RegExp.prototype.toString.call(l)===RegExp.prototype.toString.call(c))))return!1}else if(M(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(b(e)){if(r||!I(e)&&!C(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===N(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var O=R(e),F=R(t);return O.length===F.length&&j(e,t,r,n,P,O)}if(_(e))return!(!_(t)||e.size!==t.size)&&j(e,t,r,n,D);if(v(e))return!(!v(t)||e.size!==t.size)&&j(e,t,r,n,L);if(m(e)){if(o=t,(s=e).byteLength!==o.byteLength||0!==N(new Uint8Array(s),new Uint8Array(o)))return!1}else if(T(e)&&!function(e,t){return E(e)?E(t)&&u(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):A(e)?A(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):x(e)?x(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):k(e)?k(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):S(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return j(e,t,r,n,P)}function U(e,t){return t.filter((function(t){return f(e,t)}))}function j(e,t,r,a,u,h){if(5===arguments.length){h=Object.keys(e);var c=Object.keys(t);if(h.length!==c.length)return!1}for(var p=0;p<h.length;p++)if(!d(t,h[p]))return!1;if(r&&5===arguments.length){var y=l(e);if(0!==y.length){var m=0;for(p=0;p<y.length;p++){var b=y[p];if(f(e,b)){if(!f(t,b))return!1;h.push(b),m++}else if(f(t,b))return!1}var g=l(t);if(y.length!==g.length&&U(t,g).length!==m)return!1}else{var v=l(t);if(0!==v.length&&0!==U(t,v).length)return!1}}if(0===h.length&&(u===P||u===B&&0===e.length||0===e.size))return!0;if(void 0===a)a={val1:new Map,val2:new Map,position:0};else{var w=a.val1.get(e);if(void 0!==w){var _=a.val2.get(t);if(void 0!==_)return w===_}a.position++}a.val1.set(e,a.position),a.val2.set(t,a.position);var M=function(e,t,r,a,u,l){var h=0;if(l===D){if(!function(e,t,r,n){for(var a=null,o=s(e),u=0;u<o.length;u++){var l=o[u];if("object"===i(l)&&null!==l)null===a&&(a=new Set),a.add(l);else if(!t.has(l)){if(r)return!1;if(!G(e,t,l))return!1;null===a&&(a=new Set),a.add(l)}}if(null!==a){for(var h=s(t),c=0;c<h.length;c++){var d=h[c];if("object"===i(d)&&null!==d){if(!q(a,d,r,n))return!1}else if(!r&&!e.has(d)&&!q(a,d,r,n))return!1}return 0===a.size}return!0}(e,t,r,u))return!1}else if(l===L){if(!function(e,t,r,a){for(var s=null,u=o(e),l=0;l<u.length;l++){var h=n(u[l],2),c=h[0],d=h[1];if("object"===i(c)&&null!==c)null===s&&(s=new Set),s.add(c);else{var f=t.get(c);if(void 0===f&&!t.has(c)||!F(d,f,r,a)){if(r)return!1;if(!K(e,t,c,d,a))return!1;null===s&&(s=new Set),s.add(c)}}}if(null!==s){for(var p=o(t),y=0;y<p.length;y++){var m=n(p[y],2),b=(c=m[0],m[1]);if("object"===i(c)&&null!==c){if(!H(s,e,c,b,r,a))return!1}else if(!(r||e.has(c)&&F(e.get(c),b,!1,a)||H(s,e,c,b,!1,a)))return!1}return 0===s.size}return!0}(e,t,r,u))return!1}else if(l===B)for(;h<e.length;h++){if(!d(e,h)){if(d(t,h))return!1;for(var c=Object.keys(e);h<c.length;h++){var f=c[h];if(!d(t,f)||!F(e[f],t[f],r,u))return!1}return c.length===Object.keys(t).length}if(!d(t,h)||!F(e[h],t[h],r,u))return!1}for(h=0;h<a.length;h++){var p=a[h];if(!F(e[p],t[p],r,u))return!1}return!0}(e,t,r,h,a,u);return a.val1.delete(e),a.val2.delete(t),M}function q(e,t,r,n){for(var i=s(e),a=0;a<i.length;a++){var o=i[a];if(F(t,o,r,n))return e.delete(o),!0}return!1}function z(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(h(e))return!1}return!0}function G(e,t,r){var n=z(r);return null!=n?n:t.has(n)&&!e.has(n)}function K(e,t,r,n,i){var a=z(r);if(null!=a)return a;var s=t.get(a);return!(void 0===s&&!t.has(a)||!F(n,s,!1,i))&&!e.has(a)&&F(n,s,!1,i)}function H(e,t,r,n,i,a){for(var o=s(e),u=0;u<o.length;u++){var l=o[u];if(F(r,l,i,a)&&F(n,t.get(l),i,a))return e.delete(l),!0}return!1}e.exports={isDeepEqual:function(e,t){return F(e,t,!1)},isDeepStrictEqual:function(e,t){return F(e,t,!0)}}},9742:(e,t)=>{t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),s=a[0],o=a[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,o)),h=0,c=o>0?s-4:s;for(r=0;r<c;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[h++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],s=16383,o=0,u=n-i;o<u;o+=s)a.push(l(e,o,o+s>u?u:o+s));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=a.length;s<o;++s)r[s]=a[s],n[a.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,a,s=[],o=t;o<n;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2882:e=>{for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<t.length;n++){var i=t.charAt(n);if(void 0!==r[i])throw new TypeError(i+" is ambiguous");r[i]=n}function a(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=a(t)^n>>5}for(t=a(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=a(t)^31&i}return t}function o(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var o=(e=n).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var u=e.slice(0,o),l=e.slice(o+1);if(l.length<6)return"Data too short";var h=s(u);if("string"==typeof h)return h;for(var c=[],d=0;d<l.length;++d){var f=l.charAt(d),p=r[f];if(void 0===p)return"Unknown character "+f;h=a(h)^p,d+6>=l.length||c.push(p)}return 1!==h?"Invalid checksum for "+e:{prefix:u,words:c}}function u(e,t,r,n){for(var i=0,a=0,s=(1<<r)-1,o=[],u=0;u<e.length;++u)for(i=i<<t|e[u],a+=t;a>=r;)a-=r,o.push(i>>a&s);if(n)a>0&&o.push(i<<r-a&s);else{if(a>=t)return"Excess padding";if(i<<r-a&s)return"Non-zero padding"}return o}e.exports={decodeUnsafe:function(){var e=o.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=o.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,r,n){if(n=n||90,e.length+7+r.length>n)throw new TypeError("Exceeds length limit");var i=s(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var o=e+"1",u=0;u<r.length;++u){var l=r[u];if(l>>5!=0)throw new Error("Non 5-bit word");i=a(i)^l,o+=t.charAt(l)}for(u=0;u<6;++u)i=a(i);for(i^=1,u=0;u<6;++u)o+=t.charAt(i>>5*(5-u)&31);return o},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},3550:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6601).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function l(e,t,r,i){for(var a=0,s=0,o=Math.min(e.length,r),u=t;u<o;u++){var l=e.charCodeAt(u)-48;a*=i,s=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s<i,"Invalid character"),a+=s}return a}function h(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,s,o=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this._strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;this._strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,s=a%n,o=Math.min(a,a-s)+r,u=0,h=r;h<o;h+=n)u=l(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=l(e,h,e.length,t),h=0;h<s;h++)c*=t;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype._move=function(e){h(e,this)},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(e){a.prototype.inspect=c}else a.prototype.inspect=c;function c(){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"],f=[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],p=[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];function y(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],s=i*a,o=67108863&s,u=s/67108864|0;r.words[0]=o;for(var l=1;l<n;l++){for(var h=u>>>26,c=67108863&u,d=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=d;f++){var p=l-f|0;h+=(s=(i=0|e.words[p])*(a=0|t.words[f])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,u=0|h}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,s=0;s<this.length;s++){var o=this.words[s],u=(16777215&(o<<i|a)).toString(16);a=o>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==a||s!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],h=p[e];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var y=c.modrn(h).toString(e);r=(c=c.idivn(h)).isZero()?y+r:d[l-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16,2)},s&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},a.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,a=0;i<this.length;i++){var s=this.words[i]<<a|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===a?(r<e.length&&(e[r++]=s>>24&255),n=0,a=0):(n=s>>>24,a+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},a.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,a=0;i<this.length;i++){var s=this.words[i]<<a|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===a?(r>=0&&(e[r--]=s>>24&255),n=0,a=0):(n=s>>>24,a+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},a.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},a.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},a.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,s=0;s<n.length;s++)a=(t=(0|r.words[s])-(0|n.words[s])+a)>>26,this.words[s]=67108863&t;for(;0!==a&&s<r.length;s++)a=(t=(0|r.words[s])+a)>>26,this.words[s]=67108863&t;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,i,a,s=e.words,o=t.words,u=r.words,l=0,h=0|s[0],c=8191&h,d=h>>>13,f=0|s[1],p=8191&f,y=f>>>13,m=0|s[2],b=8191&m,g=m>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],T=8191&M,E=M>>>13,A=0|s[5],x=8191&A,k=A>>>13,S=0|s[6],I=8191&S,C=S>>>13,O=0|s[7],R=8191&O,N=O>>>13,P=0|s[8],B=8191&P,D=P>>>13,L=0|s[9],F=8191&L,U=L>>>13,j=0|o[0],q=8191&j,z=j>>>13,G=0|o[1],K=8191&G,H=G>>>13,$=0|o[2],V=8191&$,W=$>>>13,Z=0|o[3],J=8191&Z,Y=Z>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,ie=0|o[6],ae=8191&ie,se=ie>>>13,oe=0|o[7],ue=8191&oe,le=oe>>>13,he=0|o[8],ce=8191&he,de=he>>>13,fe=0|o[9],pe=8191&fe,ye=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(l+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;l=((a=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(y,q)|0,a=Math.imul(y,z);var be=(l+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(d,K)|0))<<13)|0;l=((a=a+Math.imul(d,H)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(g,q)|0,a=Math.imul(g,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,H)|0;var ge=(l+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(d,V)|0))<<13)|0;l=((a=a+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,H)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,V)|0,a=a+Math.imul(y,W)|0;var ve=(l+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;l=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(E,q)|0,a=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,H)|0,n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Y)|0;var we=(l+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,a=Math.imul(k,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,H)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,W)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,ee)|0;var _e=(l+(n=n+Math.imul(c,re)|0)|0)+((8191&(i=(i=i+Math.imul(c,ne)|0)+Math.imul(d,re)|0))<<13)|0;l=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,a=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,H)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(E,V)|0,a=a+Math.imul(E,W)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0;var Me=(l+(n=n+Math.imul(c,ae)|0)|0)+((8191&(i=(i=i+Math.imul(c,se)|0)+Math.imul(d,ae)|0))<<13)|0;l=((a=a+Math.imul(d,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,z))+Math.imul(N,q)|0,a=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,H)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,V)|0,a=a+Math.imul(k,W)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,se)|0;var Te=(l+(n=n+Math.imul(c,ue)|0)|0)+((8191&(i=(i=i+Math.imul(c,le)|0)+Math.imul(d,ue)|0))<<13)|0;l=((a=a+Math.imul(d,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,H)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(C,V)|0,a=a+Math.imul(C,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(y,ue)|0,a=a+Math.imul(y,le)|0;var Ee=(l+(n=n+Math.imul(c,ce)|0)|0)+((8191&(i=(i=i+Math.imul(c,de)|0)+Math.imul(d,ce)|0))<<13)|0;l=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,z))+Math.imul(U,q)|0,a=Math.imul(U,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,H)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,V)|0,a=a+Math.imul(N,W)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Y)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,le)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,le)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,ce)|0,a=a+Math.imul(y,de)|0;var Ae=(l+(n=n+Math.imul(c,pe)|0)|0)+((8191&(i=(i=i+Math.imul(c,ye)|0)+Math.imul(d,pe)|0))<<13)|0;l=((a=a+Math.imul(d,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,K),i=(i=Math.imul(F,H))+Math.imul(U,K)|0,a=Math.imul(U,H),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,W)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Y)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,le)|0,n=n+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,de)|0;var xe=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;l=((a=a+Math.imul(y,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,V),i=(i=Math.imul(F,W))+Math.imul(U,V)|0,a=Math.imul(U,W),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Q)|0,a=a+Math.imul(N,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,le)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,ce)|0,a=a+Math.imul(_,de)|0;var ke=(l+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ye)|0)+Math.imul(g,pe)|0))<<13)|0;l=((a=a+Math.imul(g,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,J),i=(i=Math.imul(F,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,a=a+Math.imul(N,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,le)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(E,ce)|0,a=a+Math.imul(E,de)|0;var Se=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;l=((a=a+Math.imul(_,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(U,Q)|0,a=Math.imul(U,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(C,ue)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(k,ce)|0,a=a+Math.imul(k,de)|0;var Ie=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ye)|0)+Math.imul(E,pe)|0))<<13)|0;l=((a=a+Math.imul(E,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(U,re)|0,a=Math.imul(U,ne),n=n+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,se)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,le)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,de)|0;var Ce=(l+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(k,pe)|0))<<13)|0;l=((a=a+Math.imul(k,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(F,ae),i=(i=Math.imul(F,se))+Math.imul(U,ae)|0,a=Math.imul(U,se),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,le)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,ce)|0,a=a+Math.imul(N,de)|0;var Oe=(l+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(C,pe)|0))<<13)|0;l=((a=a+Math.imul(C,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,le))+Math.imul(U,ue)|0,a=Math.imul(U,le),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,de)|0;var Re=(l+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(N,pe)|0))<<13)|0;l=((a=a+Math.imul(N,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(F,ce),i=(i=Math.imul(F,de))+Math.imul(U,ce)|0,a=Math.imul(U,de);var Ne=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,ye)|0)+Math.imul(D,pe)|0))<<13)|0;l=((a=a+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Pe=(l+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,ye))+Math.imul(U,pe)|0))<<13)|0;return l=((a=Math.imul(U,ye))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=me,u[1]=be,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Te,u[8]=Ee,u[9]=Ae,u[10]=xe,u[11]=ke,u[12]=Se,u[13]=Ie,u[14]=Ce,u[15]=Oe,u[16]=Re,u[17]=Ne,u[18]=Pe,0!==l&&(u[19]=l,r.length++),r};function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var s=i;i=0;for(var o=67108863&n,u=Math.min(a,t.length-1),l=Math.max(0,a-e.length+1);l<=u;l++){var h=a-l,c=(0|e.words[h])*(0|t.words[l]),d=67108863&c;o=67108863&(d=d+o|0),i+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[a]=o,n=s,s=i}return 0!==n?r.words[a]=n:r.length--,r._strip()}function g(e,t,r){return b(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=y),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?y(this,e,t):r<1024?b(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,i,a){for(var s=0;s<a;s++)n[s]=t[e[s]],i[s]=r[e[s]]},v.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),h=0;h<i;h+=o)for(var c=u,d=l,f=0;f<s;f++){var p=r[h+f],y=n[h+f],m=r[h+f+s],b=n[h+f+s],g=c*m-d*b;b=c*b+d*m,m=g,r[h+f]=p+m,n[h+f]=y+b,r[h+f+s]=p-m,n[h+f+s]=y-b,f!==o&&(g=u*c-l*d,d=u*d+l*c,c=g)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},v.prototype.convert13b=function(e,t,r,i){for(var a=0,s=0;s<t;s++)a+=0|e[s],r[2*s]=8191&a,a>>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===a),n(0==(-8192&a))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),s=new Array(n),o=new Array(n),u=new Array(n),l=new Array(n),h=new Array(n),c=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,l,n),this.transform(s,a,o,u,n,i),this.transform(l,a,h,c,n,i);for(var f=0;f<n;f++){var p=o[f]*h[f]-u[f]*c[f];u[f]=o[f]*c[f]+u[f]*h[f],o[f]=p}return this.conjugate(o,u,n),this.transform(o,u,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),g(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var a=(0|this.words[i])*e,s=(67108863&a)+(67108863&r);r>>=26,r+=a/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&a,u=(0|this.words[t])-o<<r;this.words[t]=u|s,s=o>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<<a,u=r;if(i-=s,i=Math.max(0,i),u){for(var l=0;l<s;l++)u.words[l]=this.words[l];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var h=0;for(l=this.length-1;l>=0&&(0!==h||l>=i);l--){var c=0|this.words[l];this.words[l]=h<<26-a|c>>>a,h=c&o}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i,a,s=e.length+r;this._expand(s);var o=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+o;var u=(0|e.words[i])*t;o=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)o=(a=(0|this.words[i+r])+o)>>26,this.words[i+r]=67108863&a;if(0===o)return this._strip();for(n(-1===o),o=0,i=0;i<this.length;i++)o=(a=-(0|this.words[i])+o)>>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var o,u=n.length-i.length;if("mod"!==t){(o=new a(null)).length=u+1,o.words=new Array(o.length);for(var l=0;l<o.length;l++)o.words[l]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,o&&(o.words[u]=1));for(var c=u-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);o&&(o.words[c]=d)}return o&&o._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,o},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(r*i+(0|this.words[a]))%e;return t?-i:i},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*r;this.words[i]=a/e|0,r=a%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),s=new a(0),o=new a(0),u=new a(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var h=r.clone(),c=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(h),u.isub(c)),o.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o),s.isub(u)):(r.isub(t),o.isub(i),u.isub(s))}return{a:o,b:u,gcd:r.iushln(l)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new a(1),o=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(i=0===t.cmpn(1)?s:o).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,s=r;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new x(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function T(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}_.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},i(M,_),M.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|a>>>22,a=s}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},M.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(T,_),i(E,_),i(A,_),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new T;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},x.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(h(e,e.umod(this.m)._forceRed(this)),e)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var o=new a(1).toRed(this),u=o.redNeg(),l=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new a(2*h*h).toRed(this);0!==this.pow(h,l).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),d=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(o);){for(var y=f,m=0;0!==y.cmp(o);m++)y=y.redSqr();n(m<p);var b=this.pow(c,new a(1).iushln(p-m-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=m}return d},x.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},x.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,o=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],h=u-1;h>=0;h--){var c=l>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++o||0===n&&0===h)&&(i=this.mul(i,r[s]),o=0,s=0)):o=0}u=26}return i},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new k(e)},i(k,x),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},9931:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var a=r(9214);if("function"!=typeof a.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return a.randomBytes(e)}}catch(e){}},4497:(e,t,r)=>{var n=r(9509).Buffer;function i(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function a(e){for(;0<e.length;e++)e[0]=0}function s(e,t,r,n,i){for(var a,s,o,u,l=r[0],h=r[1],c=r[2],d=r[3],f=e[0]^t[0],p=e[1]^t[1],y=e[2]^t[2],m=e[3]^t[3],b=4,g=1;g<i;g++)a=l[f>>>24]^h[p>>>16&255]^c[y>>>8&255]^d[255&m]^t[b++],s=l[p>>>24]^h[y>>>16&255]^c[m>>>8&255]^d[255&f]^t[b++],o=l[y>>>24]^h[m>>>16&255]^c[f>>>8&255]^d[255&p]^t[b++],u=l[m>>>24]^h[f>>>16&255]^c[p>>>8&255]^d[255&y]^t[b++],f=a,p=s,y=o,m=u;return a=(n[f>>>24]<<24|n[p>>>16&255]<<16|n[y>>>8&255]<<8|n[255&m])^t[b++],s=(n[p>>>24]<<24|n[y>>>16&255]<<16|n[m>>>8&255]<<8|n[255&f])^t[b++],o=(n[y>>>24]<<24|n[m>>>16&255]<<16|n[f>>>8&255]<<8|n[255&p])^t[b++],u=(n[m>>>24]<<24|n[f>>>16&255]<<16|n[p>>>8&255]<<8|n[255&y])^t[b++],[a>>>=0,s>>>=0,o>>>=0,u>>>=0]}var o=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],a=[[],[],[],[]],s=0,o=0,u=0;u<256;++u){var l=o^o<<1^o<<2^o<<3^o<<4;l=l>>>8^255&l^99,r[s]=l,n[l]=s;var h=e[s],c=e[h],d=e[c],f=257*e[l]^16843008*l;i[0][s]=f<<24|f>>>8,i[1][s]=f<<16|f>>>16,i[2][s]=f<<8|f>>>24,i[3][s]=f,f=16843009*d^65537*c^257*h^16843008*s,a[0][l]=f<<24|f>>>8,a[1][l]=f<<16|f>>>16,a[2][l]=f<<8|f>>>24,a[3][l]=f,0===s?s=o=1:(s=h^e[e[e[d^h]]],o^=e[e[o]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:a}}();function l(e){this._key=i(e),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],a=0;a<t;a++)i[a]=e[a];for(a=t;a<n;a++){var s=i[a-1];a%t==0?(s=s<<8|s>>>24,s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s],s^=o[a/t|0]<<24):t>6&&a%t==4&&(s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s]),i[a]=i[a-t]^s}for(var l=[],h=0;h<n;h++){var c=n-h,d=i[c-(h%4?0:4)];l[h]=h<4||c<=4?d:u.INV_SUB_MIX[0][u.SBOX[d>>>24]]^u.INV_SUB_MIX[1][u.SBOX[d>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[d>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&d]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=l},l.prototype.encryptBlockRaw=function(e){return s(e=i(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},l.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},l.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=s(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),a=n.allocUnsafe(16);return a.writeUInt32BE(r[0],0),a.writeUInt32BE(r[3],4),a.writeUInt32BE(r[2],8),a.writeUInt32BE(r[1],12),a},l.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},e.exports.AES=l},2422:(e,t,r)=>{var n=r(4497),i=r(9509).Buffer,a=r(1027),s=r(5717),o=r(3288),u=r(7295),l=r(685);function h(e,t,r,s){a.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(t);var h=this._cipher.encryptBlock(u);this._ghash=new o(h),r=function(e,t,r){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var n=new o(r),a=t.length,s=a%16;n.update(t),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var u=8*a,h=i.alloc(8);h.writeUIntBE(u,0,8),n.update(h),e._finID=n.state;var c=i.from(e._finID);return l(c),c}(this,r,h),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}s(h,a),h.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},h.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;i<n;++i)r+=e[i]^t[i];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},h.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},h.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},h.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=h},4696:(e,t,r)=>{var n=r(1494),i=r(6193),a=r(4946);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(a)}},6193:(e,t,r)=>{var n=r(2422),i=r(9509).Buffer,a=r(45),s=r(5969),o=r(1027),u=r(4497),l=r(3048);function h(e,t,r){o.call(this),this._cache=new c,this._last=void 0,this._cipher=new u.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function c(){this.cache=i.allocUnsafe(0)}function d(e,t,r){var o=a[e.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==o.mode&&r.length!==o.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==o.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===o.type?new s(o.module,t,r,!0):"auth"===o.type?new n(o.module,t,r,!0):new h(o.module,t,r)}r(5717)(h,o),h.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var r=-1;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16!==t)return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},c.prototype.add=function(e){this.cache=i.concat([this.cache,e])},c.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=a[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=l(t,!1,r.key,r.iv);return d(e,n.key,n.iv)},t.createDecipheriv=d},1494:(e,t,r)=>{var n=r(45),i=r(2422),a=r(9509).Buffer,s=r(5969),o=r(1027),u=r(4497),l=r(3048);function h(e,t,r){o.call(this),this._cache=new d,this._cipher=new u.AES(t),this._prev=a.from(r),this._mode=e,this._autopadding=!0}r(5717)(h,o),h.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return a.concat(n)};var c=a.alloc(16,16);function d(){this.cache=a.allocUnsafe(0)}function f(e,t,r){var o=n[e.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=a.from(t)),t.length!==o.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=a.from(r)),"GCM"!==o.mode&&r.length!==o.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===o.type?new s(o.module,t,r):"auth"===o.type?new i(o.module,t,r):new h(o.module,t,r)}h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(c))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=a.concat([this.cache,e])},d.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=a.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return a.concat([this.cache,t])},t.createCipheriv=f,t.createCipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=l(t,!1,r.key,r.iv);return f(e,i.key,i.iv)}},3288:(e,t,r)=>{var n=r(9509).Buffer,i=n.alloc(16,0);function a(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function s(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},s.prototype._multiply=function(){for(var e,t,r,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],s=-1;++s<128;){for(0!=(this.state[~~(s/8)]&1<<7-s%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=a(i)},s.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},s.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(a([0,e,0,t])),this.state},e.exports=s},685:e=>{e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},5292:(e,t,r)=>{var n=r(7295);t.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},6311:(e,t,r)=>{var n=r(9509).Buffer,i=r(7295);function a(e,t,r){var a=t.length,s=i(t,e._cache);return e._cache=e._cache.slice(a),e._prev=n.concat([e._prev,r?t:s]),s}t.encrypt=function(e,t,r){for(var i,s=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){s=n.concat([s,a(e,t,r)]);break}i=e._cache.length,s=n.concat([s,a(e,t.slice(0,i),r)]),t=t.slice(i)}return s}},1510:(e,t,r)=>{var n=r(9509).Buffer;function i(e,t,r){for(var n,i,s=-1,o=0;++s<8;)n=t&1<<7-s?128:0,o+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^n))>>s%8,e._prev=a(e._prev,r?n:i);return o}function a(e,t){var r=e.length,i=-1,a=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i<r;)a[i]=e[i]<<1|e[i+1]>>7;return a}t.encrypt=function(e,t,r){for(var a=t.length,s=n.allocUnsafe(a),o=-1;++o<a;)s[o]=i(e,t[o],r);return s}},1964:(e,t,r)=>{var n=r(9509).Buffer;function i(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([r?t:i])]),i}t.encrypt=function(e,t,r){for(var a=t.length,s=n.allocUnsafe(a),o=-1;++o<a;)s[o]=i(e,t[o],r);return s}},6009:(e,t,r)=>{var n=r(7295),i=r(9509).Buffer,a=r(685);function s(e){var t=e._cipher.encryptBlockRaw(e._prev);return a(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),a=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*r)]);for(var o=0;o<r;o++){var u=s(e),l=a+16*o;e._cache.writeUInt32BE(u[0],l+0),e._cache.writeUInt32BE(u[1],l+4),e._cache.writeUInt32BE(u[2],l+8),e._cache.writeUInt32BE(u[3],l+12)}var h=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,h)}},1084:(e,t)=>{t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},45:(e,t,r)=>{var n={ECB:r(1084),CBC:r(5292),CFB:r(6311),CFB8:r(1964),CFB1:r(1510),OFB:r(8861),CTR:r(6009),GCM:r(6009)},i=r(4946);for(var a in i)i[a].module=n[i[a].mode];e.exports=i},8861:(e,t,r)=>{var n=r(8764).Buffer,i=r(7295);function a(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=n.concat([e._cache,a(e)]);var r=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),i(t,r)}},5969:(e,t,r)=>{var n=r(4497),i=r(9509).Buffer,a=r(1027);function s(e,t,r,s){a.call(this),this._cipher=new n.AES(t),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=e}r(5717)(s,a),s.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},e.exports=s},3614:(e,t,r)=>{var n=r(7667),i=r(4696),a=r(45),s=r(9715),o=r(3048);function u(e,t,r){if(e=e.toLowerCase(),a[e])return i.createCipheriv(e,t,r);if(s[e])return new n({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function l(e,t,r){if(e=e.toLowerCase(),a[e])return i.createDecipheriv(e,t,r);if(s[e])return new n({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var r,n;if(e=e.toLowerCase(),a[e])r=a[e].key,n=a[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,n=s[e].iv}var i=o(t,!1,r,n);return u(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var r,n;if(e=e.toLowerCase(),a[e])r=a[e].key,n=a[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,n=s[e].iv}var i=o(t,!1,r,n);return l(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=l,t.listCiphers=t.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},7667:(e,t,r)=>{var n=r(1027),i=r(5251),a=r(5717),s=r(9509).Buffer,o={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(e){n.call(this);var t,r=e.mode.toLowerCase(),i=o[r];t=e.decrypt?"decrypt":"encrypt";var a=e.key;s.isBuffer(a)||(a=s.from(a)),"des-ede"!==r&&"des-ede-cbc"!==r||(a=s.concat([a,a.slice(0,8)]));var u=e.iv;s.isBuffer(u)||(u=s.from(u)),this._des=i.create({key:a,iv:u,type:t})}o.des=o["des-cbc"],o.des3=o["des-ede3-cbc"],e.exports=u,a(u,n),u.prototype._update=function(e){return s.from(this._des.update(e))},u.prototype._final=function(){return s.from(this._des.final())}},9715:(e,t)=>{t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},3663:(e,t,r)=>{var n=r(8764).Buffer,i=r(3550),a=r(1798);function s(e){var t,r=e.modulus.byteLength();do{t=new i(a(r))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function o(e,t){var r=function(e){var t=s(e);return{blinder:t.toRed(i.mont(e.modulus)).redPow(new i(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),a=t.modulus.byteLength(),o=new i(e).mul(r.blinder).umod(t.modulus),u=o.toRed(i.mont(t.prime1)),l=o.toRed(i.mont(t.prime2)),h=t.coefficient,c=t.prime1,d=t.prime2,f=u.redPow(t.exponent1).fromRed(),p=l.redPow(t.exponent2).fromRed(),y=f.isub(p).imul(h).umod(c).imul(d);return p.iadd(y).imul(r.unblinder).umod(t.modulus).toArrayLike(n,"be",a)}o.getr=s,e.exports=o},6042:(e,t,r)=>{e.exports=r(5207)},4743:(e,t,r)=>{var n=r(9509).Buffer,i=r(3482),a=r(8473),s=r(5717),o=r(2957),u=r(7753),l=r(5207);function h(e){a.Writable.call(this);var t=l[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function c(e){a.Writable.call(this);var t=l[e];if(!t)throw new Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){return new h(e)}function f(e){return new c(e)}Object.keys(l).forEach((function(e){l[e].id=n.from(l[e].id,"hex"),l[e.toLowerCase()]=l[e]})),s(h,a.Writable),h.prototype._write=function(e,t,r){this._hash.update(e),r()},h.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},h.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),n=o(r,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},s(c,a.Writable),c.prototype._write=function(e,t,r){this._hash.update(e),r()},c.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},c.prototype.verify=function(e,t,r){"string"==typeof t&&(t=n.from(t,r)),this.end();var i=this._hash.digest();return u(t,i,e,this._signType,this._tag)},e.exports={Sign:d,Verify:f,createSign:d,createVerify:f}},2957:(e,t,r)=>{var n=r(9509).Buffer,i=r(8355),a=r(3663),s=r(6266).ec,o=r(3550),u=r(980),l=r(1308);function h(e,t,r,a){if((e=n.from(e.toArray())).length<t.byteLength()){var s=n.alloc(t.byteLength()-e.length);e=n.concat([s,e])}var o=r.length,u=function(e,t){e=(e=c(e,t)).mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}(r,t),l=n.alloc(o);l.fill(1);var h=n.alloc(o);return h=i(a,h).update(l).update(n.from([0])).update(e).update(u).digest(),l=i(a,h).update(l).digest(),{k:h=i(a,h).update(l).update(n.from([1])).update(e).update(u).digest(),v:l=i(a,h).update(l).digest()}}function c(e,t){var r=new o(e),n=(e.length<<3)-t.bitLength();return n>0&&r.ishrn(n),r}function d(e,t,r){var a,s;do{for(a=n.alloc(0);8*a.length<e.bitLength();)t.v=i(r,t.k).update(t.v).digest(),a=n.concat([a,t.v]);s=c(a,e),t.k=i(r,t.k).update(t.v).update(n.from([0])).digest(),t.v=i(r,t.k).update(t.v).digest()}while(-1!==s.cmp(e));return s}function f(e,t,r,n){return e.toRed(o.mont(r)).redPow(t).fromRed().mod(n)}e.exports=function(e,t,r,i,p){var y=u(t);if(y.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(e,t){var r=l[t.curve.join(".")];if(!r)throw new Error("unknown curve "+t.curve.join("."));var i=new s(r).keyFromPrivate(t.privateKey).sign(e);return n.from(i.toDER())}(e,y)}if("dsa"===y.type){if("dsa"!==i)throw new Error("wrong private key type");return function(e,t,r){for(var i,a=t.params.priv_key,s=t.params.p,u=t.params.q,l=t.params.g,p=new o(0),y=c(e,u).mod(u),m=!1,b=h(a,u,e,r);!1===m;)p=f(l,i=d(u,b,r),s,u),0===(m=i.invm(u).imul(y.add(a.mul(p))).mod(u)).cmpn(0)&&(m=!1,p=new o(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e)),128&t[0]&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}(p,m)}(e,y,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");e=n.concat([p,e]);for(var m=y.modulus.byteLength(),b=[0,1];e.length+b.length+1<m;)b.push(255);b.push(0);for(var g=-1;++g<e.length;)b.push(e[g]);return a(b,y)},e.exports.getKey=h,e.exports.makeKey=d},7753:(e,t,r)=>{var n=r(9509).Buffer,i=r(3550),a=r(6266).ec,s=r(980),o=r(1308);function u(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,t,r,l,h){var c=s(r);if("ec"===c.type){if("ecdsa"!==l&&"ecdsa/rsa"!==l)throw new Error("wrong public key type");return function(e,t,r){var n=o[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new a(n),s=r.data.subjectPrivateKey.data;return i.verify(t,e,s)}(e,t,c)}if("dsa"===c.type){if("dsa"!==l)throw new Error("wrong public key type");return function(e,t,r){var n=r.data.p,a=r.data.q,o=r.data.g,l=r.data.pub_key,h=s.signature.decode(e,"der"),c=h.s,d=h.r;u(c,a),u(d,a);var f=i.mont(n),p=c.invm(a);return 0===o.toRed(f).redPow(new i(t).mul(p).mod(a)).fromRed().mul(l.toRed(f).redPow(d.mul(p).mod(a)).fromRed()).mod(n).mod(a).cmp(d)}(e,t,c)}if("rsa"!==l&&"ecdsa/rsa"!==l)throw new Error("wrong public key type");t=n.concat([h,t]);for(var d=c.modulus.byteLength(),f=[1],p=0;t.length+f.length+2<d;)f.push(255),p++;f.push(0);for(var y=-1;++y<t.length;)f.push(t[y]);f=n.from(f);var m=i.mont(c.modulus);e=(e=new i(e).toRed(m)).redPow(new i(c.publicExponent)),e=n.from(e.fromRed().toArray());var b=p<8?1:0;for(d=Math.min(e.length,f.length),e.length!==f.length&&(b=1),y=-1;++y<d;)b|=e[y]^f[y];return 0===b}},7295:(e,t,r)=>{var n=r(8764).Buffer;e.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new n(r),a=0;a<r;++a)i[a]=e[a]^t[a];return i}},8764:(e,t,r)=>{var n=r(9742),i=r(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;var s=2147483647;function o(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|y(e,t),n=o(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){var t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return f(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);var i=function(e){if(u.isBuffer(e)){var t=0|p(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||z(e.length)?o(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return h(e),o(e<0?0:0|p(e))}function d(e){for(var t=e.length<0?0:0|p(e.length),r=o(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function f(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(i)return n?-1:F(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var a,s=1,o=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var h=-1;for(a=r;a<o;a++)if(l(e,a)===l(t,-1===h?0:a-h)){if(-1===h&&(h=a),a-h+1===u)return h*s}else-1!==h&&(a-=a-h),h=-1}else for(r+u>o&&(r=o-u),a=r;a>=0;a--){for(var c=!0,d=0;d<u;d++)if(l(e,a+d)!==l(t,d)){c=!1;break}if(c)return a}return-1}function w(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var s=0;s<n;++s){var o=parseInt(t.substr(2*s,2),16);if(z(o))return s;e[r+s]=o}return s}function _(e,t,r,n){return j(F(t,e.length-r),e,r,n)}function M(e,t,r,n){return j(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function T(e,t,r,n){return j(U(t),e,r,n)}function E(e,t,r,n){return j(function(e,t){for(var r,n,i,a=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,s,o,u,l=e[i],h=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(h=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(h=u);break;case 3:a=e[i+1],s=e[i+2],128==(192&a)&&128==(192&s)&&(u=(15&l)<<12|(63&a)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(u=(15&l)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},u.allocUnsafe=function(e){return c(e)},u.allocUnsafeSlow=function(e){return c(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(q(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(q(a,Uint8Array))i+a.length>n.length?u.from(a).copy(n,i):Uint8Array.prototype.set.call(n,a,i);else{if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(q(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),o=Math.min(a,s),l=this.slice(n,i),h=e.slice(t,r),c=0;c<o;++c)if(l[c]!==h[c]){a=l[c],s=h[c];break}return a<s?-1:s<a?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return M(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function S(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function C(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=G[e[a]];return i}function O(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function R(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function P(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,a){return t=+t,r>>>=0,a||P(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,a){return t=+t,r>>>=0,a||P(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a<r&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=r-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var s=u.isBuffer(e)?e:u.from(e,n),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=s[a%o]}return this};var L=/[^+/0-9A-Za-z-_]/g;function F(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function U(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}var G=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},1924:(e,t,r)=>{var n=r(210),i=r(5559),a=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&a(e,".prototype.")>-1?i(r):r}},5559:(e,t,r)=>{var n=r(8612),i=r(210),a=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),o=i("%Reflect.apply%",!0)||n.call(s,a),u=i("%Object.getOwnPropertyDescriptor%",!0),l=i("%Object.defineProperty%",!0),h=i("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=o(n,s,arguments);return u&&l&&u(t,"length").configurable&&l(t,"length",{value:1+h(0,e.length-(arguments.length-1))}),t};var c=function(){return o(n,a,arguments)};l?l(e.exports,"apply",{value:c}):e.exports.apply=c},1027:(e,t,r)=>{var n=r(9509).Buffer,i=r(2830).Transform,a=r(2553).s;function s(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(5717)(s,i),s.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},s.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new a(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=s},6393:(e,t,r)=>{var n=r(8764).Buffer,i=r(6266),a=r(6426);e.exports=function(e){return new o(e)};var s={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function o(e){this.curveType=s[e],this.curveType||(this.curveType={name:e}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function u(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new n(e);if(r&&i.length<r){var a=new n(r-i.length);a.fill(0),i=n.concat([a,i])}return t?i.toString(t):i}s.p224=s.secp224r1,s.p256=s.secp256r1=s.prime256v1,s.p192=s.secp192r1=s.prime192v1,s.p384=s.secp384r1,s.p521=s.secp521r1,o.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},o.prototype.computeSecret=function(e,t,r){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),u(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},o.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),u(r,e)},o.prototype.getPrivateKey=function(e){return u(this.keys.getPrivate(),e)},o.prototype.setPublicKey=function(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this.keys._importPublic(e),this},o.prototype.setPrivateKey=function(e,t){t=t||"utf8",n.isBuffer(e)||(e=new n(e,t));var r=new a(e);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this}},6426:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8623).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function l(e,t,r,n){for(var i=0,a=Math.min(e.length,r),s=t;s<a;s++){var o=e.charCodeAt(s)-48;i*=n,i+=o>=49?o-49+10:o>=17?o-17+10:o}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,s,o=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,s=a%n,o=Math.min(a,a-s)+r,u=0,h=r;h<o;h+=n)u=l(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=l(e,h,e.length,t),h=0;h<s;h++)c*=t;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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"],c=[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],d=[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];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],s=i*a,o=67108863&s,u=s/67108864|0;r.words[0]=o;for(var l=1;l<n;l++){for(var h=u>>>26,c=67108863&u,d=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=d;f++){var p=l-f|0;h+=(s=(i=0|e.words[p])*(a=0|t.words[f])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,u=0|h}return 0!==u?r.words[l]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,s=0;s<this.length;s++){var o=this.words[s],u=(16777215&(o<<i|a)).toString(16);r=0!=(a=o>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=c[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?y+r:h[l-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var s,o,u="le"===t,l=new e(a),h=this.clone();if(u){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),l[o]=s;for(;o<a;o++)l[o]=0}else{for(o=0;o<a-i;o++)l[o]=0;for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),l[a-o-1]=s}return l},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,s=0;s<n.length;s++)a=(t=(0|r.words[s])-(0|n.words[s])+a)>>26,this.words[s]=67108863&t;for(;0!==a&&s<r.length;s++)a=(t=(0|r.words[s])+a)>>26,this.words[s]=67108863&t;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,a,s=e.words,o=t.words,u=r.words,l=0,h=0|s[0],c=8191&h,d=h>>>13,f=0|s[1],p=8191&f,y=f>>>13,m=0|s[2],b=8191&m,g=m>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],T=8191&M,E=M>>>13,A=0|s[5],x=8191&A,k=A>>>13,S=0|s[6],I=8191&S,C=S>>>13,O=0|s[7],R=8191&O,N=O>>>13,P=0|s[8],B=8191&P,D=P>>>13,L=0|s[9],F=8191&L,U=L>>>13,j=0|o[0],q=8191&j,z=j>>>13,G=0|o[1],K=8191&G,H=G>>>13,$=0|o[2],V=8191&$,W=$>>>13,Z=0|o[3],J=8191&Z,Y=Z>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,ie=0|o[6],ae=8191&ie,se=ie>>>13,oe=0|o[7],ue=8191&oe,le=oe>>>13,he=0|o[8],ce=8191&he,de=he>>>13,fe=0|o[9],pe=8191&fe,ye=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(l+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;l=((a=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(y,q)|0,a=Math.imul(y,z);var be=(l+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(d,K)|0))<<13)|0;l=((a=a+Math.imul(d,H)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(g,q)|0,a=Math.imul(g,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,H)|0;var ge=(l+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(d,V)|0))<<13)|0;l=((a=a+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,H)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,V)|0,a=a+Math.imul(y,W)|0;var ve=(l+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;l=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(E,q)|0,a=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,H)|0,n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Y)|0;var we=(l+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,a=Math.imul(k,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,H)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,W)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,ee)|0;var _e=(l+(n=n+Math.imul(c,re)|0)|0)+((8191&(i=(i=i+Math.imul(c,ne)|0)+Math.imul(d,re)|0))<<13)|0;l=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,a=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,H)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(E,V)|0,a=a+Math.imul(E,W)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0;var Me=(l+(n=n+Math.imul(c,ae)|0)|0)+((8191&(i=(i=i+Math.imul(c,se)|0)+Math.imul(d,ae)|0))<<13)|0;l=((a=a+Math.imul(d,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,z))+Math.imul(N,q)|0,a=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,H)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,V)|0,a=a+Math.imul(k,W)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,se)|0;var Te=(l+(n=n+Math.imul(c,ue)|0)|0)+((8191&(i=(i=i+Math.imul(c,le)|0)+Math.imul(d,ue)|0))<<13)|0;l=((a=a+Math.imul(d,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,H)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(C,V)|0,a=a+Math.imul(C,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(y,ue)|0,a=a+Math.imul(y,le)|0;var Ee=(l+(n=n+Math.imul(c,ce)|0)|0)+((8191&(i=(i=i+Math.imul(c,de)|0)+Math.imul(d,ce)|0))<<13)|0;l=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,z))+Math.imul(U,q)|0,a=Math.imul(U,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,H)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,V)|0,a=a+Math.imul(N,W)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Y)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,le)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,le)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,ce)|0,a=a+Math.imul(y,de)|0;var Ae=(l+(n=n+Math.imul(c,pe)|0)|0)+((8191&(i=(i=i+Math.imul(c,ye)|0)+Math.imul(d,pe)|0))<<13)|0;l=((a=a+Math.imul(d,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,K),i=(i=Math.imul(F,H))+Math.imul(U,K)|0,a=Math.imul(U,H),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,W)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Y)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,le)|0,n=n+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,de)|0;var xe=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;l=((a=a+Math.imul(y,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,V),i=(i=Math.imul(F,W))+Math.imul(U,V)|0,a=Math.imul(U,W),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Q)|0,a=a+Math.imul(N,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,le)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,ce)|0,a=a+Math.imul(_,de)|0;var ke=(l+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ye)|0)+Math.imul(g,pe)|0))<<13)|0;l=((a=a+Math.imul(g,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,J),i=(i=Math.imul(F,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,a=a+Math.imul(N,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,le)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(E,ce)|0,a=a+Math.imul(E,de)|0;var Se=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;l=((a=a+Math.imul(_,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(U,Q)|0,a=Math.imul(U,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(C,ue)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(k,ce)|0,a=a+Math.imul(k,de)|0;var Ie=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ye)|0)+Math.imul(E,pe)|0))<<13)|0;l=((a=a+Math.imul(E,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(U,re)|0,a=Math.imul(U,ne),n=n+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,se)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,le)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,de)|0;var Ce=(l+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(k,pe)|0))<<13)|0;l=((a=a+Math.imul(k,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(F,ae),i=(i=Math.imul(F,se))+Math.imul(U,ae)|0,a=Math.imul(U,se),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,le)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,ce)|0,a=a+Math.imul(N,de)|0;var Oe=(l+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(C,pe)|0))<<13)|0;l=((a=a+Math.imul(C,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,le))+Math.imul(U,ue)|0,a=Math.imul(U,le),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,de)|0;var Re=(l+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(N,pe)|0))<<13)|0;l=((a=a+Math.imul(N,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(F,ce),i=(i=Math.imul(F,de))+Math.imul(U,ce)|0,a=Math.imul(U,de);var Ne=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,ye)|0)+Math.imul(D,pe)|0))<<13)|0;l=((a=a+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Pe=(l+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,ye))+Math.imul(U,pe)|0))<<13)|0;return l=((a=Math.imul(U,ye))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=me,u[1]=be,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Te,u[8]=Ee,u[9]=Ae,u[10]=xe,u[11]=ke,u[12]=Se,u[13]=Ie,u[14]=Ce,u[15]=Oe,u[16]=Re,u[17]=Ne,u[18]=Pe,0!==l&&(u[19]=l,r.length++),r};function y(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=f),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var s=i;i=0;for(var o=67108863&n,u=Math.min(a,t.length-1),l=Math.max(0,a-e.length+1);l<=u;l++){var h=a-l,c=(0|e.words[h])*(0|t.words[l]),d=67108863&c;o=67108863&(d=d+o|0),i+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[a]=o,n=s,s=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,a){for(var s=0;s<a;s++)n[s]=t[e[s]],i[s]=r[e[s]]},m.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),h=0;h<i;h+=o)for(var c=u,d=l,f=0;f<s;f++){var p=r[h+f],y=n[h+f],m=r[h+f+s],b=n[h+f+s],g=c*m-d*b;b=c*b+d*m,m=g,r[h+f]=p+m,n[h+f]=y+b,r[h+f+s]=p-m,n[h+f+s]=y-b,f!==o&&(g=u*c-l*d,d=u*d+l*c,c=g)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var a=0,s=0;s<t;s++)a+=0|e[s],r[2*s]=8191&a,a>>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===a),n(0==(-8192&a))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),s=new Array(n),o=new Array(n),u=new Array(n),l=new Array(n),h=new Array(n),c=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,l,n),this.transform(s,a,o,u,n,i),this.transform(l,a,h,c,n,i);for(var f=0;f<n;f++){var p=o[f]*h[f]-u[f]*c[f];u[f]=o[f]*c[f]+u[f]*h[f],o[f]=p}return this.conjugate(o,u,n),this.transform(o,u,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),y(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&a,u=(0|this.words[t])-o<<r;this.words[t]=u|s,s=o>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<<a,u=r;if(i-=s,i=Math.max(0,i),u){for(var l=0;l<s;l++)u.words[l]=this.words[l];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var h=0;for(l=this.length-1;l>=0&&(0!==h||l>=i);l--){var c=0|this.words[l];this.words[l]=h<<26-a|c>>>a,h=c&o}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i,a,s=e.length+r;this._expand(s);var o=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+o;var u=(0|e.words[i])*t;o=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)o=(a=(0|this.words[i+r])+o)>>26,this.words[i+r]=67108863&a;if(0===o)return this.strip();for(n(-1===o),o=0,i=0;i<this.length;i++)o=(a=-(0|this.words[i])+o)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var o,u=n.length-i.length;if("mod"!==t){(o=new a(null)).length=u+1,o.words=new Array(o.length);for(var l=0;l<o.length;l++)o.words[l]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,o&&(o.words[u]=1));for(var c=u-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);o&&(o.words[c]=d)}return o&&o.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,o},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),s=new a(0),o=new a(0),u=new a(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var h=r.clone(),c=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(h),u.isub(c)),o.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o),s.isub(u)):(r.isub(t),o.isub(i),u.isub(s))}return{a:o,b:u,gcd:r.iushln(l)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new a(1),o=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(i=0===t.cmpn(1)?s:o).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,s=r;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new T(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}g.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|a>>>22,a=s}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,g),i(_,g),i(M,g),M.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return b[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var o=new a(1).toRed(this),u=o.redNeg(),l=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new a(2*h*h).toRed(this);0!==this.pow(h,l).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),d=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(o);){for(var y=f,m=0;0!==y.cmp(o);m++)y=y.redSqr();n(m<p);var b=this.pow(c,new a(1).iushln(p-m-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=m}return d},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,o=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],h=u-1;h>=0;h--){var c=l>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++o||0===n&&0===h)&&(i=this.mul(i,r[s]),o=0,s=0)):o=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new E(e)},i(E,T),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},3482:(e,t,r)=>{var n=r(5717),i=r(2318),a=r(9785),s=r(9072),o=r(1027);function u(e){o.call(this,"digest"),this._hash=e}n(u,o),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new a:new u(s(e))}},8028:(e,t,r)=>{var n=r(2318);e.exports=function(e){return(new n).update(e).digest()}},8355:(e,t,r)=>{var n=r(5717),i=r(1031),a=r(1027),s=r(9509).Buffer,o=r(8028),u=r(9785),l=r(9072),h=s.alloc(128);function c(e,t){a.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var r="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>r?t=("rmd160"===e?new u:l(e)).update(t).digest():t.length<r&&(t=s.concat([t,h],r));for(var n=this._ipad=s.allocUnsafe(r),i=this._opad=s.allocUnsafe(r),o=0;o<r;o++)n[o]=54^t[o],i[o]=92^t[o];this._hash="rmd160"===e?new u:l(e),this._hash.update(n)}n(c,a),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new u:l(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new c("rmd160",t):"md5"===e?new i(o,t):new c(e,t)}},1031:(e,t,r)=>{var n=r(5717),i=r(9509).Buffer,a=r(1027),s=i.alloc(128),o=64;function u(e,t){a.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>o?t=e(t):t.length<o&&(t=i.concat([t,s],o));for(var r=this._ipad=i.allocUnsafe(o),n=this._opad=i.allocUnsafe(o),u=0;u<o;u++)r[u]=54^t[u],n[u]=92^t[u];this._hash=[r]}n(u,a),u.prototype._update=function(e){this._hash.push(e)},u.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=u},4098:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(r.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function s(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function c(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function d(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=d(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=d(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(c)}),this.text=function(){var e,t,r,n=l(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=h(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=a(e),t=s(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[a(e)]},u.prototype.get=function(e){return e=a(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},u.prototype.set=function(e,t){this.map[a(e)]=s(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),o(e)},u.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),o(e)},u.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),o(e)},r.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(e,t){var r,n,i=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),p.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},f.call(y.prototype),f.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var g=[301,302,303,307,308];b.redirect=function(e,t){if(-1===g.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function v(e,n){return new Promise((function(i,a){var s=new y(e,n);if(s.signal&&s.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function l(){o.abort()}o.onload=function(){var e,t,r={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var n="response"in o?o.response:o.responseText;i(new b(n,r))},o.onerror=function(){a(new TypeError("Network request failed"))},o.ontimeout=function(){a(new TypeError("Network request failed"))},o.onabort=function(){a(new t.DOMException("Aborted","AbortError"))},o.open(s.method,s.url,!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&r.blob&&(o.responseType="blob"),s.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",l),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",l)}),o.send(void 0===s._bodyInit?null:s._bodyInit)}))}v.polyfill=!0,e.fetch||(e.fetch=v,e.Headers=u,e.Request=y,e.Response=b),t.Headers=u,t.Request=y,t.Response=b,t.fetch=v,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},5835:(e,t,r)=>{t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(1798),t.createHash=t.Hash=r(3482),t.createHmac=t.Hmac=r(8355);var n=r(6042),i=Object.keys(n),a=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return a};var s=r(5632);t.pbkdf2=s.pbkdf2,t.pbkdf2Sync=s.pbkdf2Sync;var o=r(3614);t.Cipher=o.Cipher,t.createCipher=o.createCipher,t.Cipheriv=o.Cipheriv,t.createCipheriv=o.createCipheriv,t.Decipher=o.Decipher,t.createDecipher=o.createDecipher,t.Decipheriv=o.Decipheriv,t.createDecipheriv=o.createDecipheriv,t.getCiphers=o.getCiphers,t.listCiphers=o.listCiphers;var u=r(2607);t.DiffieHellmanGroup=u.DiffieHellmanGroup,t.createDiffieHellmanGroup=u.createDiffieHellmanGroup,t.getDiffieHellman=u.getDiffieHellman,t.createDiffieHellman=u.createDiffieHellman,t.DiffieHellman=u.DiffieHellman;var l=r(4743);t.createSign=l.createSign,t.Sign=l.Sign,t.createVerify=l.createVerify,t.Verify=l.Verify,t.createECDH=r(6393);var h=r(7900);t.publicEncrypt=h.publicEncrypt,t.privateEncrypt=h.privateEncrypt,t.publicDecrypt=h.publicDecrypt,t.privateDecrypt=h.privateDecrypt;var c=r(7963);t.randomFill=c.randomFill,t.randomFillSync=c.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},1227:(e,t,r)=>{var n=r(4155);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(2447)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,a,s=null;function o(...e){if(!o.enabled)return;const n=o,i=Number(new Date),a=i-(r||i);n.diff=a,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const a=t.formatters[i];if("function"==typeof a){const t=e[s];r=a.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=n,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,a=t.enabled(e)),a),set:e=>{s=e}}),"function"==typeof t.init&&t.init(o),o}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(7824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},4289:(e,t,r)=>{var n=r(2215),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),a=Object.prototype.toString,s=Array.prototype.concat,o=Object.defineProperty,u=r(1044)(),l=o&&u,h=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==a.call(i)||!n())return;var i;l?o(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r},c=function(e,t){var r=arguments.length>2?arguments[2]:{},a=n(t);i&&(a=s.call(a,Object.getOwnPropertySymbols(t)));for(var o=0;o<a.length;o+=1)h(e,a[o],t[a[o]],r[a[o]])};c.supportsDescriptors=!!l,e.exports=c},5251:(e,t,r)=>{t.utils=r(1278),t.Cipher=r(5756),t.DES=r(778),t.CBC=r(9051),t.EDE=r(651)},9051:(e,t,r)=>{var n=r(9746),i=r(5717),a={};function s(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var r=Object.keys(a),n=0;n<r.length;n++){var s=r[n];t.prototype[s]=a[s]}return t.create=function(e){return new t(e)},t},a._cbcInit=function(){var e=new s(this.options.iv);this._cbcState=e},a._update=function(e,t,r,n){var i=this._cbcState,a=this.constructor.super_.prototype,s=i.iv;if("encrypt"===this.type){for(var o=0;o<this.blockSize;o++)s[o]^=e[t+o];for(a._update.call(this,s,0,r,n),o=0;o<this.blockSize;o++)s[o]=r[n+o]}else{for(a._update.call(this,e,t,r,n),o=0;o<this.blockSize;o++)r[n+o]^=s[o];for(o=0;o<this.blockSize;o++)s[o]=e[t+o]}}},5756:(e,t,r)=>{var n=r(9746);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n<r;n++)this.buffer[this.bufferOff+n]=e[t+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(e){var t=0,r=0,n=(this.bufferOff+e.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var a=e.length-(e.length-t)%this.blockSize;t<a;t+=this.blockSize)this._update(e,t,i,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i},i.prototype._updateDecrypt=function(e){for(var t=0,r=0,n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},i.prototype._unpad=function(e){return e},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},778:(e,t,r)=>{var n=r(9746),i=r(5717),a=r(1278),s=r(5756);function o(){this.tmp=new Array(2),this.keys=null}function u(e){s.call(this,e);var t=new o;this._desState=t,this.deriveKeys(t,e.key)}i(u,s),e.exports=u,u.create=function(e){return new u(e)};var l=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(e,t){e.keys=new Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var r=a.readUInt32BE(t,0),i=a.readUInt32BE(t,4);a.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var s=0;s<e.keys.length;s+=2){var o=l[s>>>1];r=a.r28shl(r,o),i=a.r28shl(i,o),a.pc2(r,i,e.keys,s)}},u.prototype._update=function(e,t,r,n){var i=this._desState,s=a.readUInt32BE(e,t),o=a.readUInt32BE(e,t+4);a.ip(s,o,i.tmp,0),s=i.tmp[0],o=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,o,i.tmp,0):this._decrypt(i,s,o,i.tmp,0),s=i.tmp[0],o=i.tmp[1],a.writeUInt32BE(r,s,n),a.writeUInt32BE(r,o,n+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n<e.length;n++)e[n]=r;return!0},u.prototype._unpad=function(e){for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)n.equal(e[r],t);return e.slice(0,e.length-t)},u.prototype._encrypt=function(e,t,r,n,i){for(var s=t,o=r,u=0;u<e.keys.length;u+=2){var l=e.keys[u],h=e.keys[u+1];a.expand(o,e.tmp,0),l^=e.tmp[0],h^=e.tmp[1];var c=a.substitute(l,h),d=o;o=(s^a.permute(c))>>>0,s=d}a.rip(o,s,n,i)},u.prototype._decrypt=function(e,t,r,n,i){for(var s=r,o=t,u=e.keys.length-2;u>=0;u-=2){var l=e.keys[u],h=e.keys[u+1];a.expand(s,e.tmp,0),l^=e.tmp[0],h^=e.tmp[1];var c=a.substitute(l,h),d=s;s=(o^a.permute(c))>>>0,o=d}a.rip(s,o,n,i)}},651:(e,t,r)=>{var n=r(9746),i=r(5717),a=r(5756),s=r(778);function o(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),a=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:a})]:[s.create({type:"decrypt",key:a}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){a.call(this,e);var t=new o(this.type,this.options.key);this._edeState=t}i(u,a),e.exports=u,u.create=function(e){return new u(e)},u.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},1278:(e,t)=>{t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,a=0,s=6;s>=0;s-=2){for(var o=0;o<=24;o+=8)i<<=1,i|=t>>>o+s&1;for(o=0;o<=24;o+=8)i<<=1,i|=e>>>o+s&1}for(s=6;s>=0;s-=2){for(o=1;o<=25;o+=8)a<<=1,a|=t>>>o+s&1;for(o=1;o<=25;o+=8)a<<=1,a|=e>>>o+s&1}r[n+0]=i>>>0,r[n+1]=a>>>0},t.rip=function(e,t,r,n){for(var i=0,a=0,s=0;s<4;s++)for(var o=24;o>=0;o-=8)i<<=1,i|=t>>>o+s&1,i<<=1,i|=e>>>o+s&1;for(s=4;s<8;s++)for(o=24;o>=0;o-=8)a<<=1,a|=t>>>o+s&1,a<<=1,a|=e>>>o+s&1;r[n+0]=i>>>0,r[n+1]=a>>>0},t.pc1=function(e,t,r,n){for(var i=0,a=0,s=7;s>=5;s--){for(var o=0;o<=24;o+=8)i<<=1,i|=t>>o+s&1;for(o=0;o<=24;o+=8)i<<=1,i|=e>>o+s&1}for(o=0;o<=24;o+=8)i<<=1,i|=t>>o+s&1;for(s=1;s<=3;s++){for(o=0;o<=24;o+=8)a<<=1,a|=t>>o+s&1;for(o=0;o<=24;o+=8)a<<=1,a|=e>>o+s&1}for(o=0;o<=24;o+=8)a<<=1,a|=e>>o+s&1;r[n+0]=i>>>0,r[n+1]=a>>>0},t.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,n,i){for(var a=0,s=0,o=r.length>>>1,u=0;u<o;u++)a<<=1,a|=e>>>r[u]&1;for(u=o;u<r.length;u++)s<<=1,s|=t>>>r[u]&1;n[i+0]=a>>>0,n[i+1]=s>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var a=23;a>=15;a-=4)n<<=6,n|=e>>>a&63;for(a=11;a>=3;a-=4)i|=e>>>a&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,i=0;i<4;i++)r<<=4,r|=n[64*i+(e>>>18-6*i&63)];for(i=0;i<4;i++)r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)];return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r<i.length;r++)t<<=1,t|=e>>>i[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length<t;)n="0"+n;for(var i=[],a=0;a<t;a+=r)i.push(n.slice(a,a+r));return i.join(" ")}},2607:(e,t,r)=>{var n=r(8764).Buffer,i=r(3590),a=r(9799),s=r(7426),o={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(e){var t=new n(a[e].prime,"hex"),r=new n(a[e].gen,"hex");return new s(t,r)},t.createDiffieHellman=t.DiffieHellman=function e(t,r,a,u){return n.isBuffer(r)||void 0===o[r]?e(t,"binary",r,a):(r=r||"binary",u=u||"binary",a=a||new n([2]),n.isBuffer(a)||(a=new n(a,u)),"number"==typeof t?new s(i(t,a),a,!0):(n.isBuffer(t)||(t=new n(t,r)),new s(t,a,!0)))}},7426:(e,t,r)=>{var n=r(8764).Buffer,i=r(3620),a=new(r(3047)),s=new i(24),o=new i(11),u=new i(10),l=new i(3),h=new i(7),c=r(3590),d=r(1798);function f(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this._pub=new i(e),this}function p(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this._priv=new i(e),this}e.exports=m;var y={};function m(e,t,r){this.setGenerator(t),this.__prime=new i(e),this._prime=i.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=f,this.setPrivateKey=p):this._primeCode=8}function b(e,t){var r=new n(e.toArray());return t?r.toString(t):r}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in y)return y[n];var i,d=0;if(e.isEven()||!c.simpleSieve||!c.fermatTest(e)||!a.test(e))return d+=1,d+="02"===r||"05"===r?8:4,y[n]=d,d;switch(a.test(e.shrn(1))||(d+=2),r){case"02":e.mod(s).cmp(o)&&(d+=8);break;case"05":(i=e.mod(u)).cmp(l)&&i.cmp(h)&&(d+=8);break;default:d+=4}return y[n]=d,d}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new i(d(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(e){var t=(e=(e=new i(e)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new n(t.toArray()),a=this.getPrime();if(r.length<a.length){var s=new n(a.length-r.length);s.fill(0),r=n.concat([s,r])}return r},m.prototype.getPublicKey=function(e){return b(this._pub,e)},m.prototype.getPrivateKey=function(e){return b(this._priv,e)},m.prototype.getPrime=function(e){return b(this.__prime,e)},m.prototype.getGenerator=function(e){return b(this._gen,e)},m.prototype.setGenerator=function(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this.__gen=e,this._gen=new i(e),this}},3590:(e,t,r)=>{var n=r(1798);e.exports=g,g.simpleSieve=m,g.fermatTest=b;var i=r(3620),a=new i(24),s=new(r(3047)),o=new i(1),u=new i(2),l=new i(5),h=(new i(16),new i(8),new i(10)),c=new i(3),d=(new i(7),new i(11)),f=new i(4),p=(new i(12),null);function y(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<t&&e[i]<=n&&r%e[i]!=0;i++);t!==i&&e[i]<=n||(e[t++]=r)}return p=e,e}function m(e){for(var t=y(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function b(e){var t=i.mont(e);return 0===u.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function g(e,t){if(e<16)return new i(2===t||5===t?[140,123]:[140,39]);var r,p;for(t=new i(t);;){for(r=new i(n(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(o),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(l))for(;r.mod(h).cmp(c);)r.iadd(f)}else for(;r.mod(a).cmp(d);)r.iadd(f);if(m(p=r.shrn(1))&&m(r)&&b(p)&&b(r)&&s.test(p)&&s.test(r))return r}}},3620:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7748).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function l(e,t,r,n){for(var i=0,a=Math.min(e.length,r),s=t;s<a;s++){var o=e.charCodeAt(s)-48;i*=n,i+=o>=49?o-49+10:o>=17?o-17+10:o}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,s,o=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,s=a%n,o=Math.min(a,a-s)+r,u=0,h=r;h<o;h+=n)u=l(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=l(e,h,e.length,t),h=0;h<s;h++)c*=t;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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"],c=[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],d=[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];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],s=i*a,o=67108863&s,u=s/67108864|0;r.words[0]=o;for(var l=1;l<n;l++){for(var h=u>>>26,c=67108863&u,d=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=d;f++){var p=l-f|0;h+=(s=(i=0|e.words[p])*(a=0|t.words[f])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,u=0|h}return 0!==u?r.words[l]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,s=0;s<this.length;s++){var o=this.words[s],u=(16777215&(o<<i|a)).toString(16);r=0!=(a=o>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=c[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?y+r:h[l-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var s,o,u="le"===t,l=new e(a),h=this.clone();if(u){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),l[o]=s;for(;o<a;o++)l[o]=0}else{for(o=0;o<a-i;o++)l[o]=0;for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),l[a-o-1]=s}return l},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,s=0;s<n.length;s++)a=(t=(0|r.words[s])-(0|n.words[s])+a)>>26,this.words[s]=67108863&t;for(;0!==a&&s<r.length;s++)a=(t=(0|r.words[s])+a)>>26,this.words[s]=67108863&t;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,a,s=e.words,o=t.words,u=r.words,l=0,h=0|s[0],c=8191&h,d=h>>>13,f=0|s[1],p=8191&f,y=f>>>13,m=0|s[2],b=8191&m,g=m>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],T=8191&M,E=M>>>13,A=0|s[5],x=8191&A,k=A>>>13,S=0|s[6],I=8191&S,C=S>>>13,O=0|s[7],R=8191&O,N=O>>>13,P=0|s[8],B=8191&P,D=P>>>13,L=0|s[9],F=8191&L,U=L>>>13,j=0|o[0],q=8191&j,z=j>>>13,G=0|o[1],K=8191&G,H=G>>>13,$=0|o[2],V=8191&$,W=$>>>13,Z=0|o[3],J=8191&Z,Y=Z>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,ie=0|o[6],ae=8191&ie,se=ie>>>13,oe=0|o[7],ue=8191&oe,le=oe>>>13,he=0|o[8],ce=8191&he,de=he>>>13,fe=0|o[9],pe=8191&fe,ye=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(l+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;l=((a=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(y,q)|0,a=Math.imul(y,z);var be=(l+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(d,K)|0))<<13)|0;l=((a=a+Math.imul(d,H)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(g,q)|0,a=Math.imul(g,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,H)|0;var ge=(l+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(d,V)|0))<<13)|0;l=((a=a+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,H)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,V)|0,a=a+Math.imul(y,W)|0;var ve=(l+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;l=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(E,q)|0,a=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,H)|0,n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Y)|0;var we=(l+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,a=Math.imul(k,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,H)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,W)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,ee)|0;var _e=(l+(n=n+Math.imul(c,re)|0)|0)+((8191&(i=(i=i+Math.imul(c,ne)|0)+Math.imul(d,re)|0))<<13)|0;l=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,a=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,H)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(E,V)|0,a=a+Math.imul(E,W)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0;var Me=(l+(n=n+Math.imul(c,ae)|0)|0)+((8191&(i=(i=i+Math.imul(c,se)|0)+Math.imul(d,ae)|0))<<13)|0;l=((a=a+Math.imul(d,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,z))+Math.imul(N,q)|0,a=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,H)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,V)|0,a=a+Math.imul(k,W)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,se)|0;var Te=(l+(n=n+Math.imul(c,ue)|0)|0)+((8191&(i=(i=i+Math.imul(c,le)|0)+Math.imul(d,ue)|0))<<13)|0;l=((a=a+Math.imul(d,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,H)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(C,V)|0,a=a+Math.imul(C,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(y,ue)|0,a=a+Math.imul(y,le)|0;var Ee=(l+(n=n+Math.imul(c,ce)|0)|0)+((8191&(i=(i=i+Math.imul(c,de)|0)+Math.imul(d,ce)|0))<<13)|0;l=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,z))+Math.imul(U,q)|0,a=Math.imul(U,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,H)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,V)|0,a=a+Math.imul(N,W)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Y)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,le)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,le)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,ce)|0,a=a+Math.imul(y,de)|0;var Ae=(l+(n=n+Math.imul(c,pe)|0)|0)+((8191&(i=(i=i+Math.imul(c,ye)|0)+Math.imul(d,pe)|0))<<13)|0;l=((a=a+Math.imul(d,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,K),i=(i=Math.imul(F,H))+Math.imul(U,K)|0,a=Math.imul(U,H),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,W)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Y)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,le)|0,n=n+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,de)|0;var xe=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;l=((a=a+Math.imul(y,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,V),i=(i=Math.imul(F,W))+Math.imul(U,V)|0,a=Math.imul(U,W),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Q)|0,a=a+Math.imul(N,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,le)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,ce)|0,a=a+Math.imul(_,de)|0;var ke=(l+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ye)|0)+Math.imul(g,pe)|0))<<13)|0;l=((a=a+Math.imul(g,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,J),i=(i=Math.imul(F,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,a=a+Math.imul(N,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,le)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(E,ce)|0,a=a+Math.imul(E,de)|0;var Se=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;l=((a=a+Math.imul(_,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(U,Q)|0,a=Math.imul(U,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(C,ue)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(k,ce)|0,a=a+Math.imul(k,de)|0;var Ie=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ye)|0)+Math.imul(E,pe)|0))<<13)|0;l=((a=a+Math.imul(E,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(U,re)|0,a=Math.imul(U,ne),n=n+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,se)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,le)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,de)|0;var Ce=(l+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(k,pe)|0))<<13)|0;l=((a=a+Math.imul(k,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(F,ae),i=(i=Math.imul(F,se))+Math.imul(U,ae)|0,a=Math.imul(U,se),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,le)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,ce)|0,a=a+Math.imul(N,de)|0;var Oe=(l+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(C,pe)|0))<<13)|0;l=((a=a+Math.imul(C,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,le))+Math.imul(U,ue)|0,a=Math.imul(U,le),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,de)|0;var Re=(l+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(N,pe)|0))<<13)|0;l=((a=a+Math.imul(N,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(F,ce),i=(i=Math.imul(F,de))+Math.imul(U,ce)|0,a=Math.imul(U,de);var Ne=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,ye)|0)+Math.imul(D,pe)|0))<<13)|0;l=((a=a+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Pe=(l+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,ye))+Math.imul(U,pe)|0))<<13)|0;return l=((a=Math.imul(U,ye))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=me,u[1]=be,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Te,u[8]=Ee,u[9]=Ae,u[10]=xe,u[11]=ke,u[12]=Se,u[13]=Ie,u[14]=Ce,u[15]=Oe,u[16]=Re,u[17]=Ne,u[18]=Pe,0!==l&&(u[19]=l,r.length++),r};function y(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=f),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var s=i;i=0;for(var o=67108863&n,u=Math.min(a,t.length-1),l=Math.max(0,a-e.length+1);l<=u;l++){var h=a-l,c=(0|e.words[h])*(0|t.words[l]),d=67108863&c;o=67108863&(d=d+o|0),i+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[a]=o,n=s,s=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,a){for(var s=0;s<a;s++)n[s]=t[e[s]],i[s]=r[e[s]]},m.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),h=0;h<i;h+=o)for(var c=u,d=l,f=0;f<s;f++){var p=r[h+f],y=n[h+f],m=r[h+f+s],b=n[h+f+s],g=c*m-d*b;b=c*b+d*m,m=g,r[h+f]=p+m,n[h+f]=y+b,r[h+f+s]=p-m,n[h+f+s]=y-b,f!==o&&(g=u*c-l*d,d=u*d+l*c,c=g)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var a=0,s=0;s<t;s++)a+=0|e[s],r[2*s]=8191&a,a>>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===a),n(0==(-8192&a))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),s=new Array(n),o=new Array(n),u=new Array(n),l=new Array(n),h=new Array(n),c=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,l,n),this.transform(s,a,o,u,n,i),this.transform(l,a,h,c,n,i);for(var f=0;f<n;f++){var p=o[f]*h[f]-u[f]*c[f];u[f]=o[f]*c[f]+u[f]*h[f],o[f]=p}return this.conjugate(o,u,n),this.transform(o,u,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),y(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&a,u=(0|this.words[t])-o<<r;this.words[t]=u|s,s=o>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<<a,u=r;if(i-=s,i=Math.max(0,i),u){for(var l=0;l<s;l++)u.words[l]=this.words[l];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var h=0;for(l=this.length-1;l>=0&&(0!==h||l>=i);l--){var c=0|this.words[l];this.words[l]=h<<26-a|c>>>a,h=c&o}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i,a,s=e.length+r;this._expand(s);var o=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+o;var u=(0|e.words[i])*t;o=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)o=(a=(0|this.words[i+r])+o)>>26,this.words[i+r]=67108863&a;if(0===o)return this.strip();for(n(-1===o),o=0,i=0;i<this.length;i++)o=(a=-(0|this.words[i])+o)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var o,u=n.length-i.length;if("mod"!==t){(o=new a(null)).length=u+1,o.words=new Array(o.length);for(var l=0;l<o.length;l++)o.words[l]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,o&&(o.words[u]=1));for(var c=u-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);o&&(o.words[c]=d)}return o&&o.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,o},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),s=new a(0),o=new a(0),u=new a(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var h=r.clone(),c=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(h),u.isub(c)),o.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o),s.isub(u)):(r.isub(t),o.isub(i),u.isub(s))}return{a:o,b:u,gcd:r.iushln(l)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new a(1),o=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(i=0===t.cmpn(1)?s:o).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,s=r;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new T(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}g.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|a>>>22,a=s}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,g),i(_,g),i(M,g),M.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return b[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var o=new a(1).toRed(this),u=o.redNeg(),l=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new a(2*h*h).toRed(this);0!==this.pow(h,l).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),d=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(o);){for(var y=f,m=0;0!==y.cmp(o);m++)y=y.redSqr();n(m<p);var b=this.pow(c,new a(1).iushln(p-m-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=m}return d},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,o=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],h=u-1;h>=0;h--){var c=l>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++o||0===n&&0===h)&&(i=this.mul(i,r[s]),o=0,s=0)):o=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new E(e)},i(E,T),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6266:(e,t,r)=>{var n=t;n.version=r(8597).i8,n.utils=r(953),n.rand=r(9931),n.curve=r(8254),n.curves=r(5427),n.ec=r(7954),n.eddsa=r(5980)},4918:(e,t,r)=>{var n=r(3785),i=r(953),a=i.getNAF,s=i.getJSF,o=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function l(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){o(e.precomputed);var r=e._getDoubles(),n=a(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,u,l=[];for(s=0;s<n.length;s+=r.step){u=0;for(var h=s+r.step-1;h>=s;h--)u=(u<<1)+n[h];l.push(u)}for(var c=this.jpoint(null,null,null),d=this.jpoint(null,null,null),f=i;f>0;f--){for(s=0;s<l.length;s++)(u=l[s])===f?d=d.mixedAdd(r.points[s]):u===-f&&(d=d.mixedAdd(r.points[s].neg()));c=c.add(d)}return c.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=a(t,r,this._bitLength),u=this.jpoint(null,null,null),l=s.length-1;l>=0;l--){for(var h=0;l>=0&&0===s[l];l--)h++;if(l>=0&&h++,u=u.dblp(h),l<0)break;var c=s[l];o(0!==c),u="affine"===e.type?c>0?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):c>0?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var o,u,l,h=this._wnafT1,c=this._wnafT2,d=this._wnafT3,f=0;for(o=0;o<n;o++){var p=(l=t[o])._getNAFPoints(e);h[o]=p.wnd,c[o]=p.points}for(o=n-1;o>=1;o-=2){var y=o-1,m=o;if(1===h[y]&&1===h[m]){var b=[t[y],null,null,t[m]];0===t[y].y.cmp(t[m].y)?(b[1]=t[y].add(t[m]),b[2]=t[y].toJ().mixedAdd(t[m].neg())):0===t[y].y.cmp(t[m].y.redNeg())?(b[1]=t[y].toJ().mixedAdd(t[m]),b[2]=t[y].add(t[m].neg())):(b[1]=t[y].toJ().mixedAdd(t[m]),b[2]=t[y].toJ().mixedAdd(t[m].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[y],r[m]);for(f=Math.max(v[0].length,f),d[y]=new Array(f),d[m]=new Array(f),u=0;u<f;u++){var w=0|v[0][u],_=0|v[1][u];d[y][u]=g[3*(w+1)+(_+1)],d[m][u]=0,c[y]=b}}else d[y]=a(r[y],h[y],this._bitLength),d[m]=a(r[m],h[m],this._bitLength),f=Math.max(d[y].length,f),f=Math.max(d[m].length,f)}var M=this.jpoint(null,null,null),T=this._wnafT4;for(o=f;o>=0;o--){for(var E=0;o>=0;){var A=!0;for(u=0;u<n;u++)T[u]=0|d[u][o],0!==T[u]&&(A=!1);if(!A)break;E++,o--}if(o>=0&&E++,M=M.dblp(E),o<0)break;for(u=0;u<n;u++){var x=T[u];0!==x&&(x>0?l=c[u][x-1>>1]:x<0&&(l=c[u][-x-1>>1].neg()),M="affine"===l.type?M.mixedAdd(l):M.add(l))}}for(o=0;o<n;o++)c[o]=null;return i?M:M.toP()},u.BasePoint=l,l.prototype.eq=function(){throw new Error("Not implemented")},l.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?o(e[e.length-1]%2==0):7===e[0]&&o(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},l.prototype.encodeCompressed=function(e){return this.encode(e,!0)},l.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},l.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},l.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},l.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)},l.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var a=0;a<e;a++)n=n.dbl();r.push(n)}return{step:e,points:r}},l.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},l.prototype._getBeta=function(){return null},l.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},1138:(e,t,r)=>{var n=r(953),i=r(3785),a=r(5717),s=r(4918),o=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),o(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function l(e,t,r,n,a){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(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 i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=a&&new i(a,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()))))}a(u,s),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),a=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(a.redInvm()),o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=o.fromRed().isOdd();return(t&&!u||!t&&u)&&(o=o.redNeg()),this.point(e,o)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),a=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(a.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return o.fromRed().isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},a(l,s.BasePoint),u.prototype.pointFromJSON=function(e){return l.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new l(this,e,t,r,n)},l.fromJSON=function(e,t){return new l(e,t[0],t[1],t[2])},l.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)+">"},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=n.redAdd(t),s=a.redSub(r),o=n.redSub(t),u=i.redMul(s),l=a.redMul(o),h=i.redMul(o),c=s.redMul(a);return this.curve.point(u,l,c,h)},l.prototype._projDbl=function(){var e,t,r,n,i,a,s=this.x.redAdd(this.y).redSqr(),o=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var l=(n=this.curve._mulA(o)).redAdd(u);this.zOne?(e=s.redSub(o).redSub(u).redMul(l.redSub(this.curve.two)),t=l.redMul(n.redSub(u)),r=l.redSqr().redSub(l).redSub(l)):(i=this.z.redSqr(),a=l.redSub(i).redISub(i),e=s.redSub(o).redISub(u).redMul(a),t=l.redMul(n.redSub(u)),r=l.redMul(a))}else n=o.redAdd(u),i=this.curve._mulC(this.z).redSqr(),a=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(a),t=this.curve._mulC(n).redMul(o.redISub(u)),r=n.redMul(a);return this.curve.point(e,t,r)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),s=i.redSub(n),o=i.redAdd(n),u=r.redAdd(t),l=a.redMul(s),h=o.redMul(u),c=a.redMul(u),d=s.redMul(o);return this.curve.point(l,h,d,c)},l.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),a=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(a).redMul(s),u=i.redSub(o),l=i.redAdd(o),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(s),c=n.redMul(u).redMul(h);return this.curve.twisted?(t=n.redMul(l).redMul(s.redSub(this.curve._mulA(a))),r=u.redMul(l)):(t=n.redMul(l).redMul(s.redSub(a)),r=this.curve._mulC(u).redMul(l)),this.curve.point(c,t,r)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},l.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},l.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},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},8254:(e,t,r)=>{var n=t;n.base=r(4918),n.short=r(6673),n.mont=r(2881),n.edwards=r(1138)},2881:(e,t,r)=>{var n=r(3785),i=r(5717),a=r(4918),s=r(953);function o(e){a.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(o,a),e.exports=o,o.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,a.BasePoint),o.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},o.prototype.point=function(e,t){return new u(this,e,t)},o.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.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)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),s=i.redMul(n),o=t.z.redMul(a.redAdd(s).redSqr()),u=t.x.redMul(a.redISub(s).redSqr());return this.curve.point(o,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var a=i.length-1;a>=0;a--)0===i[a]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},6673:(e,t,r)=>{var n=r(953),i=r(3785),a=r(5717),s=r(4918),o=n.assert;function u(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function l(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(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)}function h(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(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.zOne=this.z===this.curve.one}a(u,s),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))?r=a[0]:(r=a[1],o(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),a=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(a).fromRed(),n.redSub(a).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,a,s,o,u,l,h,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,f=this.n.clone(),p=new i(1),y=new i(0),m=new i(0),b=new i(1),g=0;0!==d.cmpn(0);){var v=f.div(d);l=f.sub(v.mul(d)),h=m.sub(v.mul(p));var w=b.sub(v.mul(y));if(!n&&l.cmp(c)<0)t=u.neg(),r=p,n=l.neg(),a=h;else if(n&&2==++g)break;u=l,f=d,d=l,m=p,p=h,b=y,y=w}s=l.neg(),o=h;var _=n.sqr().add(a.sqr());return s.sqr().add(o.sqr()).cmp(_)>=0&&(s=t,o=r),n.negative&&(n=n.neg(),a=a.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:n,b:a},{a:s,b:o}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),o=a.mul(n.a),u=i.mul(r.b),l=a.mul(n.b);return{k1:e.sub(s).sub(o),k2:u.add(l).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var a=n.fromRed().isOdd();return(t&&!a||!t&&a)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a<e.length;a++){var s=this._endoSplit(t[a]),o=e[a],u=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*a]=o,n[2*a+1]=u,i[2*a]=s.k1,i[2*a+1]=s.k2}for(var l=this._wnafMulAdd(1,n,i,2*a,r),h=0;h<2*a;h++)n[h]=null,i[h]=null;return l},a(l,s.BasePoint),u.prototype.point=function(e,t,r){return new l(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return l.fromJSON(this,e,t)},l.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 r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.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}},l.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]},l.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var a=t[2];return n.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[n].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[n].concat(a.naf.points.map(i))}},n},l.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)+">"},l.prototype.isInfinity=function(){return this.inf},l.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(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},l.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(e){return e=new i(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)},l.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},l.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},l.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},l.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},l.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(h,s.BasePoint),u.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),o=n.redSub(i),u=a.redSub(s);if(0===o.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),h=l.redMul(o),c=n.redMul(l),d=u.redSqr().redIAdd(h).redISub(c).redISub(c),f=u.redMul(c.redISub(d)).redISub(a.redMul(h)),p=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(d,f,p)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),s=r.redSub(n),o=i.redSub(a);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),h=r.redMul(u),c=o.redSqr().redIAdd(l).redISub(h).redISub(h),d=o.redMul(h.redISub(c)).redISub(i.redMul(l)),f=this.z.redMul(s);return this.curve.jpoint(c,d,f)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,a=this.x,s=this.y,o=this.z,u=o.redSqr().redSqr(),l=s.redAdd(s);for(t=0;t<e;t++){var h=a.redSqr(),c=l.redSqr(),d=c.redSqr(),f=h.redAdd(h).redIAdd(h).redIAdd(n.redMul(u)),p=a.redMul(c),y=f.redSqr().redISub(p.redAdd(p)),m=p.redISub(y),b=f.redMul(m);b=b.redIAdd(b).redISub(d);var g=l.redMul(o);t+1<e&&(u=u.redMul(d)),a=y,o=g,l=b}return this.curve.jpoint(a,l.redMul(i),o)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(a);s=s.redIAdd(s);var o=n.redAdd(n).redIAdd(n),u=o.redSqr().redISub(s).redISub(s),l=a.redIAdd(a);l=(l=l.redIAdd(l)).redIAdd(l),e=u,t=o.redMul(s.redISub(u)).redISub(l),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),c=this.y.redSqr(),d=c.redSqr(),f=this.x.redAdd(c).redSqr().redISub(h).redISub(d);f=f.redIAdd(f);var p=h.redAdd(h).redIAdd(h),y=p.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=y.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},h.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(a);s=s.redIAdd(s);var o=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=o.redSqr().redISub(s).redISub(s);e=u;var l=a.redIAdd(a);l=(l=l.redIAdd(l)).redIAdd(l),t=o.redMul(s.redISub(u)).redISub(l),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),c=this.y.redSqr(),d=this.x.redMul(c),f=this.x.redSub(h).redMul(this.x.redAdd(h));f=f.redAdd(f).redIAdd(f);var p=d.redIAdd(d),y=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(h);var m=c.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=f.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},h.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),a=t.redSqr(),s=r.redSqr(),o=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i)),u=t.redAdd(t),l=(u=u.redIAdd(u)).redMul(s),h=o.redSqr().redISub(l.redAdd(l)),c=l.redISub(h),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=o.redMul(c).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(h,f,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),a=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(a)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=i.redIAdd(s).redSqr().redISub(a).redISub(o).redISub(u),h=t.redMul(l);h=(h=h.redIAdd(h)).redIAdd(h);var c=this.x.redMul(o).redISub(h);c=(c=c.redIAdd(c)).redIAdd(c);var d=this.y.redMul(l.redMul(u.redISub(l)).redISub(s.redMul(o)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=this.z.redAdd(s).redSqr().redISub(r).redISub(o);return this.curve.jpoint(c,d,f)},h.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},h.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},h.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.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)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},5427:(e,t,r)=>{var n,i=t,a=r(3715),s=r(8254),o=r(953).assert;function u(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function l(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,l("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:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("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:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("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:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("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:a.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"]}),l("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:a.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"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),l("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:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(1037)}catch(e){n=void 0}l("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:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},7954:(e,t,r)=>{var n=r(3785),i=r(2156),a=r(953),s=r(5427),o=r(9931),u=a.assert,l=r(1251),h=r(611);function c(e){if(!(this instanceof c))return new c(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=c,c.prototype.keyPair=function(e){return new l(this,e)},c.prototype.keyFromPrivate=function(e,t){return l.fromPrivate(this,e,t)},c.prototype.keyFromPublic=function(e,t){return l.fromPublic(this,e,t)},c.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),a=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},c.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},c.prototype.sign=function(e,t,r,a){"object"==typeof r&&(a=r,r=null),a||(a={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),o=t.getPrivate().toArray("be",s),u=e.toArray("be",s),l=new i({hash:this.hash,entropy:o,nonce:u,pers:a.pers,persEnc:a.persEnc||"utf8"}),c=this.n.sub(new n(1)),d=0;;d++){var f=a.k?a.k(d):new n(l.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var p=this.g.mul(f);if(!p.isInfinity()){var y=p.getX(),m=y.umod(this.n);if(0!==m.cmpn(0)){var b=f.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==y.cmp(m)?2:0);return a.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),g^=1),new h({r:m,s:b,recoveryParam:g})}}}}}},c.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var a=(t=new h(t,"hex")).r,s=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o,u=s.invm(this.n),l=u.mul(e).umod(this.n),c=u.mul(a).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(l,r.getPublic(),c)).isInfinity()&&o.eqXToP(a):!(o=this.g.mulAdd(l,r.getPublic(),c)).isInfinity()&&0===o.getX().umod(this.n).cmp(a)},c.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new h(t,i);var a=this.n,s=new n(e),o=t.r,l=t.s,c=1&r,d=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");o=d?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var f=t.r.invm(a),p=a.sub(s).mul(f).umod(a),y=l.mul(f).umod(a);return this.g.mulAdd(p,o,y)},c.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new h(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},1251:(e,t,r)=>{var n=r(3785),i=r(953).assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=a,a.fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.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"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},a.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},611:(e,t,r)=>{var n=r(3785),i=r(953),a=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(a(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function o(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,a=0,s=t.place;a<n;a++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function l(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function h(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new o;if(48!==e[r.place++])return!1;var a=u(e,r);if(!1===a)return!1;if(a+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=u(e,r);if(!1===s)return!1;var l=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var h=u(e,r);if(!1===h)return!1;if(e.length!==h+r.place)return!1;var c=e.slice(r.place,h+r.place);if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new n(l),this.s=new n(c),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=l(t),r=l(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];h(n,t.length),(n=n.concat(t)).push(2),h(n,r.length);var a=n.concat(r),s=[48];return h(s,a.length),s=s.concat(a),i.encode(s,e)}},5980:(e,t,r)=>{var n=r(3715),i=r(5427),a=r(953),s=a.assert,o=a.parseBytes,u=r(9087),l=r(3622);function h(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof h))return new h(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=h,h.prototype.sign=function(e,t){e=o(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),a=this.encodePoint(i),s=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:a})},h.prototype.verify=function(e,t,r){e=o(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(a)},h.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return a.intFromLE(e.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},h.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},h.prototype.makeSignature=function(e){return e instanceof l?e:new l(this,e)},h.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},h.prototype.decodePoint=function(e){var t=(e=a.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=a.intFromLE(r);return this.curve.pointFromY(i,n)},h.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(e){return a.intFromLE(e)},h.prototype.isPoint=function(e){return e instanceof this.pointClass}},9087:(e,t,r)=>{var n=r(953),i=n.assert,a=n.parseBytes,s=n.cachedProperty;function o(e,t){this.eddsa=e,this._secret=a(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=a(t.pub)}o.fromPublic=function(e,t){return t instanceof o?t:new o(e,{pub:t})},o.fromSecret=function(e,t){return t instanceof o?t:new o(e,{secret:t})},o.prototype.secret=function(){return this._secret},s(o,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(o,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(o,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(o,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(o,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(o,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),o.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},o.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},o.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},o.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=o},3622:(e,t,r)=>{var n=r(3785),i=r(953),a=i.assert,s=i.cachedProperty,o=i.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=o(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),a(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},1037:e=>{e.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"]]}}},953:(e,t,r)=>{var n=t,i=r(3785),a=r(9746),s=r(4504);n.assert=a,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,a=e.clone(),s=0;s<n.length;s++){var o,u=a.andln(i-1);a.isOdd()?(o=u>(i>>1)-1?(i>>1)-u:u,a.isubn(o)):o=0,n[s]=o,a.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,a=0;e.cmpn(-i)>0||t.cmpn(-a)>0;){var s,o,u=e.andln(3)+i&3,l=t.andln(3)+a&3;3===u&&(u=-1),3===l&&(l=-1),s=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==l?u:-u,r[0].push(s),o=0==(1&l)?0:3!=(n=t.andln(7)+a&7)&&5!==n||2!==u?l:-l,r[1].push(o),2*i===s+1&&(i=1-i),2*a===o+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},3785:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(5568).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function l(e,t,r,n){for(var i=0,a=Math.min(e.length,r),s=t;s<a;s++){var o=e.charCodeAt(s)-48;i*=n,i+=o>=49?o-49+10:o>=17?o-17+10:o}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,s,o=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,s=a%n,o=Math.min(a,a-s)+r,u=0,h=r;h<o;h+=n)u=l(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=l(e,h,e.length,t),h=0;h<s;h++)c*=t;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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"],c=[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],d=[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];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],s=i*a,o=67108863&s,u=s/67108864|0;r.words[0]=o;for(var l=1;l<n;l++){for(var h=u>>>26,c=67108863&u,d=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=d;f++){var p=l-f|0;h+=(s=(i=0|e.words[p])*(a=0|t.words[f])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,u=0|h}return 0!==u?r.words[l]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,s=0;s<this.length;s++){var o=this.words[s],u=(16777215&(o<<i|a)).toString(16);r=0!=(a=o>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=c[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?y+r:h[l-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var s,o,u="le"===t,l=new e(a),h=this.clone();if(u){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),l[o]=s;for(;o<a;o++)l[o]=0}else{for(o=0;o<a-i;o++)l[o]=0;for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),l[a-o-1]=s}return l},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,s=0;s<n.length;s++)a=(t=(0|r.words[s])-(0|n.words[s])+a)>>26,this.words[s]=67108863&t;for(;0!==a&&s<r.length;s++)a=(t=(0|r.words[s])+a)>>26,this.words[s]=67108863&t;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,a,s=e.words,o=t.words,u=r.words,l=0,h=0|s[0],c=8191&h,d=h>>>13,f=0|s[1],p=8191&f,y=f>>>13,m=0|s[2],b=8191&m,g=m>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],T=8191&M,E=M>>>13,A=0|s[5],x=8191&A,k=A>>>13,S=0|s[6],I=8191&S,C=S>>>13,O=0|s[7],R=8191&O,N=O>>>13,P=0|s[8],B=8191&P,D=P>>>13,L=0|s[9],F=8191&L,U=L>>>13,j=0|o[0],q=8191&j,z=j>>>13,G=0|o[1],K=8191&G,H=G>>>13,$=0|o[2],V=8191&$,W=$>>>13,Z=0|o[3],J=8191&Z,Y=Z>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,ie=0|o[6],ae=8191&ie,se=ie>>>13,oe=0|o[7],ue=8191&oe,le=oe>>>13,he=0|o[8],ce=8191&he,de=he>>>13,fe=0|o[9],pe=8191&fe,ye=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(l+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;l=((a=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(y,q)|0,a=Math.imul(y,z);var be=(l+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(d,K)|0))<<13)|0;l=((a=a+Math.imul(d,H)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(g,q)|0,a=Math.imul(g,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,H)|0;var ge=(l+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(d,V)|0))<<13)|0;l=((a=a+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,H)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,V)|0,a=a+Math.imul(y,W)|0;var ve=(l+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;l=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(E,q)|0,a=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,H)|0,n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Y)|0;var we=(l+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,a=Math.imul(k,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,H)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,W)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,ee)|0;var _e=(l+(n=n+Math.imul(c,re)|0)|0)+((8191&(i=(i=i+Math.imul(c,ne)|0)+Math.imul(d,re)|0))<<13)|0;l=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,a=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,H)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(E,V)|0,a=a+Math.imul(E,W)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0;var Me=(l+(n=n+Math.imul(c,ae)|0)|0)+((8191&(i=(i=i+Math.imul(c,se)|0)+Math.imul(d,ae)|0))<<13)|0;l=((a=a+Math.imul(d,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,z))+Math.imul(N,q)|0,a=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,H)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,V)|0,a=a+Math.imul(k,W)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,se)|0;var Te=(l+(n=n+Math.imul(c,ue)|0)|0)+((8191&(i=(i=i+Math.imul(c,le)|0)+Math.imul(d,ue)|0))<<13)|0;l=((a=a+Math.imul(d,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,H)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(C,V)|0,a=a+Math.imul(C,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(y,ue)|0,a=a+Math.imul(y,le)|0;var Ee=(l+(n=n+Math.imul(c,ce)|0)|0)+((8191&(i=(i=i+Math.imul(c,de)|0)+Math.imul(d,ce)|0))<<13)|0;l=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,z))+Math.imul(U,q)|0,a=Math.imul(U,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,H)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,V)|0,a=a+Math.imul(N,W)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Y)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,le)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,le)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,ce)|0,a=a+Math.imul(y,de)|0;var Ae=(l+(n=n+Math.imul(c,pe)|0)|0)+((8191&(i=(i=i+Math.imul(c,ye)|0)+Math.imul(d,pe)|0))<<13)|0;l=((a=a+Math.imul(d,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,K),i=(i=Math.imul(F,H))+Math.imul(U,K)|0,a=Math.imul(U,H),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,W)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Y)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,le)|0,n=n+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,de)|0;var xe=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;l=((a=a+Math.imul(y,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,V),i=(i=Math.imul(F,W))+Math.imul(U,V)|0,a=Math.imul(U,W),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Q)|0,a=a+Math.imul(N,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,le)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,ce)|0,a=a+Math.imul(_,de)|0;var ke=(l+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ye)|0)+Math.imul(g,pe)|0))<<13)|0;l=((a=a+Math.imul(g,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,J),i=(i=Math.imul(F,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,a=a+Math.imul(N,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,le)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(E,ce)|0,a=a+Math.imul(E,de)|0;var Se=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;l=((a=a+Math.imul(_,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(U,Q)|0,a=Math.imul(U,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(C,ue)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(k,ce)|0,a=a+Math.imul(k,de)|0;var Ie=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ye)|0)+Math.imul(E,pe)|0))<<13)|0;l=((a=a+Math.imul(E,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(U,re)|0,a=Math.imul(U,ne),n=n+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,se)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,le)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,de)|0;var Ce=(l+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(k,pe)|0))<<13)|0;l=((a=a+Math.imul(k,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(F,ae),i=(i=Math.imul(F,se))+Math.imul(U,ae)|0,a=Math.imul(U,se),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,le)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,ce)|0,a=a+Math.imul(N,de)|0;var Oe=(l+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(C,pe)|0))<<13)|0;l=((a=a+Math.imul(C,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,le))+Math.imul(U,ue)|0,a=Math.imul(U,le),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,de)|0;var Re=(l+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(N,pe)|0))<<13)|0;l=((a=a+Math.imul(N,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(F,ce),i=(i=Math.imul(F,de))+Math.imul(U,ce)|0,a=Math.imul(U,de);var Ne=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,ye)|0)+Math.imul(D,pe)|0))<<13)|0;l=((a=a+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Pe=(l+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,ye))+Math.imul(U,pe)|0))<<13)|0;return l=((a=Math.imul(U,ye))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=me,u[1]=be,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Te,u[8]=Ee,u[9]=Ae,u[10]=xe,u[11]=ke,u[12]=Se,u[13]=Ie,u[14]=Ce,u[15]=Oe,u[16]=Re,u[17]=Ne,u[18]=Pe,0!==l&&(u[19]=l,r.length++),r};function y(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=f),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var s=i;i=0;for(var o=67108863&n,u=Math.min(a,t.length-1),l=Math.max(0,a-e.length+1);l<=u;l++){var h=a-l,c=(0|e.words[h])*(0|t.words[l]),d=67108863&c;o=67108863&(d=d+o|0),i+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[a]=o,n=s,s=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,a){for(var s=0;s<a;s++)n[s]=t[e[s]],i[s]=r[e[s]]},m.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),h=0;h<i;h+=o)for(var c=u,d=l,f=0;f<s;f++){var p=r[h+f],y=n[h+f],m=r[h+f+s],b=n[h+f+s],g=c*m-d*b;b=c*b+d*m,m=g,r[h+f]=p+m,n[h+f]=y+b,r[h+f+s]=p-m,n[h+f+s]=y-b,f!==o&&(g=u*c-l*d,d=u*d+l*c,c=g)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var a=0,s=0;s<t;s++)a+=0|e[s],r[2*s]=8191&a,a>>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===a),n(0==(-8192&a))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),s=new Array(n),o=new Array(n),u=new Array(n),l=new Array(n),h=new Array(n),c=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,l,n),this.transform(s,a,o,u,n,i),this.transform(l,a,h,c,n,i);for(var f=0;f<n;f++){var p=o[f]*h[f]-u[f]*c[f];u[f]=o[f]*c[f]+u[f]*h[f],o[f]=p}return this.conjugate(o,u,n),this.transform(o,u,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),y(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&a,u=(0|this.words[t])-o<<r;this.words[t]=u|s,s=o>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<<a,u=r;if(i-=s,i=Math.max(0,i),u){for(var l=0;l<s;l++)u.words[l]=this.words[l];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var h=0;for(l=this.length-1;l>=0&&(0!==h||l>=i);l--){var c=0|this.words[l];this.words[l]=h<<26-a|c>>>a,h=c&o}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i,a,s=e.length+r;this._expand(s);var o=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+o;var u=(0|e.words[i])*t;o=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)o=(a=(0|this.words[i+r])+o)>>26,this.words[i+r]=67108863&a;if(0===o)return this.strip();for(n(-1===o),o=0,i=0;i<this.length;i++)o=(a=-(0|this.words[i])+o)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var o,u=n.length-i.length;if("mod"!==t){(o=new a(null)).length=u+1,o.words=new Array(o.length);for(var l=0;l<o.length;l++)o.words[l]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,o&&(o.words[u]=1));for(var c=u-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);o&&(o.words[c]=d)}return o&&o.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,o},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),s=new a(0),o=new a(0),u=new a(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var h=r.clone(),c=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(h),u.isub(c)),o.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o),s.isub(u)):(r.isub(t),o.isub(i),u.isub(s))}return{a:o,b:u,gcd:r.iushln(l)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new a(1),o=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(i=0===t.cmpn(1)?s:o).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,s=r;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new T(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}g.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|a>>>22,a=s}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,g),i(_,g),i(M,g),M.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return b[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var o=new a(1).toRed(this),u=o.redNeg(),l=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new a(2*h*h).toRed(this);0!==this.pow(h,l).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),d=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(o);){for(var y=f,m=0;0!==y.cmp(o);m++)y=y.redSqr();n(m<p);var b=this.pow(c,new a(1).iushln(p-m-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=m}return d},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,o=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],h=u-1;h>=0;h--){var c=l>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++o||0===n&&0===h)&&(i=this.mul(i,r[s]),o=0,s=0)):o=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new E(e)},i(E,T),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},2114:e=>{function t(e,t){for(const r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}e.exports=function(e,r,n){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"==typeof r&&(n=r,r=""),r&&(n.code=r);try{return t(e,n)}catch(r){n.message=e.message,n.stack=e.stack;const i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(e)),t(new i,n)}}},8091:e=>{function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var a=Object.keys(Object(i)),s=0,o=a.length;s<o;s++){var u=a[s],l=Object.getOwnPropertyDescriptor(i,u);void 0!==l&&l.enumerable&&(r[u]=i[u])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},7187:e=>{var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,a,s,l;if(o(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"==typeof s?s=a[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=s.length,l=h,console&&console.warn&&console.warn(l)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){n.once&&e.removeEventListener(t,i),r(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return u(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var u=a[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var l=u.length,h=p(u,l);for(r=0;r<l;++r)n(h[r],this,t)}return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)},a.prototype.once=function(e,t){return o(t),this.on(e,c(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,c(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,i,a,s;if(o(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){s=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},3048:(e,t,r)=>{var n=r(9509).Buffer,i=r(2318);e.exports=function(e,t,r,a){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,o=n.alloc(s),u=n.alloc(a||0),l=n.alloc(0);s>0||a>0;){var h=new i;h.update(l),h.update(e),t&&h.update(t),l=h.digest();var c=0;if(s>0){var d=o.length-s;c=Math.min(s,l.length),l.copy(o,d,0,c),s-=c}if(c<l.length&&a>0){var f=u.length-a,p=Math.min(a,l.length-c);l.copy(u,f,c,c+p),a-=p}}return l.fill(0),{key:o,iv:u}}},4029:(e,t,r)=>{var n=r(5320),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=r),"[object Array]"===i.call(e)?function(e,t,r){for(var n=0,i=e.length;n<i;n++)a.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,s):"string"==typeof e?function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,s):function(e,t,r){for(var n in e)a.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,s)}},7648:e=>{var t=Array.prototype.slice,r=Object.prototype.toString;e.exports=function(e){var n=this;if("function"!=typeof n||"[object Function]"!==r.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var i,a=t.call(arguments,1),s=Math.max(0,n.length-a.length),o=[],u=0;u<s;u++)o.push("$"+u);if(i=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var r=n.apply(this,a.concat(t.call(arguments)));return Object(r)===r?r:this}return n.apply(e,a.concat(t.call(arguments)))})),n.prototype){var l=function(){};l.prototype=n.prototype,i.prototype=new l,l.prototype=null}return i}},8612:(e,t,r)=>{var n=r(7648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{var n,i=SyntaxError,a=Function,s=TypeError,o=function(e){try{return a('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var l=function(){throw new s},h=u?function(){try{return l}catch(e){try{return u(arguments,"callee").get}catch(e){return l}}}():l,c=r(1405)(),d=Object.getPrototypeOf||function(e){return e.__proto__},f={},p="undefined"==typeof Uint8Array?n:d(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":c?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&c?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&c?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c?d(""[Symbol.iterator]()):n,"%Symbol%":c?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":h,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};try{null.error}catch(e){var m=d(d(e));y["%Error.prototype%"]=m}var b=function e(t){var r;if("%AsyncFunction%"===t)r=o("async function () {}");else if("%GeneratorFunction%"===t)r=o("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=o("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=d(i.prototype))}return y[t]=r,r},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=r(8612),w=r(7642),_=v.call(Function.call,Array.prototype.concat),M=v.call(Function.apply,Array.prototype.splice),T=v.call(Function.call,String.prototype.replace),E=v.call(Function.call,String.prototype.slice),A=v.call(Function.call,RegExp.prototype.exec),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,S=function(e,t){var r,n=e;if(w(g,n)&&(n="%"+(r=g[n])[0]+"%"),w(y,n)){var a=y[n];if(a===f&&(a=b(n)),void 0===a&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:a}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===A(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=E(e,0,1),r=E(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return T(e,x,(function(e,t,r,i){n[n.length]=r?T(i,k,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",a=S("%"+n+"%",t),o=a.name,l=a.value,h=!1,c=a.alias;c&&(n=c[0],M(r,_([0,1],c)));for(var d=1,f=!0;d<r.length;d+=1){var p=r[d],m=E(p,0,1),b=E(p,-1);if(('"'===m||"'"===m||"`"===m||'"'===b||"'"===b||"`"===b)&&m!==b)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&f||(h=!0),w(y,o="%"+(n+="."+p)+"%"))l=y[o];else if(null!=l){if(!(p in l)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(u&&d+1>=r.length){var g=u(l,p);l=(f=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:l[p]}else f=w(l,p),l=l[p];f&&!h&&(y[o]=l)}}return l}},7296:(e,t,r)=>{var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},1044:(e,t,r)=>{var n=r(210)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},1405:(e,t,r)=>{var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419:e=>{e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:(e,t,r)=>{var n=r(5419);e.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(e,t,r)=>{var n=r(8612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},3349:(e,t,r)=>{var n=r(9509).Buffer,i=r(8473).Transform;function a(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(5717)(a,i),a.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},a.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},a.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var a=this._blockOffset;a<this._blockSize;)r[a++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var s=0,o=8*e.length;o>0;++s)this._length[s]+=o,(o=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*o);return this},a.prototype._update=function(){throw new Error("_update is not implemented")},a.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},a.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=a},3715:(e,t,r)=>{var n=t;n.utils=r(6436),n.common=r(5772),n.sha=r(9041),n.ripemd=r(2949),n.hmac=r(2344),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},5772:(e,t,r)=>{var n=r(6436),i=r(9746);function a(){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}t.BlockHash=a,a.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},a.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},a.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a<this.padLength;a++)n[i++]=0;return n}},2344:(e,t,r)=>{var n=r(6436),i=r(9746);function a(e,t,r){if(!(this instanceof a))return new a(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=a,a.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(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)},a.prototype.update=function(e,t){return this.inner.update(e,t),this},a.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},2949:(e,t,r)=>{var n=r(6436),i=r(5772),a=n.rotl32,s=n.sum32,o=n.sum32_3,u=n.sum32_4,l=i.BlockHash;function h(){if(!(this instanceof h))return new h;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function f(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(h,l),t.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],l=this.h[3],h=this.h[4],g=r,v=n,w=i,_=l,M=h,T=0;T<80;T++){var E=s(a(u(r,c(T,n,i,l),e[p[T]+t],d(T)),m[T]),h);r=h,h=l,l=a(i,10),i=n,n=E,E=s(a(u(g,c(79-T,v,w,_),e[y[T]+t],f(T)),b[T]),M),g=M,M=_,_=a(w,10),w=v,v=E}E=o(this.h[1],i,_),this.h[1]=o(this.h[2],l,M),this.h[2]=o(this.h[3],h,g),this.h[3]=o(this.h[4],r,v),this.h[4]=o(this.h[0],n,w),this.h[0]=E},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[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],y=[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],m=[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],b=[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]},9041:(e,t,r)=>{t.sha1=r(4761),t.sha224=r(799),t.sha256=r(9344),t.sha384=r(772),t.sha512=r(5900)},4761:(e,t,r)=>{var n=r(6436),i=r(5772),a=r(7038),s=n.rotl32,o=n.sum32,u=n.sum32_5,l=a.ft_1,h=i.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,h),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],a=this.h[1],h=this.h[2],d=this.h[3],f=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=u(s(i,5),l(p,a,h,d),f,r[n],c[p]);f=d,d=h,h=s(a,30),a=i,i=y}this.h[0]=o(this.h[0],i),this.h[1]=o(this.h[1],a),this.h[2]=o(this.h[2],h),this.h[3]=o(this.h[3],d),this.h[4]=o(this.h[4],f)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},799:(e,t,r)=>{var n=r(6436),i=r(9344);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(a,i),e.exports=a,a.blockSize=512,a.outSize=224,a.hmacStrength=192,a.padLength=64,a.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},9344:(e,t,r)=>{var n=r(6436),i=r(5772),a=r(7038),s=r(9746),o=n.sum32,u=n.sum32_4,l=n.sum32_5,h=a.ch32,c=a.maj32,d=a.s0_256,f=a.s1_256,p=a.g0_256,y=a.g1_256,m=i.BlockHash,b=[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 g(){if(!(this instanceof g))return new g;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}n.inherits(g,m),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],a=this.h[1],m=this.h[2],b=this.h[3],g=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var M=l(_,f(g),h(g,v,w),this.k[n],r[n]),T=o(d(i),c(i,a,m));_=w,w=v,v=g,g=o(b,M),b=m,m=a,a=i,i=o(M,T)}this.h[0]=o(this.h[0],i),this.h[1]=o(this.h[1],a),this.h[2]=o(this.h[2],m),this.h[3]=o(this.h[3],b),this.h[4]=o(this.h[4],g),this.h[5]=o(this.h[5],v),this.h[6]=o(this.h[6],w),this.h[7]=o(this.h[7],_)},g.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},772:(e,t,r)=>{var n=r(6436),i=r(5900);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(a,i),e.exports=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},5900:(e,t,r)=>{var n=r(6436),i=r(5772),a=r(9746),s=n.rotr64_hi,o=n.rotr64_lo,u=n.shr64_hi,l=n.shr64_lo,h=n.sum64,c=n.sum64_hi,d=n.sum64_lo,f=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,m=n.sum64_5_lo,b=i.BlockHash,g=[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 v(){if(!(this instanceof v))return new v;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(e,t,r,n,i){var a=e&r^~e&i;return a<0&&(a+=4294967296),a}function _(e,t,r,n,i,a){var s=t&n^~t&a;return s<0&&(s+=4294967296),s}function M(e,t,r,n,i){var a=e&r^e&i^r&i;return a<0&&(a+=4294967296),a}function T(e,t,r,n,i,a){var s=t&n^t&a^n&a;return s<0&&(s+=4294967296),s}function E(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=o(e,t,14)^o(e,t,18)^o(t,e,9);return r<0&&(r+=4294967296),r}function k(e,t){var r=s(e,t,1)^s(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=o(e,t,1)^o(e,t,8)^l(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=o(e,t,19)^o(t,e,29)^l(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,b),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=(m=r[n-4],b=r[n-3],g=void 0,(g=s(m,b,19)^s(b,m,29)^u(m,b,6))<0&&(g+=4294967296),g),a=I(r[n-4],r[n-3]),o=r[n-14],l=r[n-13],h=k(r[n-30],r[n-29]),c=S(r[n-30],r[n-29]),d=r[n-32],y=r[n-31];r[n]=f(i,a,o,l,h,c,d,y),r[n+1]=p(i,a,o,l,h,c,d,y)}var m,b,g},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r,n,i,o=this.W,u=this.h[0],l=this.h[1],f=this.h[2],p=this.h[3],b=this.h[4],g=this.h[5],v=this.h[6],k=this.h[7],S=this.h[8],I=this.h[9],C=this.h[10],O=this.h[11],R=this.h[12],N=this.h[13],P=this.h[14],B=this.h[15];a(this.k.length===o.length);for(var D=0;D<o.length;D+=2){var L=P,F=B,U=(i=void 0,(i=s(r=S,n=I,14)^s(r,n,18)^s(n,r,9))<0&&(i+=4294967296),i),j=x(S,I),q=w(S,0,C,0,R),z=_(0,I,0,O,0,N),G=this.k[D],K=this.k[D+1],H=o[D],$=o[D+1],V=y(L,F,U,j,q,z,G,K,H,$),W=m(L,F,U,j,q,z,G,K,H,$);L=E(u,l),F=A(u,l),U=M(u,0,f,0,b),j=T(0,l,0,p,0,g);var Z=c(L,F,U,j),J=d(L,F,U,j);P=R,B=N,R=C,N=O,C=S,O=I,S=c(v,k,V,W),I=d(k,k,V,W),v=b,k=g,b=f,g=p,f=u,p=l,u=c(V,W,Z,J),l=d(V,W,Z,J)}h(this.h,0,u,l),h(this.h,2,f,p),h(this.h,4,b,g),h(this.h,6,v,k),h(this.h,8,S,I),h(this.h,10,C,O),h(this.h,12,R,N),h(this.h,14,P,B)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},7038:(e,t,r)=>{var n=r(6436).rotr32;function i(e,t,r){return e&t^~e&r}function a(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?a(t,r,n):void 0},t.ch32=i,t.maj32=a,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},6436:(e,t,r)=>{var n=r(9746),i=r(5717);function a(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):a(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=o(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=s(i)),r+=u(i.toString(16))}return r},t.zero2=o,t.zero8=u,t.join32=function(e,t,r,i){var a=r-t;n(a%4==0);for(var s=new Array(a/4),o=0,u=t;o<s.length;o++,u+=4){var l;l="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],s[o]=l>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var a=e[n];"big"===t?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,s=(a<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=a},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,a,s,o){var u=0,l=t;return u+=(l=l+n>>>0)<t?1:0,u+=(l=l+a>>>0)<a?1:0,e+r+i+s+(u+=(l=l+o>>>0)<o?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,a,s,o){return t+n+a+o>>>0},t.sum64_5_hi=function(e,t,r,n,i,a,s,o,u,l){var h=0,c=t;return h+=(c=c+n>>>0)<t?1:0,h+=(c=c+a>>>0)<a?1:0,h+=(c=c+o>>>0)<o?1:0,e+r+i+s+u+(h+=(c=c+l>>>0)<l?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,a,s,o,u,l){return t+n+a+o+l>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},2156:(e,t,r)=>{var n=r(3715),i=r(4504),a=r(9746);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.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())},s.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),a(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var s=a.slice(0,e);return this._update(r),this._reseed++,i.encode(s,t)}},645:(e,t)=>{t.read=function(e,t,r,n,i){var a,s,o=8*i-n-1,u=(1<<o)-1,l=u>>1,h=-7,c=r?i-1:0,d=r?-1:1,f=e[t+c];for(c+=d,a=f&(1<<-h)-1,f>>=-h,h+=o;h>0;a=256*a+e[t+c],c+=d,h-=8);for(s=a&(1<<-h)-1,a>>=-h,h+=n;h>0;s=256*s+e[t+c],c+=d,h-=8);if(0===a)a=1-l;else{if(a===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),a-=l}return(f?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var s,o,u,l=8*a-i-1,h=(1<<l)-1,c=h>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+c>=1?d/u:d*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=h?(o=0,s=h):s+c>=1?(o=(t*u-1)*Math.pow(2,i),s+=c):(o=t*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&o,f+=p,o/=256,i-=8);for(s=s<<i|o,l+=i;l>0;e[r+f]=255&s,f+=p,s/=256,l-=8);e[r+f-p]|=128*y}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},2584:(e,t,r)=>{var n=r(6410)(),i=r(1924)("Object.prototype.toString"),a=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!a(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},o=function(){return a(arguments)}();a.isLegacyArguments=s,e.exports=o?a:s},5320:e=>{var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(e){e!==r&&(i=null)}else i=null;var a=/^\s*class\b/,s=function(e){try{var t=n.call(e);return a.test(t)}catch(e){return!1}},o=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,h=!(0 in[,]),c=function(){return!1};if("object"==typeof document){var d=document.all;u.call(d)===u.call(document.all)&&(c=function(e){if((h||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(c(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&o(e)}:function(e){if(c(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(l)return o(e);if(s(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&o(e)}},8662:(e,t,r)=>{var n,i=Object.prototype.toString,a=Function.prototype.toString,s=/^\s*(?:function)?\*/,o=r(6410)(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(s.test(a.call(e)))return!0;if(!o)return"[object GeneratorFunction]"===i.call(e);if(!u)return!1;if(void 0===n){var t=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&u(t)}return u(e)===n}},8611:e=>{e.exports=function(e){return e!=e}},360:(e,t,r)=>{var n=r(5559),i=r(4289),a=r(8611),s=r(9415),o=r(3194),u=n(s(),Number);i(u,{getPolyfill:s,implementation:a,shim:o}),e.exports=u},9415:(e,t,r)=>{var n=r(8611);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},3194:(e,t,r)=>{var n=r(4289),i=r(9415);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},5692:(e,t,r)=>{var n=r(4029),i=r(3083),a=r(1924),s=a("Object.prototype.toString"),o=r(6410)(),u=r(7296),l="undefined"==typeof globalThis?r.g:globalThis,h=i(),c=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},d=a("String.prototype.slice"),f={},p=Object.getPrototypeOf;o&&u&&p&&n(h,(function(e){var t=new l[e];if(Symbol.toStringTag in t){var r=p(t),n=u(r,Symbol.toStringTag);if(!n){var i=p(r);n=u(i,Symbol.toStringTag)}f[e]=n.get}})),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!o||!(Symbol.toStringTag in e)){var t=d(s(e),8,-1);return c(h,t)>-1}return!!u&&function(e){var t=!1;return n(f,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},1094:(e,t,r)=>{var n,i=r(4155);!function(){var a="input is invalid type",s="object"==typeof window,o=s?window:{};o.JS_SHA3_NO_WINDOW&&(s=!1);var u=!s&&"object"==typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node?o=r.g:u&&(o=self);var l=!o.JS_SHA3_NO_COMMON_JS&&e.exports,h=r.amdO,c=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),f=[4,1024,262144,67108864],p=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],m=[224,256,384,512],b=[128,256],g=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!c||!o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var w=function(e,t,r){return function(n){return new B(e,t,e).update(n)[r]()}},_=function(e,t,r){return function(n,i){return new B(e,t,i).update(n)[r]()}},M=function(e,t,r){return function(t,n,i,a){return k["cshake"+e].update(t,n,i,a)[r]()}},T=function(e,t,r){return function(t,n,i,a){return k["kmac"+e].update(t,n,i,a)[r]()}},E=function(e,t,r,n){for(var i=0;i<g.length;++i){var a=g[i];e[a]=t(r,n,a)}return e},A=function(e,t){var r=w(e,t,"hex");return r.create=function(){return new B(e,t,e)},r.update=function(e){return r.create().update(e)},E(r,w,e,t)},x=[{name:"keccak",padding:[1,256,65536,16777216],bits:m,createMethod:A},{name:"sha3",padding:[6,1536,393216,100663296],bits:m,createMethod:A},{name:"shake",padding:[31,7936,2031616,520093696],bits:b,createMethod:function(e,t){var r=_(e,t,"hex");return r.create=function(r){return new B(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},E(r,_,e,t)}},{name:"cshake",padding:f,bits:b,createMethod:function(e,t){var r=v[e],n=M(e,0,"hex");return n.create=function(n,i,a){return i||a?new B(e,t,n).bytepad([i,a],r):k["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},E(n,M,e,t)}},{name:"kmac",padding:f,bits:b,createMethod:function(e,t){var r=v[e],n=T(e,0,"hex");return n.create=function(n,i,a){return new D(e,t,i).bytepad(["KMAC",a],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},E(n,T,e,t)}}],k={},S=[],I=0;I<x.length;++I)for(var C=x[I],O=C.bits,R=0;R<O.length;++R){var N=C.name+"_"+O[R];if(S.push(N),k[N]=C.createMethod(O[R],C.padding),"sha3"!==C.name){var P=C.name+O[R];S.push(P),k[P]=k[N]}}function B(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function D(e,t,r){B.call(this,e,t,r)}B.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(a);if(null===e)throw new Error(a);if(c&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||c&&ArrayBuffer.isView(e)))throw new Error(a);t=!0}for(var n,i,s=this.blocks,o=this.byteCount,u=e.length,l=this.blockCount,h=0,d=this.s;h<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<l+1;++n)s[n]=0;if(t)for(n=this.start;h<u&&n<o;++h)s[n>>2]|=e[h]<<p[3&n++];else for(n=this.start;h<u&&n<o;++h)(i=e.charCodeAt(h))<128?s[n>>2]|=i<<p[3&n++]:i<2048?(s[n>>2]|=(192|i>>6)<<p[3&n++],s[n>>2]|=(128|63&i)<<p[3&n++]):i<55296||i>=57344?(s[n>>2]|=(224|i>>12)<<p[3&n++],s[n>>2]|=(128|i>>6&63)<<p[3&n++],s[n>>2]|=(128|63&i)<<p[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++h)),s[n>>2]|=(240|i>>18)<<p[3&n++],s[n>>2]|=(128|i>>12&63)<<p[3&n++],s[n>>2]|=(128|i>>6&63)<<p[3&n++],s[n>>2]|=(128|63&i)<<p[3&n++]);if(this.lastByteIndex=n,n>=o){for(this.start=n-o,this.block=s[l],n=0;n<l;++n)d[n]^=s[n];L(d),this.reset=!0}else this.start=n}return this},B.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},B.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(a);if(null===e)throw new Error(a);if(c&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||c&&ArrayBuffer.isView(e)))throw new Error(a);t=!0}var n=0,i=e.length;if(t)n=i;else for(var s=0;s<e.length;++s){var o=e.charCodeAt(s);o<128?n+=1:o<2048?n+=2:o<55296||o>=57344?n+=3:(o=65536+((1023&o)<<10|1023&e.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(e),n},B.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,a=[];return a.length=i,this.update(a),this},B.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];L(n)}},B.prototype.toString=B.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,s=0,o="";s<n;){for(a=0;a<t&&s<n;++a,++s)e=r[a],o+=d[e>>4&15]+d[15&e]+d[e>>12&15]+d[e>>8&15]+d[e>>20&15]+d[e>>16&15]+d[e>>28&15]+d[e>>24&15];s%t==0&&(L(r),a=0)}return i&&(e=r[a],o+=d[e>>4&15]+d[15&e],i>1&&(o+=d[e>>12&15]+d[e>>8&15]),i>2&&(o+=d[e>>20&15]+d[e>>16&15])),o},B.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,s=0,o=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(o);for(var u=new Uint32Array(e);s<n;){for(a=0;a<t&&s<n;++a,++s)u[s]=r[a];s%t==0&&L(r)}return i&&(u[a]=r[a],e=e.slice(0,o)),e},B.prototype.buffer=B.prototype.arrayBuffer,B.prototype.digest=B.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,a=this.extraBytes,s=0,o=0,u=[];o<i;){for(s=0;s<r&&o<i;++s,++o)e=o<<2,t=n[s],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;o%r==0&&L(n)}return a&&(e=o<<2,t=n[s],u[e]=255&t,a>1&&(u[e+1]=t>>8&255),a>2&&(u[e+2]=t>>16&255)),u},D.prototype=new B,D.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var L=function(e){var t,r,n,i,a,s,o,u,l,h,c,d,f,p,m,b,g,v,w,_,M,T,E,A,x,k,S,I,C,O,R,N,P,B,D,L,F,U,j,q,z,G,K,H,$,V,W,Z,J,Y,X,Q,ee,te,re,ne,ie,ae,se,oe,ue,le,he;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],c=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|o>>>31),r=(f=e[9]^e[19]^e[29]^e[39]^e[49])^(o<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|l>>>31),r=a^(l<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(h<<1|c>>>31),r=o^(c<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(d<<1|f>>>31),r=l^(f<<1|d>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|a>>>31),r=c^(a<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],m=e[1],V=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,I=e[20]<<3|e[21]>>>29,C=e[21]<<3|e[20]>>>29,oe=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,R=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,he=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,F=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,P=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,M=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,$=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,S=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,q=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,T=e[48]<<14|e[49]>>>18,E=e[49]<<14|e[48]>>>18,e[0]=p^~b&v,e[1]=m^~g&w,e[10]=A^~k&I,e[11]=x^~S&C,e[20]=B^~L&U,e[21]=D^~F&j,e[30]=H^~V&Z,e[31]=$^~W&J,e[40]=te^~ne&ae,e[41]=re^~ie&se,e[2]=b^~v&_,e[3]=g^~w&M,e[12]=k^~I&O,e[13]=S^~C&R,e[22]=L^~U&q,e[23]=F^~j&z,e[32]=V^~Z&Y,e[33]=W^~J&X,e[42]=ne^~ae&oe,e[43]=ie^~se&ue,e[4]=v^~_&T,e[5]=w^~M&E,e[14]=I^~O&N,e[15]=C^~R&P,e[24]=U^~q&G,e[25]=j^~z&K,e[34]=Z^~Y&Q,e[35]=J^~X&ee,e[44]=ae^~oe&le,e[45]=se^~ue&he,e[6]=_^~T&p,e[7]=M^~E&m,e[16]=O^~N&A,e[17]=R^~P&x,e[26]=q^~G&B,e[27]=z^~K&D,e[36]=Y^~Q&H,e[37]=X^~ee&$,e[46]=oe^~le&te,e[47]=ue^~he&re,e[8]=T^~p&b,e[9]=E^~m&g,e[18]=N^~A&k,e[19]=P^~x&S,e[28]=G^~B&L,e[29]=K^~D&F,e[38]=Q^~H&V,e[39]=ee^~$&W,e[48]=le^~te&ne,e[49]=he^~re&ie,e[0]^=y[n],e[1]^=y[n+1]};if(l)e.exports=k;else{for(I=0;I<S.length;++I)o[S[I]]=k[S[I]];h&&(void 0===(n=function(){return k}.call(t,r,t,e))||(e.exports=n))}}()},5733:(e,t,r)=>{var n=r(8764).Buffer,i=r(4155);e.exports=function e(t,r,n){function i(s,o){if(!r[s]){if(!t[s]){if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};t[s][0].call(l.exports,(function(e){return i(t[s][1][e]||e)}),l,l.exports,e,t,r,n)}return r[s].exports}for(var a=void 0,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,r){var n=e("./utils"),i=e("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,i,s,o,u,l,h=[],c=0,d=e.length,f=d,p="string"!==n.getTypeOf(e);c<e.length;)f=d-c,i=p?(t=e[c++],r=c<d?e[c++]:0,c<d?e[c++]:0):(t=e.charCodeAt(c++),r=c<d?e.charCodeAt(c++):0,c<d?e.charCodeAt(c++):0),s=t>>2,o=(3&t)<<4|r>>4,u=1<f?(15&r)<<2|i>>6:64,l=2<f?63&i:64,h.push(a.charAt(s)+a.charAt(o)+a.charAt(u)+a.charAt(l));return h.join("")},r.decode=function(e){var t,r,n,s,o,u,l=0,h=0,c="data:";if(e.substr(0,c.length)===c)throw new Error("Invalid base64 input, it looks like a data url.");var d,f=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===a.charAt(64)&&f--,e.charAt(e.length-2)===a.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=i.uint8array?new Uint8Array(0|f):new Array(0|f);l<e.length;)t=a.indexOf(e.charAt(l++))<<2|(s=a.indexOf(e.charAt(l++)))>>4,r=(15&s)<<4|(o=a.indexOf(e.charAt(l++)))>>2,n=(3&o)<<6|(u=a.indexOf(e.charAt(l++))),d[h++]=t,64!==o&&(d[h++]=r),64!==u&&(d[h++]=n);return d}},{"./support":30,"./utils":32}],2:[function(e,t,r){var n=e("./external"),i=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),s=e("./stream/DataLengthProbe");function o(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}o.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new a).pipe(new s("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new s("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){var n=e("./utils"),i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var a=i,s=0+r;e^=-1;for(var o=0;o<s;o++)e=e>>>8^a[255&(e^t[o])];return-1^e}(0|t,e,e.length):function(e,t,r,n){var a=i,s=0+r;e^=-1;for(var o=0;o<s;o++)e=e>>>8^a[255&(e^t.charCodeAt(o))];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){var n;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),a=e("./utils"),s=e("./stream/GenericWorker"),o=n?"uint8array":"array";function u(e,t){s.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",a.inherits(u,s),u.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(a.transformTo(o,e.data),!1)},u.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(e){return new u("Deflate",e)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){function n(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n}function i(e,t,r,i,s,h){var c,d,f=e.file,p=e.compression,y=h!==o.utf8encode,m=a.transformTo("string",h(f.name)),b=a.transformTo("string",o.utf8encode(f.name)),g=f.comment,v=a.transformTo("string",h(g)),w=a.transformTo("string",o.utf8encode(g)),_=b.length!==f.name.length,M=w.length!==g.length,T="",E="",A="",x=f.dir,k=f.date,S={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(S.crc32=e.crc32,S.compressedSize=e.compressedSize,S.uncompressedSize=e.uncompressedSize);var I=0;t&&(I|=8),y||!_&&!M||(I|=2048);var C=0,O=0;x&&(C|=16),"UNIX"===s?(O=798,C|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(f.unixPermissions,x)):(O=20,C|=function(e){return 63&(e||0)}(f.dosPermissions)),c=k.getUTCHours(),c<<=6,c|=k.getUTCMinutes(),c<<=5,c|=k.getUTCSeconds()/2,d=k.getUTCFullYear()-1980,d<<=4,d|=k.getUTCMonth()+1,d<<=5,d|=k.getUTCDate(),_&&(E=n(1,1)+n(u(m),4)+b,T+="up"+n(E.length,2)+E),M&&(A=n(1,1)+n(u(v),4)+w,T+="uc"+n(A.length,2)+A);var R="";return R+="\n\0",R+=n(I,2),R+=p.magic,R+=n(c,2),R+=n(d,2),R+=n(S.crc32,4),R+=n(S.compressedSize,4),R+=n(S.uncompressedSize,4),R+=n(m.length,2),R+=n(T.length,2),{fileRecord:l.LOCAL_FILE_HEADER+R+m+T,dirRecord:l.CENTRAL_FILE_HEADER+n(O,2)+R+n(v.length,2)+"\0\0\0\0"+n(C,4)+n(i,4)+m+T+v}}var a=e("../utils"),s=e("../stream/GenericWorker"),o=e("../utf8"),u=e("../crc32"),l=e("../signature");function h(e,t,r,n){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(h,s),h.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},h.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,i=function(e,t,r,i,s){var o=a.transformTo("string",s(i));return l.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(e,2)+n(e,2)+n(t,4)+n(r,4)+n(o.length,2)+o}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},h.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},h.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},h.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},h.prototype.error=function(e){var t=this._sources;if(!s.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},h.prototype.lock=function(){s.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=h},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){var n=e("../compressions"),i=e("./ZipFileWorker");r.generateWorker=function(e,t,r){var a=new i(t.streamFiles,r,t.platform,t.encodeFileName),s=0;try{e.forEach((function(e,r){s++;var i=function(e,t){var r=e||t,i=n[r];if(!i)throw new Error(r+" is not a valid compression method !");return i}(r.options.compression,t.compression),o=r.options.compressionOptions||t.compressionOptions||{},u=r.dir,l=r.date;r._compressWorker(i,o).withStreamInfo("file",{name:e,dir:u,date:l,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(a)})),a.entriesCount=s}catch(e){a.error(e)}return a}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.10.1",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){var n=e("./utils"),i=e("./external"),a=e("./utf8"),s=e("./zipEntries"),o=e("./stream/Crc32Probe"),u=e("./nodejsUtils");function l(e){return new i.Promise((function(t,r){var n=e.decompressed.getContentWorker().pipe(new o);n.on("error",(function(e){r(e)})).on("end",(function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}t.exports=function(e,t){var r=this;return t=n.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var r=new s(t);return r.load(e),r})).then((function(e){var r=[i.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var a=0;a<n.length;a++)r.push(l(n[a]));return i.Promise.all(r)})).then((function(e){for(var i=e.shift(),a=i.files,s=0;s<a.length;s++){var o=a[s],u=o.fileNameStr,l=n.resolve(o.fileNameStr);r.file(l,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:t.createFolders}),o.dir||(r.file(l).unsafeOriginalName=u)}return i.zipComment.length&&(r.comment=i.zipComment),r}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){var n=e("../utils"),i=e("../stream/GenericWorker");function a(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(a,i),a.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},a.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){var n=e("readable-stream").Readable;function i(e,t,r){n.call(this,t),this._helper=e;var i=this;e.on("data",(function(e,t){i.push(e)||i._helper.pause(),r&&r(t)})).on("error",(function(e){i.emit("error",e)})).on("end",(function(){i.push(null)}))}e("../utils").inherits(i,n),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,r){t.exports={isNode:void 0!==n,newBufferFrom:function(e,t){if(n.from&&n.from!==Uint8Array.from)return n.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new n(e,t)},allocBuffer:function(e){if(n.alloc)return n.alloc(e);var t=new n(e);return t.fill(0),t},isBuffer:function(e){return n.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,r){function n(e,t,r){var n,i=a.getTypeOf(t),o=a.extend(r||{},u);o.date=o.date||new Date,null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(e=y(e)),o.createFolders&&(n=p(e))&&m.call(this,n,!0);var c="string"===i&&!1===o.binary&&!1===o.base64;r&&void 0!==r.binary||(o.binary=!c),(t instanceof l&&0===t.uncompressedSize||o.dir||!t||0===t.length)&&(o.base64=!1,o.binary=!0,t="",o.compression="STORE",i="string");var b;b=t instanceof l||t instanceof s?t:d.isNode&&d.isStream(t)?new f(e,t):a.prepareContent(e,t,o.binary,o.optimizedBinaryString,o.base64);var g=new h(e,b,o);this.files[e]=g}var i=e("./utf8"),a=e("./utils"),s=e("./stream/GenericWorker"),o=e("./stream/StreamHelper"),u=e("./defaults"),l=e("./compressedObject"),h=e("./zipObject"),c=e("./generate"),d=e("./nodejsUtils"),f=e("./nodejs/NodejsStreamInputAdapter"),p=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},y=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},m=function(e,t){return t=void 0!==t?t:u.createFolders,e=y(e),this.files[e]||n.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function b(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var g={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n)},filter:function(e){var t=[];return this.forEach((function(r,n){e(r,n)&&t.push(n)})),t},file:function(e,t,r){if(1!==arguments.length)return e=this.root+e,n.call(this,e,t,r),this;if(b(e)){var i=e;return this.filter((function(e,t){return!t.dir&&i.test(e)}))}var a=this.files[this.root+e];return a&&!a.dir?a:null},folder:function(e){if(!e)return this;if(b(e))return this.filter((function(t,r){return r.dir&&e.test(t)}));var t=this.root+e,r=m.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter((function(t,r){return r.name.slice(0,e.length)===e})),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=a.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");a.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";t=c.generateWorker(this,r,n)}catch(e){(t=new s("error")).error(e)}return new o(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=g},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,r){t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){var n=e("./DataReader");function i(e){n.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),a=this.length-4;0<=a;--a)if(this.data[a]===t&&this.data[a+1]===r&&this.data[a+2]===n&&this.data[a+3]===i)return a-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&r===a[1]&&n===a[2]&&i===a[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){var n=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,r){var n=e("./Uint8ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){var n=e("./DataReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){var n=e("./ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){var n=e("../utils"),i=e("../support"),a=e("./ArrayReader"),s=e("./StringReader"),o=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new o(e):i.uint8array?new u(n.transformTo("uint8array",e)):new a(n.transformTo("array",e)):new s(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,r){var n=e("./GenericWorker"),i=e("../utils");function a(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(a,n),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){var n=e("./GenericWorker"),i=e("../crc32");function a(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(a,n),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function a(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function a(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}n.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=n},{}],29:[function(e,t,r){var i=e("../utils"),a=e("./ConvertWorker"),s=e("./GenericWorker"),o=e("../base64"),u=e("../support"),l=e("../external"),h=null;if(u.nodestream)try{h=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function c(e,t,r){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=t,this._mimeType=r,i.checkSupport(n),this._worker=e.pipe(new a(n)),e.lock()}catch(e){this._worker=new s("error"),this._worker.error(e)}}c.prototype={accumulate:function(e){return function(e,t){return new l.Promise((function(r,a){var s=[],u=e._internalType,l=e._outputType,h=e._mimeType;e.on("data",(function(e,r){s.push(e),t&&t(r)})).on("error",(function(e){s=[],a(e)})).on("end",(function(){try{var e=function(e,t,r){switch(e){case"blob":return i.newBlob(i.transformTo("arraybuffer",t),r);case"base64":return o.encode(t);default:return i.transformTo(e,t)}}(l,function(e,t){var r,i=0,a=null,s=0;for(r=0;r<t.length;r++)s+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(a=new Uint8Array(s),r=0;r<t.length;r++)a.set(t[r],i),i+=t[r].length;return a;case"nodebuffer":return n.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(u,s),h);r(e)}catch(e){a(e)}s=[]})).resume()}))}(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,(function(e){t.call(r,e.data,e.meta)})):this._worker.on(e,(function(){i.delay(t,arguments,r)})),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(i.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=c},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,r){if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer=void 0!==n,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var i=new ArrayBuffer(0);try{r.blob=0===new Blob([i],{type:"application/zip"}).size}catch(e){try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(i),r.blob=0===a.getBlob("application/zip").size}catch(e){r.blob=!1}}}try{r.nodestream=!!e("readable-stream").Readable}catch(e){r.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,r){for(var n=e("./utils"),i=e("./support"),a=e("./nodejsUtils"),s=e("./stream/GenericWorker"),o=new Array(256),u=0;u<256;u++)o[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function l(){s.call(this,"utf-8 decode"),this.leftOver=null}function h(){s.call(this,"utf-8 encode")}o[254]=o[254]=1,r.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,"utf-8"):function(e){var t,r,n,a,s,o=e.length,u=0;for(a=0;a<o;a++)55296==(64512&(r=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(n=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=i.uint8array?new Uint8Array(u):new Array(u),a=s=0;s<u;a++)55296==(64512&(r=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(n=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),r<128?t[s++]=r:(r<2048?t[s++]=192|r>>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},r.utf8decode=function(e){return i.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,a,s=e.length,u=new Array(2*s);for(t=r=0;t<s;)if((i=e[t++])<128)u[r++]=i;else if(4<(a=o[i]))u[r++]=65533,t+=a-1;else{for(i&=2===a?31:3===a?15:7;1<a&&t<s;)i=i<<6|63&e[t++],a--;1<a?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)}(e=n.transformTo(i.uint8array?"uint8array":"array",e))},n.inherits(l,s),l.prototype.processChunk=function(e){var t=n.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var s=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+o[e[r]]>t?r:t}(t),u=t;s!==t.length&&(i.uint8array?(u=t.subarray(0,s),this.leftOver=t.subarray(s,t.length)):(u=t.slice(0,s),this.leftOver=t.slice(s,t.length))),this.push({data:r.utf8decode(u),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=l,n.inherits(h,s),h.prototype.processChunk=function(e){this.push({data:r.utf8encode(e.data),meta:e.meta})},r.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,r){var n=e("./support"),i=e("./base64"),a=e("./nodejsUtils"),s=e("./external");function o(e){return e}function u(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}e("setimmediate"),r.newBlob=function(e,t){r.checkSupport("blob");try{return new Blob([e],{type:t})}catch(r){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(e),n.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var l={stringifyByChunk:function(e,t,r){var n=[],i=0,a=e.length;if(a<=r)return String.fromCharCode.apply(null,e);for(;i<a;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,a)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,a)))),i+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,a.allocBuffer(1)).length}catch(e){return!1}}()}};function h(e){var t=65536,n=r.getTypeOf(e),i=!0;if("uint8array"===n?i=l.applyCanBeUsed.uint8array:"nodebuffer"===n&&(i=l.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return l.stringifyByChunk(e,n,t)}catch(e){t=Math.floor(t/2)}return l.stringifyByChar(e)}function c(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}r.applyFromCharCode=h;var d={};d.string={string:o,array:function(e){return u(e,new Array(e.length))},arraybuffer:function(e){return d.string.uint8array(e).buffer},uint8array:function(e){return u(e,new Uint8Array(e.length))},nodebuffer:function(e){return u(e,a.allocBuffer(e.length))}},d.array={string:h,array:o,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(e)}},d.arraybuffer={string:function(e){return h(new Uint8Array(e))},array:function(e){return c(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:o,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(new Uint8Array(e))}},d.uint8array={string:h,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:o,nodebuffer:function(e){return a.newBufferFrom(e)}},d.nodebuffer={string:h,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return d.nodebuffer.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:o},r.transformTo=function(e,t){if(t=t||"",!e)return t;r.checkSupport(e);var n=r.getTypeOf(t);return d[n][e](t)},r.resolve=function(e){for(var t=e.split("/"),r=[],n=0;n<t.length;n++){var i=t[n];"."===i||""===i&&0!==n&&n!==t.length-1||(".."===i?r.pop():r.push(i))}return r.join("/")},r.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":n.nodebuffer&&a.isBuffer(e)?"nodebuffer":n.uint8array&&e instanceof Uint8Array?"uint8array":n.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(e){if(!n[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},r.delay=function(e,t,r){setImmediate((function(){e.apply(r||null,t||[])}))},r.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r},r.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},r.prepareContent=function(e,t,a,o,l){return s.Promise.resolve(t).then((function(e){return n.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new s.Promise((function(t,r){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=function(e){r(e.target.error)},n.readAsArrayBuffer(e)})):e})).then((function(t){var h=r.getTypeOf(t);return h?("arraybuffer"===h?t=r.transformTo("uint8array",t):"string"===h&&(l?t=i.decode(t):a&&!0!==o&&(t=function(e){return u(e,n.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):s.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,r){var n=e("./reader/readerFor"),i=e("./utils"),a=e("./signature"),s=e("./zipEntry"),o=e("./support");function u(e){this.files=[],this.loadOptions=e}u.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=o.uint8array?"uint8array":"array",r=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(e=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(0<n)this.isSignature(t,a.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){var n=e("./reader/readerFor"),i=e("./utils"),a=e("./compressedObject"),s=e("./crc32"),o=e("./utf8"),u=e("./compressions"),l=e("./support");function h(e,t){this.options=e,this.loadOptions=t}h.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in u)if(Object.prototype.hasOwnProperty.call(u,t)&&u[t].magic===e)return u[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n};e.setIndex(i)},handleUTF8:function(){var e=l.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var a=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(a)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=n(e.value);return 1!==t.readInt(1)||s(this.fileName)!==t.readInt(4)?null:o.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=n(e.value);return 1!==t.readInt(1)||s(this.fileComment)!==t.readInt(4)?null:o.utf8decode(t.readData(e.length-5))}return null}},t.exports=h},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){function n(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var i=e("./stream/StreamHelper"),a=e("./stream/DataWorker"),s=e("./utf8"),o=e("./compressedObject"),u=e("./stream/GenericWorker");n.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var a=!this._dataBinary;a&&!n&&(t=t.pipe(new s.Utf8EncodeWorker)),!a&&n&&(t=t.pipe(new s.Utf8DecodeWorker))}catch(e){(t=new u("error")).error(e)}return new i(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof o&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new s.Utf8EncodeWorker)),o.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var l=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],h=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<l.length;c++)n.prototype[l[c]]=h;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,n){(function(e){var r,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var a=0,s=new i(h),o=e.document.createTextNode("");s.observe(o,{characterData:!0}),r=function(){o.data=a=++a%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){h(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(h,0)};else{var u=new e.MessageChannel;u.port1.onmessage=h,r=function(){u.port2.postMessage(0)}}var l=[];function h(){var e,t;n=!0;for(var r=l.length;r;){for(t=l,l=[],e=-1;++e<r;)t[e]();r=l.length}n=!1}t.exports=function(e){1!==l.push(e)||n||r()}}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,r){var n=e("immediate");function i(){}var a={},s=["REJECTED"],o=["FULFILLED"],u=["PENDING"];function l(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&f(this,e)}function h(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function c(e,t,r){n((function(){var n;try{n=t(r)}catch(n){return a.reject(e,n)}n===e?a.reject(e,new TypeError("Cannot resolve promise with itself")):a.resolve(e,n)}))}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function f(e,t){var r=!1;function n(t){r||(r=!0,a.reject(e,t))}function i(t){r||(r=!0,a.resolve(e,t))}var s=p((function(){t(i,n)}));"error"===s.status&&n(s.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}(t.exports=l).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){throw r}))}))},l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if("function"!=typeof e&&this.state===o||"function"!=typeof t&&this.state===s)return this;var r=new this.constructor(i);return this.state!==u?c(r,this.state===o?e:t,this.outcome):this.queue.push(new h(r,e,t)),r},h.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},h.prototype.otherCallFulfilled=function(e){c(this.promise,this.onFulfilled,e)},h.prototype.callRejected=function(e){a.reject(this.promise,e)},h.prototype.otherCallRejected=function(e){c(this.promise,this.onRejected,e)},a.resolve=function(e,t){var r=p(d,t);if("error"===r.status)return a.reject(e,r.value);var n=r.value;if(n)f(e,n);else{e.state=o,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},a.reject=function(e,t){e.state=s,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},l.resolve=function(e){return e instanceof this?e:a.resolve(new this(i),e)},l.reject=function(e){var t=new this(i);return a.reject(t,e)},l.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var s=new Array(r),o=0,u=-1,l=new this(i);++u<r;)h(e[u],u);return l;function h(e,i){t.resolve(e).then((function(e){s[i]=e,++o!==r||n||(n=!0,a.resolve(l,s))}),(function(e){n||(n=!0,a.reject(l,e))}))}},l.race=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,r=!1;if(!t)return this.resolve([]);for(var n,s=-1,o=new this(i);++s<t;)n=e[s],this.resolve(n).then((function(e){r||(r=!0,a.resolve(o,e))}),(function(e){r||(r=!0,a.reject(o,e))}));return o}},{immediate:36}],38:[function(e,t,r){var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){var n=e("./zlib/deflate"),i=e("./utils/common"),a=e("./utils/strings"),s=e("./zlib/messages"),o=e("./zlib/zstream"),u=Object.prototype.toString,l=0,h=-1,c=0,d=8;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({level:h,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:c,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==l)throw new Error(s[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=n.deflateSetDictionary(this.strm,p))!==l)throw new Error(s[r]);this._dict_set=!0}}function p(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,o=this.strm,h=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?4:0,"string"==typeof e?o.input=a.string2buf(e):"[object ArrayBuffer]"===u.call(e)?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new i.Buf8(h),o.next_out=0,o.avail_out=h),1!==(r=n.deflate(o,s))&&r!==l)return this.onEnd(r),!(this.ended=!0);0!==o.avail_out&&(0!==o.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(o.output,o.next_out))):this.onData(i.shrinkBuf(o.output,o.next_out)))}while((0<o.avail_in||0===o.avail_out)&&1!==r);return 4===s?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===l):2!==s||(this.onEnd(l),!(o.avail_out=0))},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===l&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=f,r.deflate=p,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){var n=e("./zlib/inflate"),i=e("./utils/common"),a=e("./utils/strings"),s=e("./zlib/constants"),o=e("./zlib/messages"),u=e("./zlib/zstream"),l=e("./zlib/gzheader"),h=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==s.Z_OK)throw new Error(o[r]);this.header=new l,n.inflateGetHeader(this.strm,this.header)}function d(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}c.prototype.push=function(e,t){var r,o,u,l,c,d,f=this.strm,p=this.options.chunkSize,y=this.options.dictionary,m=!1;if(this.ended)return!1;o=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?f.input=a.binstring2buf(e):"[object ArrayBuffer]"===h.call(e)?f.input=new Uint8Array(e):f.input=e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(p),f.next_out=0,f.avail_out=p),(r=n.inflate(f,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&y&&(d="string"==typeof y?a.string2buf(y):"[object ArrayBuffer]"===h.call(y)?new Uint8Array(y):y,r=n.inflateSetDictionary(this.strm,d)),r===s.Z_BUF_ERROR&&!0===m&&(r=s.Z_OK,m=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),!(this.ended=!0);f.next_out&&(0!==f.avail_out&&r!==s.Z_STREAM_END&&(0!==f.avail_in||o!==s.Z_FINISH&&o!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(u=a.utf8border(f.output,f.next_out),l=f.next_out-u,c=a.buf2string(f.output,u),f.next_out=l,f.avail_out=p-l,l&&i.arraySet(f.output,f.output,u,l,0),this.onData(c)):this.onData(i.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(m=!0)}while((0<f.avail_in||0===f.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(o=s.Z_FINISH),o===s.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):o!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),!(f.avail_out=0))},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=c,r.inflate=d,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},r.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){var t,r,n,i,a,s;for(t=n=0,r=e.length;t<r;t++)n+=e[t].length;for(s=new Uint8Array(n),t=i=0,r=e.length;t<r;t++)a=e[t],s.set(a,i),i+=a.length;return s}},a={arraySet:function(e,t,r,n,i){for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,a))},r.setTyped(n)},{}],42:[function(e,t,r){var n=e("./common"),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var s=new n.Buf8(256),o=0;o<256;o++)s[o]=252<=o?6:248<=o?5:240<=o?4:224<=o?3:192<=o?2:1;function u(e,t){if(t<65537&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",s=0;s<t;s++)r+=String.fromCharCode(e[s]);return r}s[254]=s[254]=1,r.string2buf=function(e){var t,r,i,a,s,o=e.length,u=0;for(a=0;a<o;a++)55296==(64512&(r=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(i-56320),a++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(u),a=s=0;s<u;a++)55296==(64512&(r=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(i-56320),a++),r<128?t[s++]=r:(r<2048?t[s++]=192|r>>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return u(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,i,a,o=t||e.length,l=new Array(2*o);for(r=n=0;r<o;)if((i=e[r++])<128)l[n++]=i;else if(4<(a=s[i]))l[n++]=65533,r+=a-1;else{for(i&=2===a?31:3===a?15:7;1<a&&r<o;)i=i<<6|63&e[r++],a--;1<a?l[n++]=65533:i<65536?l[n++]=i:(i-=65536,l[n++]=55296|i>>10&1023,l[n++]=56320|1023&i)}return u(l,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){t.exports=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,s=0;0!==r;){for(r-=s=2e3<r?2e3:r;a=a+(i=i+t[n++]|0)|0,--s;);i%=65521,a%=65521}return i|a<<16|0}},{}],44:[function(e,t,r){t.exports={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_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}},{}],45:[function(e,t,r){var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var a=n,s=i+r;e^=-1;for(var o=i;o<s;o++)e=e>>>8^a[255&(e^t[o])];return-1^e}},{}],46:[function(e,t,r){var n,i=e("../utils/common"),a=e("./trees"),s=e("./adler32"),o=e("./crc32"),u=e("./messages"),l=0,h=4,c=0,d=-2,f=2,p=8,y=286,m=30,b=19,g=2*y+1,v=15,w=3,_=258,M=_+w+1,T=42,E=113,A=1,x=2,k=3,S=4;function I(e,t){return e.msg=u[t],t}function C(e){return(e<<1)-(4<e?9:0)}function O(e){for(var t=e.length;0<=--t;)e[t]=0}function R(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function N(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,R(e.strm)}function P(e,t){e.pending_buf[e.pending++]=t}function B(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function D(e,t){var r,n,i=e.max_chain_length,a=e.strstart,s=e.prev_length,o=e.nice_match,u=e.strstart>e.w_size-M?e.strstart-(e.w_size-M):0,l=e.window,h=e.w_mask,c=e.prev,d=e.strstart+_,f=l[a+s-1],p=l[a+s];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(l[(r=t)+s]===p&&l[r+s-1]===f&&l[r]===l[a]&&l[++r]===l[a+1]){a+=2,r++;do{}while(l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&a<d);if(n=_-(d-a),a=d-_,s<n){if(e.match_start=t,o<=(s=n))break;f=l[a+s-1],p=l[a+s]}}}while((t=c[t&h])>u&&0!=--i);return s<=e.lookahead?s:e.lookahead}function L(e){var t,r,n,a,u,l,h,c,d,f,p=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-M)){for(i.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;n=e.head[--t],e.head[t]=p<=n?n-p:0,--r;);for(t=r=p;n=e.prev[--t],e.prev[t]=p<=n?n-p:0,--r;);a+=p}if(0===e.strm.avail_in)break;if(l=e.strm,h=e.window,c=e.strstart+e.lookahead,f=void 0,(d=a)<(f=l.avail_in)&&(f=d),r=0===f?0:(l.avail_in-=f,i.arraySet(h,l.input,l.next_in,f,c),1===l.state.wrap?l.adler=s(l.adler,h,f,c):2===l.state.wrap&&(l.adler=o(l.adler,h,f,c)),l.next_in+=f,l.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=w)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+w-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<w)););}while(e.lookahead<M&&0!==e.strm.avail_in)}function F(e,t){for(var r,n;;){if(e.lookahead<M){if(L(e),e.lookahead<M&&t===l)return A;if(0===e.lookahead)break}if(r=0,e.lookahead>=w&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+w-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-M&&(e.match_length=D(e,r)),e.match_length>=w)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-w),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=w){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+w-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=e.strstart<w-1?e.strstart:w-1,t===h?(N(e,!0),0===e.strm.avail_out?k:S):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:x}function U(e,t){for(var r,n,i;;){if(e.lookahead<M){if(L(e),e.lookahead<M&&t===l)return A;if(0===e.lookahead)break}if(r=0,e.lookahead>=w&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+w-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=w-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-M&&(e.match_length=D(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===w&&4096<e.strstart-e.match_start)&&(e.match_length=w-1)),e.prev_length>=w&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-w,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-w),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+w-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=w-1,e.strstart++,n&&(N(e,!1),0===e.strm.avail_out))return A}else if(e.match_available){if((n=a._tr_tally(e,0,e.window[e.strstart-1]))&&N(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return A}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=a._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<w-1?e.strstart:w-1,t===h?(N(e,!0),0===e.strm.avail_out?k:S):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:x}function j(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function q(){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=p,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 i.Buf16(2*g),this.dyn_dtree=new i.Buf16(2*(2*m+1)),this.bl_tree=new i.Buf16(2*(2*b+1)),O(this.dyn_ltree),O(this.dyn_dtree),O(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(v+1),this.heap=new i.Buf16(2*y+1),O(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*y+1),O(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function z(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=f,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?T:E,e.adler=2===t.wrap?0:1,t.last_flush=l,a._tr_init(t),c):I(e,d)}function G(e){var t=z(e);return t===c&&function(e){e.window_size=2*e.w_size,O(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=w-1,e.match_available=0,e.ins_h=0}(e.state),t}function K(e,t,r,n,a,s){if(!e)return d;var o=1;if(-1===t&&(t=6),n<0?(o=0,n=-n):15<n&&(o=2,n-=16),a<1||9<a||r!==p||n<8||15<n||t<0||9<t||s<0||4<s)return I(e,d);8===n&&(n=9);var u=new q;return(e.state=u).strm=e,u.wrap=o,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=a+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+w-1)/w),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<a+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=s,u.method=r,G(e)}n=[new j(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(L(e),0===e.lookahead&&t===l)return A;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,N(e,!1),0===e.strm.avail_out))return A;if(e.strstart-e.block_start>=e.w_size-M&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===h?(N(e,!0),0===e.strm.avail_out?k:S):(e.strstart>e.block_start&&(N(e,!1),e.strm.avail_out),A)})),new j(4,4,8,4,F),new j(4,5,16,8,F),new j(4,6,32,32,F),new j(4,4,16,16,U),new j(8,16,32,32,U),new j(8,16,128,128,U),new j(8,32,128,256,U),new j(32,128,258,1024,U),new j(32,258,258,4096,U)],r.deflateInit=function(e,t){return K(e,t,p,15,8,0)},r.deflateInit2=K,r.deflateReset=G,r.deflateResetKeep=z,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?d:(e.state.gzhead=t,c):d},r.deflate=function(e,t){var r,i,s,u;if(!e||!e.state||5<t||t<0)return e?I(e,d):d;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&t!==h)return I(e,0===e.avail_out?-5:d);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===T)if(2===i.wrap)e.adler=0,P(i,31),P(i,139),P(i,8),i.gzhead?(P(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),P(i,255&i.gzhead.time),P(i,i.gzhead.time>>8&255),P(i,i.gzhead.time>>16&255),P(i,i.gzhead.time>>24&255),P(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),P(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(P(i,255&i.gzhead.extra.length),P(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=o(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(P(i,0),P(i,0),P(i,0),P(i,0),P(i,0),P(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),P(i,3),i.status=E);else{var f=p+(i.w_bits-8<<4)<<8;f|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=E,B(i,f),0!==i.strstart&&(B(i,e.adler>>>16),B(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),R(e),s=i.pending,i.pending!==i.pending_buf_size));)P(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),R(e),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,P(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),R(e),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,P(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&R(e),i.pending+2<=i.pending_buf_size&&(P(i,255&e.adler),P(i,e.adler>>8&255),e.adler=0,i.status=E)):i.status=E),0!==i.pending){if(R(e),0===e.avail_out)return i.last_flush=-1,c}else if(0===e.avail_in&&C(t)<=C(r)&&t!==h)return I(e,-5);if(666===i.status&&0!==e.avail_in)return I(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==l&&666!==i.status){var y=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(L(e),0===e.lookahead)){if(t===l)return A;break}if(e.match_length=0,r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===h?(N(e,!0),0===e.strm.avail_out?k:S):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:x}(i,t):3===i.strategy?function(e,t){for(var r,n,i,s,o=e.window;;){if(e.lookahead<=_){if(L(e),e.lookahead<=_&&t===l)return A;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=w&&0<e.strstart&&(n=o[i=e.strstart-1])===o[++i]&&n===o[++i]&&n===o[++i]){s=e.strstart+_;do{}while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<s);e.match_length=_-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=w?(r=a._tr_tally(e,1,e.match_length-w),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===h?(N(e,!0),0===e.strm.avail_out?k:S):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:x}(i,t):n[i.level].func(i,t);if(y!==k&&y!==S||(i.status=666),y===A||y===k)return 0===e.avail_out&&(i.last_flush=-1),c;if(y===x&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(O(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),R(e),0===e.avail_out))return i.last_flush=-1,c}return t!==h?c:i.wrap<=0?1:(2===i.wrap?(P(i,255&e.adler),P(i,e.adler>>8&255),P(i,e.adler>>16&255),P(i,e.adler>>24&255),P(i,255&e.total_in),P(i,e.total_in>>8&255),P(i,e.total_in>>16&255),P(i,e.total_in>>24&255)):(B(i,e.adler>>>16),B(i,65535&e.adler)),R(e),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?c:1)},r.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==T&&69!==t&&73!==t&&91!==t&&103!==t&&t!==E&&666!==t?I(e,d):(e.state=null,t===E?I(e,-3):c):d},r.deflateSetDictionary=function(e,t){var r,n,a,o,u,l,h,f,p=t.length;if(!e||!e.state)return d;if(2===(o=(r=e.state).wrap)||1===o&&r.status!==T||r.lookahead)return d;for(1===o&&(e.adler=s(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===o&&(O(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new i.Buf8(r.w_size),i.arraySet(f,t,p-r.w_size,r.w_size,0),t=f,p=r.w_size),u=e.avail_in,l=e.next_in,h=e.input,e.avail_in=p,e.next_in=0,e.input=t,L(r);r.lookahead>=w;){for(n=r.strstart,a=r.lookahead-(w-1);r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+w-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--a;);r.strstart=n,r.lookahead=w-1,L(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=w-1,r.match_available=0,e.next_in=l,e.input=h,e.avail_in=u,r.wrap=o,c},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){t.exports=function(){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}},{}],48:[function(e,t,r){t.exports=function(e,t){var r,n,i,a,s,o,u,l,h,c,d,f,p,y,m,b,g,v,w,_,M,T,E,A,x;r=e.state,n=e.next_in,A=e.input,i=n+(e.avail_in-5),a=e.next_out,x=e.output,s=a-(t-e.avail_out),o=a+(e.avail_out-257),u=r.dmax,l=r.wsize,h=r.whave,c=r.wnext,d=r.window,f=r.hold,p=r.bits,y=r.lencode,m=r.distcode,b=(1<<r.lenbits)-1,g=(1<<r.distbits)-1;e:do{p<15&&(f+=A[n++]<<p,p+=8,f+=A[n++]<<p,p+=8),v=y[f&b];t:for(;;){if(f>>>=w=v>>>24,p-=w,0==(w=v>>>16&255))x[a++]=65535&v;else{if(!(16&w)){if(0==(64&w)){v=y[(65535&v)+(f&(1<<w)-1)];continue t}if(32&w){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}_=65535&v,(w&=15)&&(p<w&&(f+=A[n++]<<p,p+=8),_+=f&(1<<w)-1,f>>>=w,p-=w),p<15&&(f+=A[n++]<<p,p+=8,f+=A[n++]<<p,p+=8),v=m[f&g];r:for(;;){if(f>>>=w=v>>>24,p-=w,!(16&(w=v>>>16&255))){if(0==(64&w)){v=m[(65535&v)+(f&(1<<w)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(M=65535&v,p<(w&=15)&&(f+=A[n++]<<p,(p+=8)<w&&(f+=A[n++]<<p,p+=8)),u<(M+=f&(1<<w)-1)){e.msg="invalid distance too far back",r.mode=30;break e}if(f>>>=w,p-=w,(w=a-s)<M){if(h<(w=M-w)&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(E=d,(T=0)===c){if(T+=l-w,w<_){for(_-=w;x[a++]=d[T++],--w;);T=a-M,E=x}}else if(c<w){if(T+=l+c-w,(w-=c)<_){for(_-=w;x[a++]=d[T++],--w;);if(T=0,c<_){for(_-=w=c;x[a++]=d[T++],--w;);T=a-M,E=x}}}else if(T+=c-w,w<_){for(_-=w;x[a++]=d[T++],--w;);T=a-M,E=x}for(;2<_;)x[a++]=E[T++],x[a++]=E[T++],x[a++]=E[T++],_-=3;_&&(x[a++]=E[T++],1<_&&(x[a++]=E[T++]))}else{for(T=a-M;x[a++]=x[T++],x[a++]=x[T++],x[a++]=x[T++],2<(_-=3););_&&(x[a++]=x[T++],1<_&&(x[a++]=x[T++]))}break}}break}}while(n<i&&a<o);n-=_=p>>3,f&=(1<<(p-=_<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=a<o?o-a+257:257-(a-o),r.hold=f,r.bits=p}},{}],49:[function(e,t,r){var n=e("../utils/common"),i=e("./adler32"),a=e("./crc32"),s=e("./inffast"),o=e("./inftrees"),u=1,l=2,h=0,c=-2,d=1,f=852,p=592;function y(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function m(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function b(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=d,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(f),t.distcode=t.distdyn=new n.Buf32(p),t.sane=1,t.back=-1,h):c}function g(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,b(e)):c}function v(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?c:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,g(e))):c}function w(e,t){var r,n;return e?(n=new m,(e.state=n).window=null,(r=v(e,t))!==h&&(e.state=null),r):c}var _,M,T=!0;function E(e){if(T){var t;for(_=new n.Buf32(512),M=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(o(u,e.lens,0,288,_,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;o(l,e.lens,0,32,M,0,e.work,{bits:5}),T=!1}e.lencode=_,e.lenbits=9,e.distcode=M,e.distbits=5}function A(e,t,r,i){var a,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),i>=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i<(a=s.wsize-s.wnext)&&(a=i),n.arraySet(s.window,t,r-i,a,s.wnext),(i-=a)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=a))),0}r.inflateReset=g,r.inflateReset2=v,r.inflateResetKeep=b,r.inflateInit=function(e){return w(e,15)},r.inflateInit2=w,r.inflate=function(e,t){var r,f,p,m,b,g,v,w,_,M,T,x,k,S,I,C,O,R,N,P,B,D,L,F,U=0,j=new n.Buf8(4),q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return c;12===(r=e.state).mode&&(r.mode=13),b=e.next_out,p=e.output,v=e.avail_out,m=e.next_in,f=e.input,g=e.avail_in,w=r.hold,_=r.bits,M=g,T=v,D=h;e:for(;;)switch(r.mode){case d:if(0===r.wrap){r.mode=13;break}for(;_<16;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}if(2&r.wrap&&35615===w){j[r.check=0]=255&w,j[1]=w>>>8&255,r.check=a(r.check,j,2,0),_=w=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&w)<<8)+(w>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&w)){e.msg="unknown compression method",r.mode=30;break}if(_-=4,B=8+(15&(w>>>=4)),0===r.wbits)r.wbits=B;else if(B>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<B,e.adler=r.check=1,r.mode=512&w?10:12,_=w=0;break;case 2:for(;_<16;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}if(r.flags=w,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=w>>8&1),512&r.flags&&(j[0]=255&w,j[1]=w>>>8&255,r.check=a(r.check,j,2,0)),_=w=0,r.mode=3;case 3:for(;_<32;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}r.head&&(r.head.time=w),512&r.flags&&(j[0]=255&w,j[1]=w>>>8&255,j[2]=w>>>16&255,j[3]=w>>>24&255,r.check=a(r.check,j,4,0)),_=w=0,r.mode=4;case 4:for(;_<16;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}r.head&&(r.head.xflags=255&w,r.head.os=w>>8),512&r.flags&&(j[0]=255&w,j[1]=w>>>8&255,r.check=a(r.check,j,2,0)),_=w=0,r.mode=5;case 5:if(1024&r.flags){for(;_<16;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}r.length=w,r.head&&(r.head.extra_len=w),512&r.flags&&(j[0]=255&w,j[1]=w>>>8&255,r.check=a(r.check,j,2,0)),_=w=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(g<(x=r.length)&&(x=g),x&&(r.head&&(B=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,f,m,x,B)),512&r.flags&&(r.check=a(r.check,f,x,m)),g-=x,m+=x,r.length-=x),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===g)break e;for(x=0;B=f[m+x++],r.head&&B&&r.length<65536&&(r.head.name+=String.fromCharCode(B)),B&&x<g;);if(512&r.flags&&(r.check=a(r.check,f,x,m)),g-=x,m+=x,B)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===g)break e;for(x=0;B=f[m+x++],r.head&&B&&r.length<65536&&(r.head.comment+=String.fromCharCode(B)),B&&x<g;);if(512&r.flags&&(r.check=a(r.check,f,x,m)),g-=x,m+=x,B)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;_<16;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}if(w!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}_=w=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;_<32;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}e.adler=r.check=y(w),_=w=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=b,e.avail_out=v,e.next_in=m,e.avail_in=g,r.hold=w,r.bits=_,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){w>>>=7&_,_-=7&_,r.mode=27;break}for(;_<3;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}switch(r.last=1&w,_-=1,3&(w>>>=1)){case 0:r.mode=14;break;case 1:if(E(r),r.mode=20,6!==t)break;w>>>=2,_-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}w>>>=2,_-=2;break;case 14:for(w>>>=7&_,_-=7&_;_<32;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}if((65535&w)!=(w>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&w,_=w=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(x=r.length){if(g<x&&(x=g),v<x&&(x=v),0===x)break e;n.arraySet(p,f,m,x,b),g-=x,m+=x,v-=x,b+=x,r.length-=x;break}r.mode=12;break;case 17:for(;_<14;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}if(r.nlen=257+(31&w),w>>>=5,_-=5,r.ndist=1+(31&w),w>>>=5,_-=5,r.ncode=4+(15&w),w>>>=4,_-=4,286<r.nlen||30<r.ndist){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;_<3;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}r.lens[q[r.have++]]=7&w,w>>>=3,_-=3}for(;r.have<19;)r.lens[q[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,L={bits:r.lenbits},D=o(0,r.lens,0,19,r.lencode,0,r.work,L),r.lenbits=L.bits,D){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;C=(U=r.lencode[w&(1<<r.lenbits)-1])>>>16&255,O=65535&U,!((I=U>>>24)<=_);){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}if(O<16)w>>>=I,_-=I,r.lens[r.have++]=O;else{if(16===O){for(F=I+2;_<F;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}if(w>>>=I,_-=I,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}B=r.lens[r.have-1],x=3+(3&w),w>>>=2,_-=2}else if(17===O){for(F=I+3;_<F;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}_-=I,B=0,x=3+(7&(w>>>=I)),w>>>=3,_-=3}else{for(F=I+7;_<F;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}_-=I,B=0,x=11+(127&(w>>>=I)),w>>>=7,_-=7}if(r.have+x>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;x--;)r.lens[r.have++]=B}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,L={bits:r.lenbits},D=o(u,r.lens,0,r.nlen,r.lencode,0,r.work,L),r.lenbits=L.bits,D){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,L={bits:r.distbits},D=o(l,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,L),r.distbits=L.bits,D){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=g&&258<=v){e.next_out=b,e.avail_out=v,e.next_in=m,e.avail_in=g,r.hold=w,r.bits=_,s(e,T),b=e.next_out,p=e.output,v=e.avail_out,m=e.next_in,f=e.input,g=e.avail_in,w=r.hold,_=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;C=(U=r.lencode[w&(1<<r.lenbits)-1])>>>16&255,O=65535&U,!((I=U>>>24)<=_);){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}if(C&&0==(240&C)){for(R=I,N=C,P=O;C=(U=r.lencode[P+((w&(1<<R+N)-1)>>R)])>>>16&255,O=65535&U,!(R+(I=U>>>24)<=_);){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}w>>>=R,_-=R,r.back+=R}if(w>>>=I,_-=I,r.back+=I,r.length=O,0===C){r.mode=26;break}if(32&C){r.back=-1,r.mode=12;break}if(64&C){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&C,r.mode=22;case 22:if(r.extra){for(F=r.extra;_<F;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}r.length+=w&(1<<r.extra)-1,w>>>=r.extra,_-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;C=(U=r.distcode[w&(1<<r.distbits)-1])>>>16&255,O=65535&U,!((I=U>>>24)<=_);){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}if(0==(240&C)){for(R=I,N=C,P=O;C=(U=r.distcode[P+((w&(1<<R+N)-1)>>R)])>>>16&255,O=65535&U,!(R+(I=U>>>24)<=_);){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}w>>>=R,_-=R,r.back+=R}if(w>>>=I,_-=I,r.back+=I,64&C){e.msg="invalid distance code",r.mode=30;break}r.offset=O,r.extra=15&C,r.mode=24;case 24:if(r.extra){for(F=r.extra;_<F;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}r.offset+=w&(1<<r.extra)-1,w>>>=r.extra,_-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===v)break e;if(x=T-v,r.offset>x){if((x=r.offset-x)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}k=x>r.wnext?(x-=r.wnext,r.wsize-x):r.wnext-x,x>r.length&&(x=r.length),S=r.window}else S=p,k=b-r.offset,x=r.length;for(v<x&&(x=v),v-=x,r.length-=x;p[b++]=S[k++],--x;);0===r.length&&(r.mode=21);break;case 26:if(0===v)break e;p[b++]=r.length,v--,r.mode=21;break;case 27:if(r.wrap){for(;_<32;){if(0===g)break e;g--,w|=f[m++]<<_,_+=8}if(T-=v,e.total_out+=T,r.total+=T,T&&(e.adler=r.check=r.flags?a(r.check,p,T,b-T):i(r.check,p,T,b-T)),T=v,(r.flags?w:y(w))!==r.check){e.msg="incorrect data check",r.mode=30;break}_=w=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;_<32;){if(0===g)break e;g--,w+=f[m++]<<_,_+=8}if(w!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}_=w=0}r.mode=29;case 29:D=1;break e;case 30:D=-3;break e;case 31:return-4;default:return c}return e.next_out=b,e.avail_out=v,e.next_in=m,e.avail_in=g,r.hold=w,r.bits=_,(r.wsize||T!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&A(e,e.output,e.next_out,T-e.avail_out)?(r.mode=31,-4):(M-=e.avail_in,T-=e.avail_out,e.total_in+=M,e.total_out+=T,r.total+=T,r.wrap&&T&&(e.adler=r.check=r.flags?a(r.check,p,T,e.next_out-T):i(r.check,p,T,e.next_out-T)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==M&&0===T||4===t)&&D===h&&(D=-5),D)},r.inflateEnd=function(e){if(!e||!e.state)return c;var t=e.state;return t.window&&(t.window=null),e.state=null,h},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?c:((r.head=t).done=!1,h):c},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?c:11===r.mode&&i(1,t,n,0)!==r.check?-3:A(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,h):c},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){var n=e("../utils/common"),i=[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],a=[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],s=[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],o=[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];t.exports=function(e,t,r,u,l,h,c,d){var f,p,y,m,b,g,v,w,_,M=d.bits,T=0,E=0,A=0,x=0,k=0,S=0,I=0,C=0,O=0,R=0,N=null,P=0,B=new n.Buf16(16),D=new n.Buf16(16),L=null,F=0;for(T=0;T<=15;T++)B[T]=0;for(E=0;E<u;E++)B[t[r+E]]++;for(k=M,x=15;1<=x&&0===B[x];x--);if(x<k&&(k=x),0===x)return l[h++]=20971520,l[h++]=20971520,d.bits=1,0;for(A=1;A<x&&0===B[A];A++);for(k<A&&(k=A),T=C=1;T<=15;T++)if(C<<=1,(C-=B[T])<0)return-1;if(0<C&&(0===e||1!==x))return-1;for(D[1]=0,T=1;T<15;T++)D[T+1]=D[T]+B[T];for(E=0;E<u;E++)0!==t[r+E]&&(c[D[t[r+E]]++]=E);if(g=0===e?(N=L=c,19):1===e?(N=i,P-=257,L=a,F-=257,256):(N=s,L=o,-1),T=A,b=h,I=E=R=0,y=-1,m=(O=1<<(S=k))-1,1===e&&852<O||2===e&&592<O)return 1;for(;;){for(v=T-I,_=c[E]<g?(w=0,c[E]):c[E]>g?(w=L[F+c[E]],N[P+c[E]]):(w=96,0),f=1<<T-I,A=p=1<<S;l[b+(R>>I)+(p-=f)]=v<<24|w<<16|_|0,0!==p;);for(f=1<<T-1;R&f;)f>>=1;if(0!==f?(R&=f-1,R+=f):R=0,E++,0==--B[T]){if(T===x)break;T=t[r+c[E]]}if(k<T&&(R&m)!==y){for(0===I&&(I=k),b+=A,C=1<<(S=T-I);S+I<x&&!((C-=B[S+I])<=0);)S++,C<<=1;if(O+=1<<S,1===e&&852<O||2===e&&592<O)return 1;l[y=R&m]=k<<24|S<<16|b-h|0}}return 0!==R&&(l[b+R]=T-I<<24|64<<16|0),d.bits=k,0}},{"../utils/common":41}],51:[function(e,t,r){t.exports={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"}},{}],52:[function(e,t,r){var n=e("../utils/common");function i(e){for(var t=e.length;0<=--t;)e[t]=0}var a=256,s=a+1+29,o=30,u=19,l=2*s+1,h=15,c=16,d=256,f=[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],p=[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],y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],m=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],b=new Array(2*(s+2));i(b);var g=new Array(60);i(g);var v=new Array(512);i(v);var w=new Array(256);i(w);var _=new Array(29);i(_);var M,T,E,A=new Array(o);function x(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function k(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function S(e){return e<256?v[e]:v[256+(e>>>7)]}function I(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function C(e,t,r){e.bi_valid>c-r?(e.bi_buf|=t<<e.bi_valid&65535,I(e,e.bi_buf),e.bi_buf=t>>c-e.bi_valid,e.bi_valid+=r-c):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function O(e,t,r){C(e,r[2*t],r[2*t+1])}function R(e,t){for(var r=0;r|=1&e,e>>>=1,r<<=1,0<--t;);return r>>>1}function N(e,t,r){var n,i,a=new Array(h+1),s=0;for(n=1;n<=h;n++)a[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=R(a[o]++,o))}}function P(e){var t;for(t=0;t<s;t++)e.dyn_ltree[2*t]=0;for(t=0;t<o;t++)e.dyn_dtree[2*t]=0;for(t=0;t<u;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*d]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function B(e){8<e.bi_valid?I(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function D(e,t,r,n){var i=2*t,a=2*r;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]}function L(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&D(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!D(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function F(e,t,r){var n,i,s,o,u=0;if(0!==e.last_lit)for(;n=e.pending_buf[e.d_buf+2*u]<<8|e.pending_buf[e.d_buf+2*u+1],i=e.pending_buf[e.l_buf+u],u++,0===n?O(e,i,t):(O(e,(s=w[i])+a+1,t),0!==(o=f[s])&&C(e,i-=_[s],o),O(e,s=S(--n),r),0!==(o=p[s])&&C(e,n-=A[s],o)),u<e.last_lit;);O(e,d,t)}function U(e,t){var r,n,i,a=t.dyn_tree,s=t.stat_desc.static_tree,o=t.stat_desc.has_stree,u=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=l,r=0;r<u;r++)0!==a[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):a[2*r+1]=0;for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,o&&(e.static_len-=s[2*i+1]);for(t.max_code=c,r=e.heap_len>>1;1<=r;r--)L(e,a,r);for(i=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],L(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,L(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,s,o,u=t.dyn_tree,c=t.max_code,d=t.stat_desc.static_tree,f=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,y=t.stat_desc.extra_base,m=t.stat_desc.max_length,b=0;for(a=0;a<=h;a++)e.bl_count[a]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<l;r++)m<(a=u[2*u[2*(n=e.heap[r])+1]+1]+1)&&(a=m,b++),u[2*n+1]=a,c<n||(e.bl_count[a]++,s=0,y<=n&&(s=p[n-y]),o=u[2*n],e.opt_len+=o*(a+s),f&&(e.static_len+=o*(d[2*n+1]+s)));if(0!==b){do{for(a=m-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[m]--,b-=2}while(0<b);for(a=m;0!==a;a--)for(n=e.bl_count[a];0!==n;)c<(i=e.heap[--r])||(u[2*i+1]!==a&&(e.opt_len+=(a-u[2*i+1])*u[2*i],u[2*i+1]=a),n--)}}(e,t),N(a,c,e.bl_count)}function j(e,t,r){var n,i,a=-1,s=t[1],o=0,u=7,l=4;for(0===s&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++o<u&&i===s||(o<l?e.bl_tree[2*i]+=o:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=i,l=(o=0)===s?(u=138,3):i===s?(u=6,3):(u=7,4))}function q(e,t,r){var n,i,a=-1,s=t[1],o=0,u=7,l=4;for(0===s&&(u=138,l=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++o<u&&i===s)){if(o<l)for(;O(e,i,e.bl_tree),0!=--o;);else 0!==i?(i!==a&&(O(e,i,e.bl_tree),o--),O(e,16,e.bl_tree),C(e,o-3,2)):o<=10?(O(e,17,e.bl_tree),C(e,o-3,3)):(O(e,18,e.bl_tree),C(e,o-11,7));a=i,l=(o=0)===s?(u=138,3):i===s?(u=6,3):(u=7,4)}}i(A);var z=!1;function G(e,t,r,i){C(e,0+(i?1:0),3),function(e,t,r,i){B(e),I(e,r),I(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r)}r._tr_init=function(e){z||(function(){var e,t,r,n,i,l=new Array(h+1);for(n=r=0;n<28;n++)for(_[n]=r,e=0;e<1<<f[n];e++)w[r++]=n;for(w[r-1]=n,n=i=0;n<16;n++)for(A[n]=i,e=0;e<1<<p[n];e++)v[i++]=n;for(i>>=7;n<o;n++)for(A[n]=i<<7,e=0;e<1<<p[n]-7;e++)v[256+i++]=n;for(t=0;t<=h;t++)l[t]=0;for(e=0;e<=143;)b[2*e+1]=8,e++,l[8]++;for(;e<=255;)b[2*e+1]=9,e++,l[9]++;for(;e<=279;)b[2*e+1]=7,e++,l[7]++;for(;e<=287;)b[2*e+1]=8,e++,l[8]++;for(N(b,s+1,l),e=0;e<o;e++)g[2*e+1]=5,g[2*e]=R(e,5);M=new x(b,f,a+1,s,h),T=new x(g,p,0,o,h),E=new x(new Array(0),y,0,u,7)}(),z=!0),e.l_desc=new k(e.dyn_ltree,M),e.d_desc=new k(e.dyn_dtree,T),e.bl_desc=new k(e.bl_tree,E),e.bi_buf=0,e.bi_valid=0,P(e)},r._tr_stored_block=G,r._tr_flush_block=function(e,t,r,n){var i,s,o=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<a;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),U(e,e.l_desc),U(e,e.d_desc),o=function(e){var t;for(j(e,e.dyn_ltree,e.l_desc.max_code),j(e,e.dyn_dtree,e.d_desc.max_code),U(e,e.bl_desc),t=u-1;3<=t&&0===e.bl_tree[2*m[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?G(e,t,r,n):4===e.strategy||s===i?(C(e,2+(n?1:0),3),F(e,b,g)):(C(e,4+(n?1:0),3),function(e,t,r,n){var i;for(C(e,t-257,5),C(e,r-1,5),C(e,n-4,4),i=0;i<n;i++)C(e,e.bl_tree[2*m[i]+1],3);q(e,e.dyn_ltree,t-1),q(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),F(e,e.dyn_ltree,e.dyn_dtree)),P(e),n&&B(e)},r._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(w[r]+a+1)]++,e.dyn_dtree[2*S(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){C(e,2,3),O(e,d,b),function(e){16===e.bi_valid?(I(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,r){t.exports=function(){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}},{}],54:[function(e,t,n){(function(e){!function(e,t){if(!e.setImmediate){var r,n,a,s,o=1,u={},l=!1,h=e.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(e);c=c&&c.setTimeout?c:e,r="[object process]"==={}.toString.call(e.process)?function(e){i.nextTick((function(){f(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",p,!1):e.attachEvent("onmessage",p),function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){a.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(n=h.documentElement,function(e){var t=h.createElement("script");t.onreadystatechange=function(){f(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):function(e){setTimeout(f,0,e)},c.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return u[o]=i,r(o),o++},c.clearImmediate=d}function d(e){delete u[e]}function f(e){if(l)setTimeout(f,0,e);else{var r=u[e];if(r){l=!0;try{!function(e){var r=e.callback,n=e.args;switch(n.length){case 0:r();break;case 1:r(n[0]);break;case 2:r(n[0],n[1]);break;case 3:r(n[0],n[1],n[2]);break;default:r.apply(t,n)}}(r)}finally{d(e),l=!1}}}}function p(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&f(+t.data.slice(s.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},2318:(e,t,r)=>{var n=r(5717),i=r(3349),a=r(9509).Buffer,s=new Array(16);function o(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(e,t){return e<<t|e>>>32-t}function l(e,t,r,n,i,a,s){return u(e+(t&r|~t&n)+i+a|0,s)+t|0}function h(e,t,r,n,i,a,s){return u(e+(t&n|r&~n)+i+a|0,s)+t|0}function c(e,t,r,n,i,a,s){return u(e+(t^r^n)+i+a|0,s)+t|0}function d(e,t,r,n,i,a,s){return u(e+(r^(t|~n))+i+a|0,s)+t|0}n(o,i),o.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,a=this._d;r=l(r,n,i,a,e[0],3614090360,7),a=l(a,r,n,i,e[1],3905402710,12),i=l(i,a,r,n,e[2],606105819,17),n=l(n,i,a,r,e[3],3250441966,22),r=l(r,n,i,a,e[4],4118548399,7),a=l(a,r,n,i,e[5],1200080426,12),i=l(i,a,r,n,e[6],2821735955,17),n=l(n,i,a,r,e[7],4249261313,22),r=l(r,n,i,a,e[8],1770035416,7),a=l(a,r,n,i,e[9],2336552879,12),i=l(i,a,r,n,e[10],4294925233,17),n=l(n,i,a,r,e[11],2304563134,22),r=l(r,n,i,a,e[12],1804603682,7),a=l(a,r,n,i,e[13],4254626195,12),i=l(i,a,r,n,e[14],2792965006,17),r=h(r,n=l(n,i,a,r,e[15],1236535329,22),i,a,e[1],4129170786,5),a=h(a,r,n,i,e[6],3225465664,9),i=h(i,a,r,n,e[11],643717713,14),n=h(n,i,a,r,e[0],3921069994,20),r=h(r,n,i,a,e[5],3593408605,5),a=h(a,r,n,i,e[10],38016083,9),i=h(i,a,r,n,e[15],3634488961,14),n=h(n,i,a,r,e[4],3889429448,20),r=h(r,n,i,a,e[9],568446438,5),a=h(a,r,n,i,e[14],3275163606,9),i=h(i,a,r,n,e[3],4107603335,14),n=h(n,i,a,r,e[8],1163531501,20),r=h(r,n,i,a,e[13],2850285829,5),a=h(a,r,n,i,e[2],4243563512,9),i=h(i,a,r,n,e[7],1735328473,14),r=c(r,n=h(n,i,a,r,e[12],2368359562,20),i,a,e[5],4294588738,4),a=c(a,r,n,i,e[8],2272392833,11),i=c(i,a,r,n,e[11],1839030562,16),n=c(n,i,a,r,e[14],4259657740,23),r=c(r,n,i,a,e[1],2763975236,4),a=c(a,r,n,i,e[4],1272893353,11),i=c(i,a,r,n,e[7],4139469664,16),n=c(n,i,a,r,e[10],3200236656,23),r=c(r,n,i,a,e[13],681279174,4),a=c(a,r,n,i,e[0],3936430074,11),i=c(i,a,r,n,e[3],3572445317,16),n=c(n,i,a,r,e[6],76029189,23),r=c(r,n,i,a,e[9],3654602809,4),a=c(a,r,n,i,e[12],3873151461,11),i=c(i,a,r,n,e[15],530742520,16),r=d(r,n=c(n,i,a,r,e[2],3299628645,23),i,a,e[0],4096336452,6),a=d(a,r,n,i,e[7],1126891415,10),i=d(i,a,r,n,e[14],2878612391,15),n=d(n,i,a,r,e[5],4237533241,21),r=d(r,n,i,a,e[12],1700485571,6),a=d(a,r,n,i,e[3],2399980690,10),i=d(i,a,r,n,e[10],4293915773,15),n=d(n,i,a,r,e[1],2240044497,21),r=d(r,n,i,a,e[8],1873313359,6),a=d(a,r,n,i,e[15],4264355552,10),i=d(i,a,r,n,e[6],2734768916,15),n=d(n,i,a,r,e[13],1309151649,21),r=d(r,n,i,a,e[4],4149444226,6),a=d(a,r,n,i,e[11],3174756917,10),i=d(i,a,r,n,e[2],718787259,15),n=d(n,i,a,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+a|0},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=a.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=o},3047:(e,t,r)=>{var n=r(6240),i=r(9931);function a(e){this.rand=e||new i.Rand}e.exports=a,a.create=function(e){return new a(e)},a.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},a.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},a.prototype.test=function(e,t,r){var i=e.bitLength(),a=n.mont(e),s=new n(1).toRed(a);t||(t=Math.max(1,i/48|0));for(var o=e.subn(1),u=0;!o.testn(u);u++);for(var l=e.shrn(u),h=o.toRed(a);t>0;t--){var c=this._randrange(new n(2),o);r&&r(c);var d=c.toRed(a).redPow(l);if(0!==d.cmp(s)&&0!==d.cmp(h)){for(var f=1;f<u;f++){if(0===(d=d.redSqr()).cmp(s))return!1;if(0===d.cmp(h))break}if(f===u)return!1}}return!0},a.prototype.getDivisor=function(e,t){var r=e.bitLength(),i=n.mont(e),a=new n(1).toRed(i);t||(t=Math.max(1,r/48|0));for(var s=e.subn(1),o=0;!s.testn(o);o++);for(var u=e.shrn(o),l=s.toRed(i);t>0;t--){var h=this._randrange(new n(2),s),c=e.gcd(h);if(0!==c.cmpn(1))return c;var d=h.toRed(i).redPow(u);if(0!==d.cmp(a)&&0!==d.cmp(l)){for(var f=1;f<o;f++){if(0===(d=d.redSqr()).cmp(a))return d.fromRed().subn(1).gcd(e);if(0===d.cmp(l))break}if(f===o)return(d=d.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},6240:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6619).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function l(e,t,r,n){for(var i=0,a=Math.min(e.length,r),s=t;s<a;s++){var o=e.charCodeAt(s)-48;i*=n,i+=o>=49?o-49+10:o>=17?o-17+10:o}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,s,o=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,s=a%n,o=Math.min(a,a-s)+r,u=0,h=r;h<o;h+=n)u=l(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=l(e,h,e.length,t),h=0;h<s;h++)c*=t;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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"],c=[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],d=[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];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],s=i*a,o=67108863&s,u=s/67108864|0;r.words[0]=o;for(var l=1;l<n;l++){for(var h=u>>>26,c=67108863&u,d=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=d;f++){var p=l-f|0;h+=(s=(i=0|e.words[p])*(a=0|t.words[f])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,u=0|h}return 0!==u?r.words[l]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,s=0;s<this.length;s++){var o=this.words[s],u=(16777215&(o<<i|a)).toString(16);r=0!=(a=o>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=c[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?y+r:h[l-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var s,o,u="le"===t,l=new e(a),h=this.clone();if(u){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),l[o]=s;for(;o<a;o++)l[o]=0}else{for(o=0;o<a-i;o++)l[o]=0;for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),l[a-o-1]=s}return l},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,s=0;s<n.length;s++)a=(t=(0|r.words[s])-(0|n.words[s])+a)>>26,this.words[s]=67108863&t;for(;0!==a&&s<r.length;s++)a=(t=(0|r.words[s])+a)>>26,this.words[s]=67108863&t;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,a,s=e.words,o=t.words,u=r.words,l=0,h=0|s[0],c=8191&h,d=h>>>13,f=0|s[1],p=8191&f,y=f>>>13,m=0|s[2],b=8191&m,g=m>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],T=8191&M,E=M>>>13,A=0|s[5],x=8191&A,k=A>>>13,S=0|s[6],I=8191&S,C=S>>>13,O=0|s[7],R=8191&O,N=O>>>13,P=0|s[8],B=8191&P,D=P>>>13,L=0|s[9],F=8191&L,U=L>>>13,j=0|o[0],q=8191&j,z=j>>>13,G=0|o[1],K=8191&G,H=G>>>13,$=0|o[2],V=8191&$,W=$>>>13,Z=0|o[3],J=8191&Z,Y=Z>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,ie=0|o[6],ae=8191&ie,se=ie>>>13,oe=0|o[7],ue=8191&oe,le=oe>>>13,he=0|o[8],ce=8191&he,de=he>>>13,fe=0|o[9],pe=8191&fe,ye=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(l+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;l=((a=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(y,q)|0,a=Math.imul(y,z);var be=(l+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(d,K)|0))<<13)|0;l=((a=a+Math.imul(d,H)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(g,q)|0,a=Math.imul(g,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,H)|0;var ge=(l+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(d,V)|0))<<13)|0;l=((a=a+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,H)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,V)|0,a=a+Math.imul(y,W)|0;var ve=(l+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;l=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(E,q)|0,a=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,H)|0,n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Y)|0;var we=(l+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,a=Math.imul(k,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,H)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,W)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,ee)|0;var _e=(l+(n=n+Math.imul(c,re)|0)|0)+((8191&(i=(i=i+Math.imul(c,ne)|0)+Math.imul(d,re)|0))<<13)|0;l=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,a=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,H)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(E,V)|0,a=a+Math.imul(E,W)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0;var Me=(l+(n=n+Math.imul(c,ae)|0)|0)+((8191&(i=(i=i+Math.imul(c,se)|0)+Math.imul(d,ae)|0))<<13)|0;l=((a=a+Math.imul(d,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,z))+Math.imul(N,q)|0,a=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,H)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,V)|0,a=a+Math.imul(k,W)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,se)|0;var Te=(l+(n=n+Math.imul(c,ue)|0)|0)+((8191&(i=(i=i+Math.imul(c,le)|0)+Math.imul(d,ue)|0))<<13)|0;l=((a=a+Math.imul(d,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,H)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(C,V)|0,a=a+Math.imul(C,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(y,ue)|0,a=a+Math.imul(y,le)|0;var Ee=(l+(n=n+Math.imul(c,ce)|0)|0)+((8191&(i=(i=i+Math.imul(c,de)|0)+Math.imul(d,ce)|0))<<13)|0;l=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,z))+Math.imul(U,q)|0,a=Math.imul(U,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,H)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,V)|0,a=a+Math.imul(N,W)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Y)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,le)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,le)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,ce)|0,a=a+Math.imul(y,de)|0;var Ae=(l+(n=n+Math.imul(c,pe)|0)|0)+((8191&(i=(i=i+Math.imul(c,ye)|0)+Math.imul(d,pe)|0))<<13)|0;l=((a=a+Math.imul(d,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,K),i=(i=Math.imul(F,H))+Math.imul(U,K)|0,a=Math.imul(U,H),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,W)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Y)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,le)|0,n=n+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,de)|0;var xe=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;l=((a=a+Math.imul(y,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,V),i=(i=Math.imul(F,W))+Math.imul(U,V)|0,a=Math.imul(U,W),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Q)|0,a=a+Math.imul(N,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,le)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,ce)|0,a=a+Math.imul(_,de)|0;var ke=(l+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ye)|0)+Math.imul(g,pe)|0))<<13)|0;l=((a=a+Math.imul(g,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,J),i=(i=Math.imul(F,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,a=a+Math.imul(N,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,le)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(E,ce)|0,a=a+Math.imul(E,de)|0;var Se=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;l=((a=a+Math.imul(_,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(U,Q)|0,a=Math.imul(U,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(C,ue)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(k,ce)|0,a=a+Math.imul(k,de)|0;var Ie=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ye)|0)+Math.imul(E,pe)|0))<<13)|0;l=((a=a+Math.imul(E,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(U,re)|0,a=Math.imul(U,ne),n=n+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,se)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,le)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,de)|0;var Ce=(l+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(k,pe)|0))<<13)|0;l=((a=a+Math.imul(k,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(F,ae),i=(i=Math.imul(F,se))+Math.imul(U,ae)|0,a=Math.imul(U,se),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,le)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,ce)|0,a=a+Math.imul(N,de)|0;var Oe=(l+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(C,pe)|0))<<13)|0;l=((a=a+Math.imul(C,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,le))+Math.imul(U,ue)|0,a=Math.imul(U,le),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,de)|0;var Re=(l+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(N,pe)|0))<<13)|0;l=((a=a+Math.imul(N,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(F,ce),i=(i=Math.imul(F,de))+Math.imul(U,ce)|0,a=Math.imul(U,de);var Ne=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,ye)|0)+Math.imul(D,pe)|0))<<13)|0;l=((a=a+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Pe=(l+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,ye))+Math.imul(U,pe)|0))<<13)|0;return l=((a=Math.imul(U,ye))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=me,u[1]=be,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Te,u[8]=Ee,u[9]=Ae,u[10]=xe,u[11]=ke,u[12]=Se,u[13]=Ie,u[14]=Ce,u[15]=Oe,u[16]=Re,u[17]=Ne,u[18]=Pe,0!==l&&(u[19]=l,r.length++),r};function y(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=f),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var s=i;i=0;for(var o=67108863&n,u=Math.min(a,t.length-1),l=Math.max(0,a-e.length+1);l<=u;l++){var h=a-l,c=(0|e.words[h])*(0|t.words[l]),d=67108863&c;o=67108863&(d=d+o|0),i+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[a]=o,n=s,s=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,a){for(var s=0;s<a;s++)n[s]=t[e[s]],i[s]=r[e[s]]},m.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),h=0;h<i;h+=o)for(var c=u,d=l,f=0;f<s;f++){var p=r[h+f],y=n[h+f],m=r[h+f+s],b=n[h+f+s],g=c*m-d*b;b=c*b+d*m,m=g,r[h+f]=p+m,n[h+f]=y+b,r[h+f+s]=p-m,n[h+f+s]=y-b,f!==o&&(g=u*c-l*d,d=u*d+l*c,c=g)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var a=0,s=0;s<t;s++)a+=0|e[s],r[2*s]=8191&a,a>>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===a),n(0==(-8192&a))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),s=new Array(n),o=new Array(n),u=new Array(n),l=new Array(n),h=new Array(n),c=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,l,n),this.transform(s,a,o,u,n,i),this.transform(l,a,h,c,n,i);for(var f=0;f<n;f++){var p=o[f]*h[f]-u[f]*c[f];u[f]=o[f]*c[f]+u[f]*h[f],o[f]=p}return this.conjugate(o,u,n),this.transform(o,u,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),y(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&a,u=(0|this.words[t])-o<<r;this.words[t]=u|s,s=o>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<<a,u=r;if(i-=s,i=Math.max(0,i),u){for(var l=0;l<s;l++)u.words[l]=this.words[l];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var h=0;for(l=this.length-1;l>=0&&(0!==h||l>=i);l--){var c=0|this.words[l];this.words[l]=h<<26-a|c>>>a,h=c&o}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i,a,s=e.length+r;this._expand(s);var o=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+o;var u=(0|e.words[i])*t;o=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)o=(a=(0|this.words[i+r])+o)>>26,this.words[i+r]=67108863&a;if(0===o)return this.strip();for(n(-1===o),o=0,i=0;i<this.length;i++)o=(a=-(0|this.words[i])+o)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var o,u=n.length-i.length;if("mod"!==t){(o=new a(null)).length=u+1,o.words=new Array(o.length);for(var l=0;l<o.length;l++)o.words[l]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,o&&(o.words[u]=1));for(var c=u-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);o&&(o.words[c]=d)}return o&&o.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,o},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),s=new a(0),o=new a(0),u=new a(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var h=r.clone(),c=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(h),u.isub(c)),o.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o),s.isub(u)):(r.isub(t),o.isub(i),u.isub(s))}return{a:o,b:u,gcd:r.iushln(l)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new a(1),o=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(i=0===t.cmpn(1)?s:o).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,s=r;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new T(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}g.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|a>>>22,a=s}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,g),i(_,g),i(M,g),M.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return b[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var o=new a(1).toRed(this),u=o.redNeg(),l=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new a(2*h*h).toRed(this);0!==this.pow(h,l).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),d=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(o);){for(var y=f,m=0;0!==y.cmp(o);m++)y=y.redSqr();n(m<p);var b=this.pow(c,new a(1).iushln(p-m-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=m}return d},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,o=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],h=u-1;h>=0;h--){var c=l>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++o||0===n&&0===h)&&(i=this.mul(i,r[s]),o=0,s=0)):o=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new E(e)},i(E,T),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},9746:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},4504:(e,t)=>{var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),a=i>>8,s=255&i;a?r.push(a,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},7824:e=>{var t=1e3,r=60*t,n=60*r,i=24*n;function a(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var o,u,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(a){var s=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===l&&isFinite(e))return s.long?(o=e,(u=Math.abs(o))>=i?a(o,u,i,"day"):u>=n?a(o,u,n,"hour"):u>=r?a(o,u,r,"minute"):u>=t?a(o,u,t,"second"):o+" ms"):function(e){var a=Math.abs(e);return a>=i?Math.round(e/i)+"d":a>=n?Math.round(e/n)+"h":a>=r?Math.round(e/r)+"m":a>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},6807:(e,t,r)=>{var n=r(8764).Buffer,i=r(3208),a=r(4032),s=(r(5835),r(476).Ber,r(4087)._),o=r(4087),u=r(6160),l=r(5159);void 0===i.RSA_NO_PADDING&&(i.RSA_NO_PADDING=3),e.exports=function(){var e={node10:["md4","md5","ripemd160","sha1","sha224","sha256","sha384","sha512"],node:["md4","md5","ripemd160","sha1","sha224","sha256","sha384","sha512"],iojs:["md4","md5","ripemd160","sha1","sha224","sha256","sha384","sha512"],browser:["md5","ripemd160","sha1","sha256","sha512"]},t="pkcs1_oaep",r="pkcs1",i={private:"pkcs1-private-pem","private-der":"pkcs1-private-der",public:"pkcs8-public-pem","public-der":"pkcs8-public-der"};function h(e,i,u){if(!(this instanceof h))return new h(e,i,u);s.isObject(i)&&(u=i,i=void 0),this.$options={signingScheme:r,signingSchemeOptions:{hash:"sha256",saltLength:null},encryptionScheme:t,encryptionSchemeOptions:{hash:"sha1",label:null},environment:o.detectEnvironment(),rsaUtils:this},this.keyPair=new a.Key,this.$cache={},n.isBuffer(e)||s.isString(e)?this.importKey(e,i):s.isObject(e)&&this.generateKeyPair(e.b,e.e),this.setOptions(u)}return h.prototype.setOptions=function(n){if((n=n||{}).environment&&(this.$options.environment=n.environment),n.signingScheme){if(s.isString(n.signingScheme)){var i=n.signingScheme.toLowerCase().split("-");1==i.length?e.node.indexOf(i[0])>-1?(this.$options.signingSchemeOptions={hash:i[0]},this.$options.signingScheme=r):(this.$options.signingScheme=i[0],this.$options.signingSchemeOptions={hash:null}):(this.$options.signingSchemeOptions={hash:i[1]},this.$options.signingScheme=i[0])}else s.isObject(n.signingScheme)&&(this.$options.signingScheme=n.signingScheme.scheme||r,this.$options.signingSchemeOptions=s.omit(n.signingScheme,"scheme"));if(!u.isSignature(this.$options.signingScheme))throw Error("Unsupported signing scheme");if(this.$options.signingSchemeOptions.hash&&-1===e[this.$options.environment].indexOf(this.$options.signingSchemeOptions.hash))throw Error("Unsupported hashing algorithm for "+this.$options.environment+" environment")}if(n.encryptionScheme){if(s.isString(n.encryptionScheme)?(this.$options.encryptionScheme=n.encryptionScheme.toLowerCase(),this.$options.encryptionSchemeOptions={}):s.isObject(n.encryptionScheme)&&(this.$options.encryptionScheme=n.encryptionScheme.scheme||t,this.$options.encryptionSchemeOptions=s.omit(n.encryptionScheme,"scheme")),!u.isEncryption(this.$options.encryptionScheme))throw Error("Unsupported encryption scheme");if(this.$options.encryptionSchemeOptions.hash&&-1===e[this.$options.environment].indexOf(this.$options.encryptionSchemeOptions.hash))throw Error("Unsupported hashing algorithm for "+this.$options.environment+" environment")}this.keyPair.setOptions(this.$options)},h.prototype.generateKeyPair=function(e,t){if(t=t||65537,(e=e||2048)%8!=0)throw Error("Key size must be a multiple of 8.");return this.keyPair.generate(e,t.toString(16)),this.$cache={},this},h.prototype.importKey=function(e,t){if(!e)throw Error("Empty key given");if(t&&(t=i[t]||t),!l.detectAndImport(this.keyPair,e,t)&&void 0===t)throw Error("Key format must be specified");return this.$cache={},this},h.prototype.exportKey=function(e){return e=i[e=e||"private"]||e,this.$cache[e]||(this.$cache[e]=l.detectAndExport(this.keyPair,e)),this.$cache[e]},h.prototype.isPrivate=function(){return this.keyPair.isPrivate()},h.prototype.isPublic=function(e){return this.keyPair.isPublic(e)},h.prototype.isEmpty=function(e){return!(this.keyPair.n||this.keyPair.e||this.keyPair.d)},h.prototype.encrypt=function(e,t,r){return this.$$encryptKey(!1,e,t,r)},h.prototype.decrypt=function(e,t){return this.$$decryptKey(!1,e,t)},h.prototype.encryptPrivate=function(e,t,r){return this.$$encryptKey(!0,e,t,r)},h.prototype.decryptPublic=function(e,t){return this.$$decryptKey(!0,e,t)},h.prototype.$$encryptKey=function(e,t,r,n){try{var i=this.keyPair.encrypt(this.$getDataForEncrypt(t,n),e);return"buffer"!=r&&r?i.toString(r):i}catch(e){throw Error("Error during encryption. Original error: "+e)}},h.prototype.$$decryptKey=function(e,t,r){try{t=s.isString(t)?n.from(t,"base64"):t;var i=this.keyPair.decrypt(t,e);if(null===i)throw Error("Key decrypt method returns null.");return this.$getDecryptedData(i,r)}catch(e){throw Error("Error during decryption (probably incorrect key). Original error: "+e)}},h.prototype.sign=function(e,t,r){if(!this.isPrivate())throw Error("This is not private key");var n=this.keyPair.sign(this.$getDataForEncrypt(e,r));return t&&"buffer"!=t&&(n=n.toString(t)),n},h.prototype.verify=function(e,t,r,n){if(!this.isPublic())throw Error("This is not public key");return n=n&&"buffer"!=n?n:null,this.keyPair.verify(this.$getDataForEncrypt(e,r),t,n)},h.prototype.getKeySize=function(){return this.keyPair.keySize},h.prototype.getMaxMessageSize=function(){return this.keyPair.maxMessageLength},h.prototype.$getDataForEncrypt=function(e,t){if(s.isString(e)||s.isNumber(e))return n.from(""+e,t||"utf8");if(n.isBuffer(e))return e;if(s.isObject(e))return n.from(JSON.stringify(e));throw Error("Unexpected data type")},h.prototype.$getDecryptedData=function(e,t){return"buffer"==(t=t||"buffer")?e:"json"==t?JSON.parse(e.toString()):e.toString(t)},h}()},767:(e,t,r)=>{var n=r(5835);e.exports={getEngine:function(e,t){var i=r(6120);return"node"===t.environment&&"function"==typeof n.publicEncrypt&&"function"==typeof n.privateDecrypt&&(i="function"==typeof n.privateEncrypt&&"function"==typeof n.publicDecrypt?r(9954):r(4034)),i(e,t)}}},9954:(e,t,r)=>{var n=r(5835),i=r(3208),a=r(6160);e.exports=function(e,t){var r=a.pkcs1.makeScheme(e,t);return{encrypt:function(e,a){var s;if(a)return s=i.RSA_PKCS1_PADDING,t.encryptionSchemeOptions&&t.encryptionSchemeOptions.padding&&(s=t.encryptionSchemeOptions.padding),n.privateEncrypt({key:t.rsaUtils.exportKey("private"),padding:s},e);s=i.RSA_PKCS1_OAEP_PADDING,"pkcs1"===t.encryptionScheme&&(s=i.RSA_PKCS1_PADDING),t.encryptionSchemeOptions&&t.encryptionSchemeOptions.padding&&(s=t.encryptionSchemeOptions.padding);var o=e;return s===i.RSA_NO_PADDING&&(o=r.pkcs0pad(e)),n.publicEncrypt({key:t.rsaUtils.exportKey("public"),padding:s},o)},decrypt:function(e,a){var s;if(a)return s=i.RSA_PKCS1_PADDING,t.encryptionSchemeOptions&&t.encryptionSchemeOptions.padding&&(s=t.encryptionSchemeOptions.padding),n.publicDecrypt({key:t.rsaUtils.exportKey("public"),padding:s},e);s=i.RSA_PKCS1_OAEP_PADDING,"pkcs1"===t.encryptionScheme&&(s=i.RSA_PKCS1_PADDING),t.encryptionSchemeOptions&&t.encryptionSchemeOptions.padding&&(s=t.encryptionSchemeOptions.padding);var o=n.privateDecrypt({key:t.rsaUtils.exportKey("private"),padding:s},e);return s===i.RSA_NO_PADDING?r.pkcs0unpad(o):o}}}},6120:(e,t,r)=>{var n=r(3810),i=r(6160);e.exports=function(e,t){var r=i.pkcs1.makeScheme(e,t);return{encrypt:function(t,i){var a,s;return i?(a=new n(r.encPad(t,{type:1})),s=e.$doPrivate(a)):(a=new n(e.encryptionScheme.encPad(t)),s=e.$doPublic(a)),s.toBuffer(e.encryptedDataLength)},decrypt:function(t,i){var a,s=new n(t);return i?(a=e.$doPublic(s),r.encUnPad(a.toBuffer(e.encryptedDataLength),{type:1})):(a=e.$doPrivate(s),e.encryptionScheme.encUnPad(a.toBuffer(e.encryptedDataLength)))}}}},4034:(e,t,r)=>{var n=r(5835),i=r(3208),a=r(6160);e.exports=function(e,t){var s=r(6120)(e,t),o=a.pkcs1.makeScheme(e,t);return{encrypt:function(e,r){if(r)return s.encrypt(e,r);var a=i.RSA_PKCS1_OAEP_PADDING;"pkcs1"===t.encryptionScheme&&(a=i.RSA_PKCS1_PADDING),t.encryptionSchemeOptions&&t.encryptionSchemeOptions.padding&&(a=t.encryptionSchemeOptions.padding);var u=e;return a===i.RSA_NO_PADDING&&(u=o.pkcs0pad(e)),n.publicEncrypt({key:t.rsaUtils.exportKey("public"),padding:a},u)},decrypt:function(e,r){if(r)return s.decrypt(e,r);var a=i.RSA_PKCS1_OAEP_PADDING;"pkcs1"===t.encryptionScheme&&(a=i.RSA_PKCS1_PADDING),t.encryptionSchemeOptions&&t.encryptionSchemeOptions.padding&&(a=t.encryptionSchemeOptions.padding);var u=n.privateDecrypt({key:t.rsaUtils.exportKey("private"),padding:a},e);return a===i.RSA_NO_PADDING?o.pkcs0unpad(u):u}}}},5629:(e,t,r)=>{r(4087)._,r(4087),e.exports={privateExport:function(e,t){return{n:e.n.toBuffer(),e:e.e,d:e.d.toBuffer(),p:e.p.toBuffer(),q:e.q.toBuffer(),dmp1:e.dmp1.toBuffer(),dmq1:e.dmq1.toBuffer(),coeff:e.coeff.toBuffer()}},privateImport:function(e,t,r){if(!(t.n&&t.e&&t.d&&t.p&&t.q&&t.dmp1&&t.dmq1&&t.coeff))throw Error("Invalid key data");e.setPrivate(t.n,t.e,t.d,t.p,t.q,t.dmp1,t.dmq1,t.coeff)},publicExport:function(e,t){return{n:e.n.toBuffer(),e:e.e}},publicImport:function(e,t,r){if(!t.n||!t.e)throw Error("Invalid key data");e.setPublic(t.n,t.e)},autoImport:function(t,r){return!(!r.n||!r.e||(r.d&&r.p&&r.q&&r.dmp1&&r.dmq1&&r.coeff?(e.exports.privateImport(t,r),0):(e.exports.publicImport(t,r),0)))}}},5159:(e,t,r)=>{function n(e){e=e.split("-");for(var t="private",r={type:"default"},n=1;n<e.length;n++)if(e[n])switch(e[n]){case"public":case"private":t=e[n];break;case"pem":case"der":r.type=e[n]}return{scheme:e[0],keyType:t,keyOpt:r}}r(4087)._,e.exports={pkcs1:r(5217),pkcs8:r(5531),components:r(5629),openssh:r(3685),isPrivateExport:function(t){return e.exports[t]&&"function"==typeof e.exports[t].privateExport},isPrivateImport:function(t){return e.exports[t]&&"function"==typeof e.exports[t].privateImport},isPublicExport:function(t){return e.exports[t]&&"function"==typeof e.exports[t].publicExport},isPublicImport:function(t){return e.exports[t]&&"function"==typeof e.exports[t].publicImport},detectAndImport:function(t,r,i){if(void 0===i){for(var a in e.exports)if("function"==typeof e.exports[a].autoImport&&e.exports[a].autoImport(t,r))return!0}else if(i){var s=n(i);if(!e.exports[s.scheme])throw Error("Unsupported key format");"private"===s.keyType?e.exports[s.scheme].privateImport(t,r,s.keyOpt):e.exports[s.scheme].publicImport(t,r,s.keyOpt)}return!1},detectAndExport:function(t,r){if(r){var i=n(r);if(e.exports[i.scheme]){if("private"===i.keyType){if(!t.isPrivate())throw Error("This is not private key");return e.exports[i.scheme].privateExport(t,i.keyOpt)}if(!t.isPublic())throw Error("This is not public key");return e.exports[i.scheme].publicExport(t,i.keyOpt)}throw Error("Unsupported key format")}}}},3685:(e,t,r)=>{var n=r(8764).Buffer,i=r(4087)._,a=r(4087),s=r(3810);const o="-----BEGIN OPENSSH PRIVATE KEY-----",u="-----END OPENSSH PRIVATE KEY-----";function l(e){const t=e.buf.readInt32BE(e.off);e.off+=4;const r=e.buf.slice(e.off,e.off+t);return e.off+=t,r}function h(e,t){e.buf.writeInt32BE(t.byteLength,e.off),e.off+=4,e.off+=t.copy(e.buf,e.off)}e.exports={privateExport:function(e,t){const r=e.n.toBuffer();let i=n.alloc(4);for(i.writeUInt32BE(e.e,0);0===i[0];)i=i.slice(1);const s=e.d.toBuffer(),l=e.coeff.toBuffer(),c=e.p.toBuffer(),d=e.q.toBuffer();let f;f=void 0!==e.sshcomment?n.from(e.sshcomment):n.from([]);const p=15+i.byteLength+4+r.byteLength,y=23+r.byteLength+4+i.byteLength+4+s.byteLength+4+l.byteLength+4+c.byteLength+4+d.byteLength+4+f.byteLength;let m=43+p+4+y;m+=8*Math.ceil(y/8)-y;const b=n.alloc(m),g={buf:b,off:0};b.write("openssh-key-v1","utf8"),b.writeUInt8(0,14),g.off+=15,h(g,n.from("none")),h(g,n.from("none")),h(g,n.from("")),g.off=g.buf.writeUInt32BE(1,g.off),g.off=g.buf.writeUInt32BE(p,g.off),h(g,n.from("ssh-rsa")),h(g,i),h(g,r),g.off=g.buf.writeUInt32BE(m-47-p,g.off),g.off+=8,h(g,n.from("ssh-rsa")),h(g,r),h(g,i),h(g,s),h(g,l),h(g,c),h(g,d),h(g,f);let v=1;for(;g.off<m;)g.off=g.buf.writeUInt8(v++,g.off);return"der"===t.type?g.buf:o+"\n"+a.linebrk(b.toString("base64"),70)+"\n"+u+"\n"},privateImport:function(e,t,r){var h;if("der"!==(r=r||{}).type){if(n.isBuffer(t)&&(t=t.toString("utf8")),!i.isString(t))throw Error("Unsupported key format");var c=a.trimSurroundingText(t,o,u).replace(/\s+|\n\r|\n|\r$/gm,"");h=n.from(c,"base64")}else{if(!n.isBuffer(t))throw Error("Unsupported key format");h=t}const d={buf:h,off:0};if("openssh-key-v1"!==h.slice(0,14).toString("ascii"))throw"Invalid file format.";if(d.off+=15,"none"!==l(d).toString("ascii"))throw Error("Unsupported key type");if("none"!==l(d).toString("ascii"))throw Error("Unsupported key type");if(""!==l(d).toString("ascii"))throw Error("Unsupported key type");if(d.off+=4,d.off+=4,"ssh-rsa"!==l(d).toString("ascii"))throw Error("Unsupported key type");if(l(d),l(d),d.off+=12,"ssh-rsa"!==l(d).toString("ascii"))throw Error("Unsupported key type");const f=l(d),p=l(d),y=l(d),m=l(d),b=l(d),g=l(d),v=new s(y),w=new s(g),_=new s(b),M=v.mod(_.subtract(s.ONE)),T=v.mod(w.subtract(s.ONE));e.setPrivate(f,p,y,b,g,M.toBuffer(),T.toBuffer(),m),e.sshcomment=l(d).toString("ascii")},publicExport:function(e,t){let r=n.alloc(4);for(r.writeUInt32BE(e.e,0);0===r[0];)r=r.slice(1);const i=e.n.toBuffer(),a=n.alloc(r.byteLength+4+i.byteLength+4+"ssh-rsa".length+4),s={buf:a,off:0};h(s,n.from("ssh-rsa")),h(s,r),h(s,i);let o=e.sshcomment||"";return"der"===t.type?s.buf:"ssh-rsa "+a.toString("base64")+" "+o+"\n"},publicImport:function(e,t,r){var a;if("der"!==(r=r||{}).type){if(n.isBuffer(t)&&(t=t.toString("utf8")),!i.isString(t))throw Error("Unsupported key format");{if("ssh-rsa "!==t.substring(0,8))throw Error("Unsupported key format");let r=t.indexOf(" ",8);-1===r?r=t.length:e.sshcomment=t.substring(r+1).replace(/\s+|\n\r|\n|\r$/gm,"");const i=t.substring(8,r).replace(/\s+|\n\r|\n|\r$/gm,"");a=n.from(i,"base64")}}else{if(!n.isBuffer(t))throw Error("Unsupported key format");a=t}const s={buf:a,off:0},o=l(s).toString("ascii");if("ssh-rsa"!==o)throw Error("Invalid key type: "+o);const u=l(s),h=l(s);e.setPublic(h,u)},autoImport:function(t,r){return/^[\S\s]*-----BEGIN OPENSSH PRIVATE KEY-----\s*(?=(([A-Za-z0-9+/=]+\s*)+))\1-----END OPENSSH PRIVATE KEY-----[\S\s]*$/g.test(r)?(e.exports.privateImport(t,r),!0):!!/^[\S\s]*ssh-rsa \s*(?=(([A-Za-z0-9+/=]+\s*)+))\1[\S\s]*$/g.test(r)&&(e.exports.publicImport(t,r),!0)}}},5217:(e,t,r)=>{var n=r(8764).Buffer,i=r(476).Ber,a=r(4087)._,s=r(4087);const o="-----BEGIN RSA PRIVATE KEY-----",u="-----END RSA PRIVATE KEY-----",l="-----BEGIN RSA PUBLIC KEY-----",h="-----END RSA PUBLIC KEY-----";e.exports={privateExport:function(e,t){t=t||{};var r=e.n.toBuffer(),n=e.d.toBuffer(),a=e.p.toBuffer(),l=e.q.toBuffer(),h=e.dmp1.toBuffer(),c=e.dmq1.toBuffer(),d=e.coeff.toBuffer(),f=r.length+n.length+a.length+l.length+h.length+c.length+d.length+512,p=new i.Writer({size:f});return p.startSequence(),p.writeInt(0),p.writeBuffer(r,2),p.writeInt(e.e),p.writeBuffer(n,2),p.writeBuffer(a,2),p.writeBuffer(l,2),p.writeBuffer(h,2),p.writeBuffer(c,2),p.writeBuffer(d,2),p.endSequence(),"der"===t.type?p.buffer:o+"\n"+s.linebrk(p.buffer.toString("base64"),64)+"\n"+u},privateImport:function(e,t,r){var l;if("der"!==(r=r||{}).type){if(n.isBuffer(t)&&(t=t.toString("utf8")),!a.isString(t))throw Error("Unsupported key format");var h=s.trimSurroundingText(t,o,u).replace(/\s+|\n\r|\n|\r$/gm,"");l=n.from(h,"base64")}else{if(!n.isBuffer(t))throw Error("Unsupported key format");l=t}var c=new i.Reader(l);c.readSequence(),c.readString(2,!0),e.setPrivate(c.readString(2,!0),c.readString(2,!0),c.readString(2,!0),c.readString(2,!0),c.readString(2,!0),c.readString(2,!0),c.readString(2,!0),c.readString(2,!0))},publicExport:function(e,t){t=t||{};var r=e.n.toBuffer(),n=r.length+512,a=new i.Writer({size:n});return a.startSequence(),a.writeBuffer(r,2),a.writeInt(e.e),a.endSequence(),"der"===t.type?a.buffer:l+"\n"+s.linebrk(a.buffer.toString("base64"),64)+"\n"+h},publicImport:function(e,t,r){var o;if("der"!==(r=r||{}).type){if(n.isBuffer(t)&&(t=t.toString("utf8")),a.isString(t)){var u=s.trimSurroundingText(t,l,h).replace(/\s+|\n\r|\n|\r$/gm,"");o=n.from(u,"base64")}}else{if(!n.isBuffer(t))throw Error("Unsupported key format");o=t}var c=new i.Reader(o);c.readSequence(),e.setPublic(c.readString(2,!0),c.readString(2,!0))},autoImport:function(t,r){return/^[\S\s]*-----BEGIN RSA PRIVATE KEY-----\s*(?=(([A-Za-z0-9+/=]+\s*)+))\1-----END RSA PRIVATE KEY-----[\S\s]*$/g.test(r)?(e.exports.privateImport(t,r),!0):!!/^[\S\s]*-----BEGIN RSA PUBLIC KEY-----\s*(?=(([A-Za-z0-9+/=]+\s*)+))\1-----END RSA PUBLIC KEY-----[\S\s]*$/g.test(r)&&(e.exports.publicImport(t,r),!0)}}},5531:(e,t,r)=>{var n=r(8764).Buffer,i=r(476).Ber,a=r(4087)._,s="1.2.840.113549.1.1.1",o=r(4087);const u="-----BEGIN PRIVATE KEY-----",l="-----END PRIVATE KEY-----",h="-----BEGIN PUBLIC KEY-----",c="-----END PUBLIC KEY-----";e.exports={privateExport:function(e,t){t=t||{};var r=e.n.toBuffer(),n=e.d.toBuffer(),a=e.p.toBuffer(),h=e.q.toBuffer(),c=e.dmp1.toBuffer(),d=e.dmq1.toBuffer(),f=e.coeff.toBuffer(),p=r.length+n.length+a.length+h.length+c.length+d.length+f.length+512,y=new i.Writer({size:p});y.startSequence(),y.writeInt(0),y.writeBuffer(r,2),y.writeInt(e.e),y.writeBuffer(n,2),y.writeBuffer(a,2),y.writeBuffer(h,2),y.writeBuffer(c,2),y.writeBuffer(d,2),y.writeBuffer(f,2),y.endSequence();var m=new i.Writer({size:p});return m.startSequence(),m.writeInt(0),m.startSequence(),m.writeOID(s),m.writeNull(),m.endSequence(),m.writeBuffer(y.buffer,4),m.endSequence(),"der"===t.type?m.buffer:u+"\n"+o.linebrk(m.buffer.toString("base64"),64)+"\n"+l},privateImport:function(e,t,r){var h;if("der"!==(r=r||{}).type){if(n.isBuffer(t)&&(t=t.toString("utf8")),!a.isString(t))throw Error("Unsupported key format");var c=o.trimSurroundingText(t,u,l).replace("-----END PRIVATE KEY-----","").replace(/\s+|\n\r|\n|\r$/gm,"");h=n.from(c,"base64")}else{if(!n.isBuffer(t))throw Error("Unsupported key format");h=t}var d=new i.Reader(h);if(d.readSequence(),d.readInt(0),new i.Reader(d.readString(48,!0)).readOID(6,!0)!==s)throw Error("Invalid Public key format");var f=new i.Reader(d.readString(4,!0));f.readSequence(),f.readString(2,!0),e.setPrivate(f.readString(2,!0),f.readString(2,!0),f.readString(2,!0),f.readString(2,!0),f.readString(2,!0),f.readString(2,!0),f.readString(2,!0),f.readString(2,!0))},publicExport:function(e,t){t=t||{};var r=e.n.toBuffer(),n=r.length+512,a=new i.Writer({size:n});a.writeByte(0),a.startSequence(),a.writeBuffer(r,2),a.writeInt(e.e),a.endSequence();var u=new i.Writer({size:n});return u.startSequence(),u.startSequence(),u.writeOID(s),u.writeNull(),u.endSequence(),u.writeBuffer(a.buffer,3),u.endSequence(),"der"===t.type?u.buffer:h+"\n"+o.linebrk(u.buffer.toString("base64"),64)+"\n"+c},publicImport:function(e,t,r){var u;if("der"!==(r=r||{}).type){if(n.isBuffer(t)&&(t=t.toString("utf8")),a.isString(t)){var l=o.trimSurroundingText(t,h,c).replace(/\s+|\n\r|\n|\r$/gm,"");u=n.from(l,"base64")}}else{if(!n.isBuffer(t))throw Error("Unsupported key format");u=t}var d=new i.Reader(u);if(d.readSequence(),new i.Reader(d.readString(48,!0)).readOID(6,!0)!==s)throw Error("Invalid Public key format");var f=new i.Reader(d.readString(3,!0));f.readByte(),f.readSequence(),e.setPublic(f.readString(2,!0),f.readString(2,!0))},autoImport:function(t,r){return/^[\S\s]*-----BEGIN PRIVATE KEY-----\s*(?=(([A-Za-z0-9+/=]+\s*)+))\1-----END PRIVATE KEY-----[\S\s]*$/g.test(r)?(e.exports.privateImport(t,r),!0):!!/^[\S\s]*-----BEGIN PUBLIC KEY-----\s*(?=(([A-Za-z0-9+/=]+\s*)+))\1-----END PUBLIC KEY-----[\S\s]*$/g.test(r)&&(e.exports.publicImport(t,r),!0)}}},3810:(e,t,r)=>{var n=r(8764).Buffer,i=r(5835),a=r(4087)._;function s(e,t){null!=e&&("number"==typeof e?this.fromNumber(e,t):n.isBuffer(e)?this.fromBuffer(e):null==t&&"string"!=typeof e?this.fromByteArray(e):this.fromString(e,t))}function o(){return new s(null)}s.prototype.am=function(e,t,r,n,i,a){for(var s=16383&t,o=t>>14;--a>=0;){var u=16383&this[e],l=this[e++]>>14,h=o*u+l*s;i=((u=s*u+((16383&h)<<14)+r[n]+i)>>28)+(h>>14)+o*l,r[n++]=268435455&u}return i},s.prototype.DB=28,s.prototype.DM=268435455,s.prototype.DV=1<<28,s.prototype.FV=Math.pow(2,52),s.prototype.F1=24,s.prototype.F2=4;var u,l,h=new Array;for(u="0".charCodeAt(0),l=0;l<=9;++l)h[u++]=l;for(u="a".charCodeAt(0),l=10;l<36;++l)h[u++]=l;for(u="A".charCodeAt(0),l=10;l<36;++l)h[u++]=l;function c(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function d(e,t){var r=h[e.charCodeAt(t)];return null==r?-1:r}function f(e){var t=o();return t.fromInt(e),t}function p(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function m(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function b(e,t){return e&t}function g(e,t){return e|t}function v(e,t){return e^t}function w(e,t){return e&~t}function _(e){if(0===e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function M(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function T(){}function E(e){return e}function A(e){this.r2=o(),this.q3=o(),s.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},m.prototype.convert=function(e){var t=o();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(s.ZERO)>0&&this.m.subTo(t,t),t},m.prototype.revert=function(e){var t=o();return e.copyTo(t),this.reduce(t),t},m.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},m.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},m.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},T.prototype.convert=E,T.prototype.revert=E,T.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},T.prototype.sqrTo=function(e,t){e.squareTo(t)},A.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=o();return e.copyTo(t),this.reduce(t),t},A.prototype.revert=function(e){return e},A.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},A.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var x=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],k=(1<<26)/x[x.length-1];s.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},s.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+DV:this.t=0},s.prototype.fromString=function(e,t,r){var n;switch(t){case 2:n=1;break;case 4:n=2;break;case 8:n=3;break;case 16:n=4;break;case 32:n=5;break;case 256:n=8;break;default:return void this.fromRadix(e,t)}this.t=0,this.s=0;for(var i=e.length,a=!1,o=0;--i>=0;){var u=8==n?255&e[i]:d(e,i);u<0?"-"==e.charAt(i)&&(a=!0):(a=!1,0===o?this[this.t++]=u:o+n>this.DB?(this[this.t-1]|=(u&(1<<this.DB-o)-1)<<o,this[this.t++]=u>>this.DB-o):this[this.t-1]|=u<<o,(o+=n)>=this.DB&&(o-=this.DB))}r||8!=n||0==(128&e[0])||(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),a&&s.ZERO.subTo(this,this)},s.prototype.fromByteArray=function(e,t){this.fromString(e,256,t)},s.prototype.fromBuffer=function(e){this.fromString(e,256,!0)},s.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},s.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},s.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},s.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,a=(1<<i)-1,s=Math.floor(e/this.DB),o=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t[r+s+1]=this[r]>>i|o,o=(this[r]&a)<<n;for(r=s-1;r>=0;--r)t[r]=0;t[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},s.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)t[s-r-1]|=(this[s]&a)<<i,t[s-r]=this[s]>>n;n>0&&(t[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},s.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},s.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+r.t]=r.am(0,n[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&s.ZERO.subTo(t,t)},s.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},s.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=o());var a=o(),u=this.s,l=e.s,h=this.DB-p(n[n.t-1]);h>0?(n.lShiftTo(h,a),i.lShiftTo(h,r)):(n.copyTo(a),i.copyTo(r));var c=a.t,d=a[c-1];if(0!==d){var f=d*(1<<this.F1)+(c>1?a[c-2]>>this.F2:0),y=this.FV/f,m=(1<<this.F1)/f,b=1<<this.F2,g=r.t,v=g-c,w=null==t?o():t;for(a.dlShiftTo(v,w),r.compareTo(w)>=0&&(r[r.t++]=1,r.subTo(w,r)),s.ONE.dlShiftTo(c,w),w.subTo(a,a);a.t<c;)a[a.t++]=0;for(;--v>=0;){var _=r[--g]==d?this.DM:Math.floor(r[g]*y+(r[g-1]+b)*m);if((r[g]+=a.am(0,_,r,v,0,c))<_)for(a.dlShiftTo(v,w),r.subTo(w,r);r[g]<--_;)r.subTo(w,r)}null!=t&&(r.drShiftTo(c,t),u!=l&&s.ZERO.subTo(t,t)),r.t=c,r.clamp(),h>0&&r.rShiftTo(h,r),u<0&&s.ZERO.subTo(r,r)}}},s.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},s.prototype.isEven=function(){return 0===(this.t>0?1&this[0]:this.s)},s.prototype.exp=function(e,t){if(e>4294967295||e<1)return s.ONE;var r=o(),n=o(),i=t.convert(this),a=p(e)-1;for(i.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},s.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},s.prototype.toRadix=function(e){if(null==e&&(e=10),0===this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=f(r),i=o(),a=o(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(e)+s},s.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,a=0,o=0,u=0;u<e.length;++u){var l=d(e,u);l<0?"-"==e.charAt(u)&&0===this.signum()&&(i=!0):(o=t*o+l,++a>=r&&(this.dMultiply(n),this.dAddOffset(o,0),a=0,o=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(o,0)),i&&s.ZERO.subTo(this,this)},s.prototype.fromNumber=function(e,t){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e),this.testBit(e-1)||this.bitwiseTo(s.ONE.shiftLeft(e-1),g,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(s.ONE.shiftLeft(e-1),this);else{var r=i.randomBytes(1+(e>>3)),n=7&e;n>0?r[0]&=(1<<n)-1:r[0]=0,this.fromByteArray(r)}},s.prototype.bitwiseTo=function(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},s.prototype.changeBit=function(e,t){var r=s.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},s.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},s.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},s.prototype.dAddOffset=function(e,t){if(0!==e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},s.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,e[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e[i],r,i,0,t-i);r.clamp()},s.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},s.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0===t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},s.prototype.millerRabin=function(e){var t=this.subtract(s.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);(e=e+1>>1)>x.length&&(e=x.length);for(var i=o(),a=0;a<e;++a){i.fromInt(x[Math.floor(Math.random()*x.length)]);var u=i.modPow(n,this);if(0!=u.compareTo(s.ONE)&&0!=u.compareTo(t)){for(var l=1;l++<r&&0!=u.compareTo(t);)if(0===(u=u.modPowInt(2,this)).compareTo(s.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0},s.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,a="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this[s]>>o)>0&&(i=!0,a=c(r));s>=0;)o<t?(r=(this[s]&(1<<o)-1)<<t-o,r|=this[--s]>>(o+=this.DB-t)):(r=this[s]>>(o-=t)&n,o<=0&&(o+=this.DB,--s)),r>0&&(i=!0),i&&(a+=c(r));return i?a:"0"},s.prototype.negate=function(){var e=o();return s.ZERO.subTo(this,e),e},s.prototype.abs=function(){return this.s<0?this.negate():this},s.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},s.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this[this.t-1]^this.s&this.DM)},s.prototype.mod=function(e){var t=o();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(s.ZERO)>0&&e.subTo(t,t),t},s.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new m(t),this.exp(e,r)},s.prototype.clone=function(){var e=o();return this.copyTo(e),e},s.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0===this.t)return-1}else{if(1==this.t)return this[0];if(0===this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},s.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},s.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},s.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},s.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0===i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},s.prototype.toBuffer=function(e){var t=n.from(this.toByteArray());if(!0===e&&0===t[0])t=t.slice(1);else if(a.isNumber(e)){if(t.length>e){for(var r=0;r<t.length-e;r++)if(0!==t[r])return null;return t.slice(t.length-e)}if(t.length<e){var i=n.alloc(e);return i.fill(0,0,e-t.length),t.copy(i,e-t.length),i}}return t},s.prototype.equals=function(e){return 0==this.compareTo(e)},s.prototype.min=function(e){return this.compareTo(e)<0?this:e},s.prototype.max=function(e){return this.compareTo(e)>0?this:e},s.prototype.and=function(e){var t=o();return this.bitwiseTo(e,b,t),t},s.prototype.or=function(e){var t=o();return this.bitwiseTo(e,g,t),t},s.prototype.xor=function(e){var t=o();return this.bitwiseTo(e,v,t),t},s.prototype.andNot=function(e){var t=o();return this.bitwiseTo(e,w,t),t},s.prototype.not=function(){for(var e=o(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},s.prototype.shiftLeft=function(e){var t=o();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},s.prototype.shiftRight=function(e){var t=o();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},s.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+_(this[e]);return this.s<0?this.t*this.DB:-1},s.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=M(this[r]^t);return e},s.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},s.prototype.setBit=function(e){return this.changeBit(e,g)},s.prototype.clearBit=function(e){return this.changeBit(e,w)},s.prototype.flipBit=function(e){return this.changeBit(e,v)},s.prototype.add=function(e){var t=o();return this.addTo(e,t),t},s.prototype.subtract=function(e){var t=o();return this.subTo(e,t),t},s.prototype.multiply=function(e){var t=o();return this.multiplyTo(e,t),t},s.prototype.divide=function(e){var t=o();return this.divRemTo(e,t,null),t},s.prototype.remainder=function(e){var t=o();return this.divRemTo(e,null,t),t},s.prototype.divideAndRemainder=function(e){var t=o(),r=o();return this.divRemTo(e,t,r),new Array(t,r)},s.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=f(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new y(t):t.isEven()?new A(t):new m(t);var s=new Array,u=3,l=r-1,h=(1<<r)-1;if(s[1]=n.convert(this),r>1){var c=o();for(n.sqrTo(s[1],c);u<=h;)s[u]=o(),n.mulTo(c,s[u-2],s[u]),u+=2}var d,b,g=e.t-1,v=!0,w=o();for(i=p(e[g])-1;g>=0;){for(i>=l?d=e[g]>>i-l&h:(d=(e[g]&(1<<i+1)-1)<<l-i,g>0&&(d|=e[g-1]>>this.DB+i-l)),u=r;0==(1&d);)d>>=1,--u;if((i-=u)<0&&(i+=this.DB,--g),v)s[d].copyTo(a),v=!1;else{for(;u>1;)n.sqrTo(a,w),n.sqrTo(w,a),u-=2;u>0?n.sqrTo(a,w):(b=a,a=w,w=b),n.mulTo(w,s[d],a)}for(;g>=0&&0==(e[g]&1<<i);)n.sqrTo(a,w),b=a,a=w,w=b,--i<0&&(i=this.DB-1,--g)}return n.revert(a)},s.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0===e.signum())return s.ZERO;for(var r=e.clone(),n=this.clone(),i=f(1),a=f(0),o=f(0),u=f(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?(o.isEven()&&u.isEven()||(o.addTo(this,o),u.subTo(e,u)),o.rShiftTo(1,o)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(o,i),a.subTo(u,a)):(n.subTo(r,n),t&&o.subTo(i,o),u.subTo(a,u))}return 0!=n.compareTo(s.ONE)?s.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},s.prototype.pow=function(e){return this.exp(e,new T)},s.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},s.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=x[x.length-1]){for(t=0;t<x.length;++t)if(r[0]==x[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<x.length;){for(var n=x[t],i=t+1;i<x.length&&n<k;)n*=x[i++];for(n=r.modInt(n);t<i;)if(n%x[t++]==0)return!1}return r.millerRabin(e)},s.int2char=c,s.ZERO=f(0),s.ONE=f(1),s.prototype.square=function(){var e=o();return this.squareTo(e),e},e.exports=s},4032:(e,t,r)=>{var n=r(8764).Buffer,i=r(4087)._,a=(r(5835),r(3810)),s=r(4087),o=r(6160),u=r(767);t.BigInteger=a,e.exports.Key=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.setOptions=function(e){var t=o[e.signingScheme],r=o[e.encryptionScheme];t===r?this.signingScheme=this.encryptionScheme=r.makeScheme(this,e):(this.encryptionScheme=r.makeScheme(this,e),this.signingScheme=t.makeScheme(this,e)),this.encryptEngine=u.getEngine(this,e)},e.prototype.generate=function(e,t){var r=e>>1;this.e=parseInt(t,16);for(var n=new a(t,16);;){for(;this.p=new a(e-r,1),0!==this.p.subtract(a.ONE).gcd(n).compareTo(a.ONE)||!this.p.isProbablePrime(10););for(;this.q=new a(r,1),0!==this.q.subtract(a.ONE).gcd(n).compareTo(a.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var i=this.p;this.p=this.q,this.q=i}var s=this.p.subtract(a.ONE),o=this.q.subtract(a.ONE),u=s.multiply(o);if(0===u.gcd(n).compareTo(a.ONE)){if(this.n=this.p.multiply(this.q),this.n.bitLength()<e)continue;this.d=n.modInverse(u),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(o),this.coeff=this.q.modInverse(this.p);break}}this.$$recalculateCache()},e.prototype.setPrivate=function(e,t,r,n,o,u,l,h){if(!(e&&t&&r&&e.length>0&&(i.isNumber(t)||t.length>0)&&r.length>0))throw Error("Invalid RSA private key");this.n=new a(e),this.e=i.isNumber(t)?t:s.get32IntFromBuffer(t,0),this.d=new a(r),n&&o&&u&&l&&h&&(this.p=new a(n),this.q=new a(o),this.dmp1=new a(u),this.dmq1=new a(l),this.coeff=new a(h)),this.$$recalculateCache()},e.prototype.setPublic=function(e,t){if(!(e&&t&&e.length>0&&(i.isNumber(t)||t.length>0)))throw Error("Invalid RSA public key");this.n=new a(e),this.e=i.isNumber(t)?t:s.get32IntFromBuffer(t,0),this.$$recalculateCache()},e.prototype.$doPrivate=function(e){if(this.p||this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),r=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(r)<0;)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},e.prototype.$doPublic=function(e){return e.modPowInt(this.e,this.n)},e.prototype.encrypt=function(e,t){var r=[],i=[],a=e.length,s=Math.ceil(a/this.maxMessageLength)||1,o=Math.ceil(a/s||1);if(1==s)r.push(e);else for(var u=0;u<s;u++)r.push(e.slice(u*o,(u+1)*o));for(var l=0;l<r.length;l++)i.push(this.encryptEngine.encrypt(r[l],t));return n.concat(i)},e.prototype.decrypt=function(e,t){if(e.length%this.encryptedDataLength>0)throw Error("Incorrect data or key");for(var r=[],i=0,a=0,s=e.length/this.encryptedDataLength,o=0;o<s;o++)a=(i=o*this.encryptedDataLength)+this.encryptedDataLength,r.push(this.encryptEngine.decrypt(e.slice(i,Math.min(a,e.length)),t));return n.concat(r)},e.prototype.sign=function(e){return this.signingScheme.sign.apply(this.signingScheme,arguments)},e.prototype.verify=function(e,t,r){return this.signingScheme.verify.apply(this.signingScheme,arguments)},e.prototype.isPrivate=function(){return!!(this.n&&this.e&&this.d)},e.prototype.isPublic=function(e){return this.n&&this.e&&!(e&&this.d)||!1},Object.defineProperty(e.prototype,"keySize",{get:function(){return this.cache.keyBitLength}}),Object.defineProperty(e.prototype,"encryptedDataLength",{get:function(){return this.cache.keyByteLength}}),Object.defineProperty(e.prototype,"maxMessageLength",{get:function(){return this.encryptionScheme.maxMessageLength()}}),e.prototype.$$recalculateCache=function(){this.cache=this.cache||{},this.cache.keyBitLength=this.n.bitLength(),this.cache.keyByteLength=this.cache.keyBitLength+6>>3},e}()},5218:(e,t,r)=>{var n=r(8764).Buffer,i=(r(3810),r(5835));e.exports={isEncryption:!0,isSignature:!1},e.exports.digestLength={md4:16,md5:16,ripemd160:20,rmd160:20,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64};var a="sha1";e.exports.eme_oaep_mgf1=function(t,r,s){s=s||a;for(var o=e.exports.digestLength[s],u=Math.ceil(r/o),l=n.alloc(o*u),h=n.alloc(4),c=0;c<u;++c){var d=i.createHash(s);d.update(t),h.writeUInt32BE(c,0),d.update(h),d.digest().copy(l,c*o)}return l.slice(0,r)},e.exports.makeScheme=function(t,r){function s(e,t){this.key=e,this.options=t}return s.prototype.maxMessageLength=function(){return this.key.encryptedDataLength-2*e.exports.digestLength[this.options.encryptionSchemeOptions.hash||a]-2},s.prototype.encPad=function(t){var r=this.options.encryptionSchemeOptions.hash||a,s=this.options.encryptionSchemeOptions.mgf||e.exports.eme_oaep_mgf1,o=this.options.encryptionSchemeOptions.label||n.alloc(0),u=this.key.encryptedDataLength,l=e.exports.digestLength[r];if(t.length>u-2*l-2)throw new Error("Message is too long to encode into an encoded message with a length of "+u+" bytes, increaseemLen to fix this error (minimum value for given parameters and options: "+(u-2*l-2)+")");var h=i.createHash(r);h.update(o),h=h.digest();var c=n.alloc(u-t.length-2*l-1);c.fill(0),c[c.length-1]=1;for(var d=n.concat([h,c,t]),f=i.randomBytes(l),p=s(f,d.length,r),y=0;y<d.length;y++)d[y]^=p[y];for(p=s(d,l,r),y=0;y<f.length;y++)f[y]^=p[y];var m=n.alloc(1+f.length+d.length);return m[0]=0,f.copy(m,1),d.copy(m,1+f.length),m},s.prototype.encUnPad=function(t){var r=this.options.encryptionSchemeOptions.hash||a,s=this.options.encryptionSchemeOptions.mgf||e.exports.eme_oaep_mgf1,o=this.options.encryptionSchemeOptions.label||n.alloc(0),u=e.exports.digestLength[r];if(t.length<2*u+2)throw new Error("Error decoding message, the supplied message is not long enough to be a valid OAEP encoded message");for(var l=t.slice(1,u+1),h=t.slice(1+u),c=s(h,u,r),d=0;d<l.length;d++)l[d]^=c[d];for(c=s(l,h.length,r),d=0;d<h.length;d++)h[d]^=c[d];var f=i.createHash(r);if(f.update(o),f=f.digest(),h.slice(0,u).toString("hex")!=f.toString("hex"))throw new Error("Error decoding message, the lHash calculated from the label provided and the lHash in the encrypted data do not match.");for(d=u;0===h[d++]&&d<h.length;);if(1!=h[d-1])throw new Error("Error decoding message, there is no padding message separator byte");return h.slice(d)},new s(t,r)}},3373:(e,t,r)=>{var n=r(8764).Buffer,i=r(3810),a=r(5835),s=r(3208),o={md2:n.from("3020300c06082a864886f70d020205000410","hex"),md5:n.from("3020300c06082a864886f70d020505000410","hex"),sha1:n.from("3021300906052b0e03021a05000414","hex"),sha224:n.from("302d300d06096086480165030402040500041c","hex"),sha256:n.from("3031300d060960864801650304020105000420","hex"),sha384:n.from("3041300d060960864801650304020205000430","hex"),sha512:n.from("3051300d060960864801650304020305000440","hex"),ripemd160:n.from("3021300906052b2403020105000414","hex"),rmd160:n.from("3021300906052b2403020105000414","hex")},u={ripemd160:"rmd160"},l="sha256";e.exports={isEncryption:!0,isSignature:!0},e.exports.makeScheme=function(e,t){function r(e,t){this.key=e,this.options=t}return r.prototype.maxMessageLength=function(){return this.options.encryptionSchemeOptions&&this.options.encryptionSchemeOptions.padding==s.RSA_NO_PADDING?this.key.encryptedDataLength:this.key.encryptedDataLength-11},r.prototype.encPad=function(e,t){var r;if(t=t||{},e.length>this.key.maxMessageLength)throw new Error("Message too long for RSA (n="+this.key.encryptedDataLength+", l="+e.length+")");if(this.options.encryptionSchemeOptions&&this.options.encryptionSchemeOptions.padding==s.RSA_NO_PADDING)return(r=n.alloc(this.key.maxMessageLength-e.length)).fill(0),n.concat([r,e]);if(1===t.type)return(r=n.alloc(this.key.encryptedDataLength-e.length-1)).fill(255,0,r.length-1),r[0]=1,r[r.length-1]=0,n.concat([r,e]);(r=n.alloc(this.key.encryptedDataLength-e.length))[0]=0,r[1]=2;for(var i=a.randomBytes(r.length-3),o=0;o<i.length;o++){for(var u=i[o];0===u;)u=a.randomBytes(1)[0];r[o+2]=u}return r[r.length-1]=0,n.concat([r,e])},r.prototype.encUnPad=function(e,t){t=t||{};var r=0;if(this.options.encryptionSchemeOptions&&this.options.encryptionSchemeOptions.padding==s.RSA_NO_PADDING)return"function"==typeof e.lastIndexOf?e.slice(e.lastIndexOf("\0")+1,e.length):e.slice(String.prototype.lastIndexOf.call(e,"\0")+1,e.length);if(e.length<4)return null;if(1===t.type){if(0!==e[0]||1!==e[1])return null;for(r=3;0!==e[r];)if(255!=e[r]||++r>=e.length)return null}else{if(0!==e[0]||2!==e[1])return null;for(r=3;0!==e[r];)if(++r>=e.length)return null}return e.slice(r+1,e.length)},r.prototype.sign=function(e){var t=this.options.signingSchemeOptions.hash||l;if("browser"===this.options.environment){t=u[t]||t;var r=a.createHash(t);r.update(e);var n=this.pkcs1pad(r.digest(),t);return this.key.$doPrivate(new i(n)).toBuffer(this.key.encryptedDataLength)}var s=a.createSign("RSA-"+t.toUpperCase());return s.update(e),s.sign(this.options.rsaUtils.exportKey("private"))},r.prototype.verify=function(e,t,r){if(this.options.encryptionSchemeOptions&&this.options.encryptionSchemeOptions.padding==s.RSA_NO_PADDING)return!1;var o=this.options.signingSchemeOptions.hash||l;if("browser"===this.options.environment){o=u[o]||o,r&&(t=n.from(t,r));var h=a.createHash(o);h.update(e);var c=this.pkcs1pad(h.digest(),o);return this.key.$doPublic(new i(t)).toBuffer().toString("hex")==c.toString("hex")}var d=a.createVerify("RSA-"+o.toUpperCase());return d.update(e),d.verify(this.options.rsaUtils.exportKey("public"),t,r)},r.prototype.pkcs0pad=function(e){var t=n.alloc(this.key.maxMessageLength-e.length);return t.fill(0),n.concat([t,e])},r.prototype.pkcs0unpad=function(e){return"function"==typeof e.lastIndexOf?e.slice(e.lastIndexOf("\0")+1,e.length):e.slice(String.prototype.lastIndexOf.call(e,"\0")+1,e.length)},r.prototype.pkcs1pad=function(e,t){var r=o[t];if(!r)throw Error("Unsupported hash algorithm");var i=n.concat([r,e]);if(i.length+10>this.key.encryptedDataLength)throw Error("Key is too short for signing algorithm ("+t+")");var a=n.alloc(this.key.encryptedDataLength-i.length-1);return a.fill(255,0,a.length-1),a[0]=1,a[a.length-1]=0,n.concat([a,i])},new r(e,t)}},6256:(e,t,r)=>{var n=r(8764).Buffer,i=r(3810),a=r(5835);e.exports={isEncryption:!1,isSignature:!0};var s="sha1";e.exports.makeScheme=function(e,t){var o=r(6160).pkcs1_oaep;function u(e,t){this.key=e,this.options=t}return u.prototype.sign=function(e){var t=a.createHash(this.options.signingSchemeOptions.hash||s);t.update(e);var r=this.emsa_pss_encode(t.digest(),this.key.keySize-1);return this.key.$doPrivate(new i(r)).toBuffer(this.key.encryptedDataLength)},u.prototype.verify=function(e,t,r){r&&(t=n.from(t,r)),t=new i(t);var o=Math.ceil((this.key.keySize-1)/8),u=this.key.$doPublic(t).toBuffer(o),l=a.createHash(this.options.signingSchemeOptions.hash||s);return l.update(e),this.emsa_pss_verify(l.digest(),u,this.key.keySize-1)},u.prototype.emsa_pss_encode=function(e,t){var r=this.options.signingSchemeOptions.hash||s,i=this.options.signingSchemeOptions.mgf||o.eme_oaep_mgf1,u=this.options.signingSchemeOptions.saltLength||20,l=o.digestLength[r],h=Math.ceil(t/8);if(h<l+u+2)throw new Error("Output length passed to emBits("+t+") is too small for the options specified("+r+", "+u+"). To fix this issue increase the value of emBits. (minimum size: "+(8*l+8*u+9)+")");var c=a.randomBytes(u),d=n.alloc(8+l+u);d.fill(0,0,8),e.copy(d,8),c.copy(d,8+e.length);var f=a.createHash(r);f.update(d),f=f.digest();var p=n.alloc(h-c.length-l-2);p.fill(0);var y=n.alloc(p.length+1+c.length);p.copy(y),y[p.length]=1,c.copy(y,p.length+1);for(var m=i(f,y.length,r),b=n.alloc(y.length),g=0;g<m.length;g++)b[g]=y[g]^m[g];var v=8*h-t,w=255^255>>8-v<<8-v;b[0]=b[0]&w;var _=n.alloc(b.length+f.length+1);return b.copy(_,0),f.copy(_,b.length),_[_.length-1]=188,_},u.prototype.emsa_pss_verify=function(e,t,r){var i=this.options.signingSchemeOptions.hash||s,u=this.options.signingSchemeOptions.mgf||o.eme_oaep_mgf1,l=this.options.signingSchemeOptions.saltLength||20,h=o.digestLength[i],c=Math.ceil(r/8);if(c<h+l+2||188!=t[t.length-1])return!1;var d=n.alloc(c-h-1);t.copy(d,0,0,c-h-1);for(var f=0,p=0,y=8*c-r;p<y;p++)f|=1<<7-p;if(0!=(d[0]&f))return!1;var m=t.slice(c-h-1,c-1),b=u(m,d.length,i);for(p=0;p<d.length;p++)d[p]^=b[p];for(f=255^255>>8-(y=8*c-r)<<8-y,d[0]=d[0]&f,p=0;0===d[p]&&p<d.length;p++);if(1!=d[p])return!1;var g=d.slice(d.length-l),v=n.alloc(8+h+l);v.fill(0,0,8),e.copy(v,8),g.copy(v,8+e.length);var w=a.createHash(i);return w.update(v),w=w.digest(),m.toString("hex")===w.toString("hex")},new u(e,t)}},6160:(e,t,r)=>{e.exports={pkcs1:r(3373),pkcs1_oaep:r(5218),pss:r(6256),isEncryption:function(t){return e.exports[t]&&e.exports[t].isEncryption},isSignature:function(t){return e.exports[t]&&e.exports[t].isSignature}}},4087:(e,t,r)=>{var n=r(4155);r(5835),e.exports.linebrk=function(e,t){for(var r="",n=0;n+t<e.length;)r+=e.substring(n,n+t)+"\n",n+=t;return r+e.substring(n,e.length)},e.exports.detectEnvironment=function(){return"undefined"==typeof window||!window||n&&"node"===n.title?"node":"browser"},e.exports.get32IntFromBuffer=function(e,t){var r;if(t=t||0,(r=e.length-t)>0){if(r>=4)return e.readUIntBE(t,r);for(var n=0,i=t+r,a=0;i>t;i--,a+=2)n+=e[i-1]*Math.pow(16,a);return n}return NaN},e.exports._={isObject:function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)},isString:function(e){return"string"==typeof e||e instanceof String},isNumber:function(e){return"number"==typeof e||!isNaN(parseFloat(e))&&isFinite(e)},omit:function(e,t){var r={};for(var n in e)e.hasOwnProperty(n)&&n!==t&&(r[n]=e[n]);return r}},e.exports.trimSurroundingText=function(e,t,r){var n=0,i=e.length,a=e.indexOf(t);a>=0&&(n=a+t.length);var s=e.indexOf(r,a);return s>=0&&(i=s),e.substring(n,i)}},4244:e=>{var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},609:(e,t,r)=>{var n=r(4289),i=r(5559),a=r(4244),s=r(5624),o=r(2281),u=i(s(),Object);n(u,{getPolyfill:s,implementation:a,shim:o}),e.exports=u},5624:(e,t,r)=>{var n=r(4244);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},2281:(e,t,r)=>{var n=r(5624),i=r(4289);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8987:(e,t,r)=>{var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,s=r(1414),o=Object.prototype.propertyIsEnumerable,u=!o.call({toString:null},"toString"),l=o.call((function(){}),"prototype"),h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{c(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===a.call(e),n=s(e),o=t&&"[object String]"===a.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=l&&r;if(o&&e.length>0&&!i.call(e,0))for(var y=0;y<e.length;++y)d.push(String(y));if(n&&e.length>0)for(var m=0;m<e.length;++m)d.push(String(m));else for(var b in e)p&&"prototype"===b||!i.call(e,b)||d.push(String(b));if(u)for(var g=function(e){if("undefined"==typeof window||!f)return c(e);try{return c(e)}catch(e){return!1}}(e),v=0;v<h.length;++v)g&&"constructor"===h[v]||!i.call(e,h[v])||d.push(h[v]);return d}}e.exports=n},2215:(e,t,r)=>{var n=Array.prototype.slice,i=r(1414),a=Object.keys,s=a?function(e){return a(e)}:r(8987),o=Object.keys;s.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?o(n.call(e)):o(e)})}else Object.keys=s;return Object.keys||s},e.exports=s},1414:e=>{var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},2818:(e,t,r)=>{var n=r(9809);t.certificate=r(1934);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));t.RSAPrivateKey=i;var a=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.RSAPublicKey=a;var s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}));t.PublicKey=s;var o=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(o),this.key("subjectPrivateKey").octstr())}));t.PrivateKey=u;var l=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));t.EncryptedPrivateKey=l;var h=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));t.DSAPrivateKey=h,t.DSAparam=n.define("DSAparam",(function(){this.int()}));var c=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(d),this.key("publicKey").optional().explicit(1).bitstr())}));t.ECPrivateKey=c;var d=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));t.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},1934:(e,t,r)=>{var n=r(9809),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),a=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),o=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),u=n.define("RelativeDistinguishedName",(function(){this.setof(a)})),l=n.define("RDNSequence",(function(){this.seqof(u)})),h=n.define("Name",(function(){this.choice({rdnSequence:this.use(l)})})),c=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),d=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),f=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(h),this.key("validity").use(c),this.key("subject").use(h),this.key("subjectPublicKeyInfo").use(o),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(d).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(f),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));e.exports=p},7631:(e,t,r)=>{var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,a=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=r(3048),o=r(4696),u=r(9509).Buffer;e.exports=function(e,t){var r,l=e.toString(),h=l.match(n);if(h){var c="aes"+h[1],d=u.from(h[2],"hex"),f=u.from(h[3].replace(/[\r\n]/g,""),"base64"),p=s(t,d.slice(0,8),parseInt(h[1],10)).key,y=[],m=o.createDecipheriv(c,p,d);y.push(m.update(f)),y.push(m.final()),r=u.concat(y)}else{var b=l.match(a);r=u.from(b[2].replace(/[\r\n]/g,""),"base64")}return{tag:l.match(i)[1],data:r}}},980:(e,t,r)=>{var n=r(2818),i=r(2562),a=r(7631),s=r(4696),o=r(5632),u=r(9509).Buffer;function l(e){var t;"object"!=typeof e||u.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=u.from(e));var r,l,h=a(e,t),c=h.tag,d=h.data;switch(c){case"CERTIFICATE":l=n.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(l||(l=n.PublicKey.decode(d,"der")),r=l.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(l.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return l.subjectPrivateKey=l.subjectPublicKey,{type:"ec",data:l};case"1.2.840.10040.4.1":return l.algorithm.params.pub_key=n.DSAparam.decode(l.subjectPublicKey.data,"der"),{type:"dsa",data:l.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":d=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),a=i[e.algorithm.decrypt.cipher.algo.join(".")],l=e.algorithm.decrypt.cipher.iv,h=e.subjectPrivateKey,c=parseInt(a.split("-")[1],10)/8,d=o.pbkdf2Sync(t,r,n,c,"sha1"),f=s.createDecipheriv(a,d,l),p=[];return p.push(f.update(h)),p.push(f.final()),u.concat(p)}(d=n.EncryptedPrivateKey.decode(d,"der"),t);case"PRIVATE KEY":switch(r=(l=n.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(l.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:l.algorithm.curve,privateKey:n.ECPrivateKey.decode(l.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return l.algorithm.params.priv_key=n.DSAparam.decode(l.subjectPrivateKey,"der"),{type:"dsa",params:l.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=n.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+c)}}e.exports=l,l.signature=n.signature},5632:(e,t,r)=>{t.pbkdf2=r(8638),t.pbkdf2Sync=r(1257)},8638:(e,t,r)=>{var n,i,a=r(9509).Buffer,s=r(7357),o=r(2368),u=r(1257),l=r(7777),h=r.g.crypto&&r.g.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d=[];function f(){return i||(i=r.g.process&&r.g.process.nextTick?r.g.process.nextTick:r.g.queueMicrotask?r.g.queueMicrotask:r.g.setImmediate?r.g.setImmediate:r.g.setTimeout)}function p(e,t,r,n,i){return h.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return h.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)})).then((function(e){return a.from(e)}))}e.exports=function(e,t,i,y,m,b){"function"==typeof m&&(b=m,m=void 0);var g=c[(m=m||"sha1").toLowerCase()];if(g&&"function"==typeof r.g.Promise){if(s(i,y),e=l(e,o,"Password"),t=l(t,o,"Salt"),"function"!=typeof b)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){f()((function(){t(null,e)}))}),(function(e){f()((function(){t(e)}))}))}(function(e){if(r.g.process&&!r.g.process.browser)return Promise.resolve(!1);if(!h||!h.importKey||!h.deriveBits)return Promise.resolve(!1);if(void 0!==d[e])return d[e];var t=p(n=n||a.alloc(8),n,10,128,e).then((function(){return!0})).catch((function(){return!1}));return d[e]=t,t}(g).then((function(r){return r?p(e,t,i,y,g):u(e,t,i,y,m)})),b)}else f()((function(){var r;try{r=u(e,t,i,y,m)}catch(e){return b(e)}b(null,r)}))}},2368:(e,t,r)=>{var n,i=r(4155);n=r.g.process&&r.g.process.browser?"utf-8":r.g.process&&r.g.process.version?parseInt(i.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",e.exports=n},7357:e=>{var t=Math.pow(2,30)-1;e.exports=function(e,r){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof r)throw new TypeError("Key length not a number");if(r<0||r>t||r!=r)throw new TypeError("Bad key length")}},1257:(e,t,r)=>{var n=r(8028),i=r(9785),a=r(9072),s=r(9509).Buffer,o=r(7357),u=r(2368),l=r(7777),h=s.alloc(128),c={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(e,t,r){var o=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?n:function(t){return a(e).update(t).digest()}}(e),u="sha512"===e||"sha384"===e?128:64;t.length>u?t=o(t):t.length<u&&(t=s.concat([t,h],u));for(var l=s.allocUnsafe(u+c[e]),d=s.allocUnsafe(u+c[e]),f=0;f<u;f++)l[f]=54^t[f],d[f]=92^t[f];var p=s.allocUnsafe(u+r+4);l.copy(p,0,0,u),this.ipad1=p,this.ipad2=l,this.opad=d,this.alg=e,this.blocksize=u,this.hash=o,this.size=c[e]}d.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(e,t,r,n,i){o(r,n);var a=new d(i=i||"sha1",e=l(e,u,"Password"),(t=l(t,u,"Salt")).length),h=s.allocUnsafe(n),f=s.allocUnsafe(t.length+4);t.copy(f,0,0,t.length);for(var p=0,y=c[i],m=Math.ceil(n/y),b=1;b<=m;b++){f.writeUInt32BE(b,t.length);for(var g=a.run(f,a.ipad1),v=g,w=1;w<r;w++){v=a.run(v,a.ipad2);for(var _=0;_<y;_++)g[_]^=v[_]}g.copy(h,p),p+=y}return h}},7777:(e,t,r)=>{var n=r(9509).Buffer;e.exports=function(e,t,r){if(n.isBuffer(e))return e;if("string"==typeof e)return n.from(e,t);if(ArrayBuffer.isView(e))return n.from(e.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},4155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var o,u=[],l=!1,h=-1;function c(){l&&o&&(l=!1,o.length?u=o.concat(u):h=-1,u.length&&d())}function d(){if(!l){var e=s(c);l=!0;for(var t=u.length;t;){for(o=u,u=[];++h<t;)o&&o[h].run();h=-1,t=u.length}o=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new f(e,t)),1!==u.length||l||s(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5760:e=>{function t(e){this._maxSize=e,this.clear()}t.prototype.clear=function(){this._size=0,this._values=Object.create(null)},t.prototype.get=function(e){return this._values[e]},t.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var r=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,i=/^\d/,a=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,s=/^\s*(['"]?)(.*?)(\1)\s*$/,o=new t(512),u=new t(512),l=new t(512);function h(e){return o.get(e)||o.set(e,c(e).map((function(e){return e.replace(s,"$2")})))}function c(e){return e.match(r)||[""]}function d(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function f(e){return!d(e)&&(function(e){return e.match(i)&&!e.match(n)}(e)||function(e){return a.test(e)}(e))}e.exports={Cache:t,split:c,normalizePath:h,setter:function(e){var t=h(e);return u.get(e)||u.set(e,(function(e,r){for(var n=0,i=t.length,a=e;n<i-1;){var s=t[n];if("__proto__"===s||"constructor"===s||"prototype"===s)return e;a=a[t[n++]]}a[t[n]]=r}))},getter:function(e,t){var r=h(e);return l.get(e)||l.set(e,(function(e){for(var n=0,i=r.length;n<i;){if(null==e&&t)return;e=e[r[n++]]}return e}))},join:function(e){return e.reduce((function(e,t){return e+(d(t)||n.test(t)?"["+t+"]":(e?".":"")+t)}),"")},forEach:function(e,t,r){!function(e,t,r){var n,i,a,s,o=e.length;for(i=0;i<o;i++)(n=e[i])&&(f(n)&&(n='"'+n+'"'),a=!(s=d(n))&&/^\d+$/.test(n),t.call(r,n,s,a,i,e))}(Array.isArray(e)?e:c(e),t,r)}}},7900:(e,t,r)=>{t.publicEncrypt=r(6559),t.privateDecrypt=r(6138),t.privateEncrypt=function(e,r){return t.publicEncrypt(e,r,!0)},t.publicDecrypt=function(e,r){return t.privateDecrypt(e,r,!0)}},9199:(e,t,r)=>{var n=r(3482),i=r(9509).Buffer;function a(e){var t=i.allocUnsafe(4);return t.writeUInt32BE(e,0),t}e.exports=function(e,t){for(var r,s=i.alloc(0),o=0;s.length<t;)r=a(o++),s=i.concat([s,n("sha1").update(e).update(r).digest()]);return s.slice(0,t)}},2144:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7108).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function l(e,t,r,n){for(var i=0,a=Math.min(e.length,r),s=t;s<a;s++){var o=e.charCodeAt(s)-48;i*=n,i+=o>=49?o-49+10:o>=17?o-17+10:o}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,s,o=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<a,this.words[s]|=67108863&i,a>=18?(a-=18,s+=1,this.words[s]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,s=a%n,o=Math.min(a,a-s)+r,u=0,h=r;h<o;h+=n)u=l(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=l(e,h,e.length,t),h=0;h<s;h++)c*=t;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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"],c=[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],d=[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];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],s=i*a,o=67108863&s,u=s/67108864|0;r.words[0]=o;for(var l=1;l<n;l++){for(var h=u>>>26,c=67108863&u,d=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=d;f++){var p=l-f|0;h+=(s=(i=0|e.words[p])*(a=0|t.words[f])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,u=0|h}return 0!==u?r.words[l]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,s=0;s<this.length;s++){var o=this.words[s],u=(16777215&(o<<i|a)).toString(16);r=0!=(a=o>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=c[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?y+r:h[l-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var s,o,u="le"===t,l=new e(a),h=this.clone();if(u){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),l[o]=s;for(;o<a;o++)l[o]=0}else{for(o=0;o<a-i;o++)l[o]=0;for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),l[a-o-1]=s}return l},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,s=0;s<n.length;s++)a=(t=(0|r.words[s])-(0|n.words[s])+a)>>26,this.words[s]=67108863&t;for(;0!==a&&s<r.length;s++)a=(t=(0|r.words[s])+a)>>26,this.words[s]=67108863&t;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,a,s=e.words,o=t.words,u=r.words,l=0,h=0|s[0],c=8191&h,d=h>>>13,f=0|s[1],p=8191&f,y=f>>>13,m=0|s[2],b=8191&m,g=m>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],T=8191&M,E=M>>>13,A=0|s[5],x=8191&A,k=A>>>13,S=0|s[6],I=8191&S,C=S>>>13,O=0|s[7],R=8191&O,N=O>>>13,P=0|s[8],B=8191&P,D=P>>>13,L=0|s[9],F=8191&L,U=L>>>13,j=0|o[0],q=8191&j,z=j>>>13,G=0|o[1],K=8191&G,H=G>>>13,$=0|o[2],V=8191&$,W=$>>>13,Z=0|o[3],J=8191&Z,Y=Z>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,ie=0|o[6],ae=8191&ie,se=ie>>>13,oe=0|o[7],ue=8191&oe,le=oe>>>13,he=0|o[8],ce=8191&he,de=he>>>13,fe=0|o[9],pe=8191&fe,ye=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(l+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,z))+Math.imul(d,q)|0))<<13)|0;l=((a=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(y,q)|0,a=Math.imul(y,z);var be=(l+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(d,K)|0))<<13)|0;l=((a=a+Math.imul(d,H)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(g,q)|0,a=Math.imul(g,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,H)|0;var ge=(l+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(d,V)|0))<<13)|0;l=((a=a+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,H)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,V)|0,a=a+Math.imul(y,W)|0;var ve=(l+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(d,J)|0))<<13)|0;l=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(E,q)|0,a=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,H)|0,n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Y)|0;var we=(l+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,a=Math.imul(k,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,H)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,W)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,ee)|0;var _e=(l+(n=n+Math.imul(c,re)|0)|0)+((8191&(i=(i=i+Math.imul(c,ne)|0)+Math.imul(d,re)|0))<<13)|0;l=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,a=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,H)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(E,V)|0,a=a+Math.imul(E,W)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0;var Me=(l+(n=n+Math.imul(c,ae)|0)|0)+((8191&(i=(i=i+Math.imul(c,se)|0)+Math.imul(d,ae)|0))<<13)|0;l=((a=a+Math.imul(d,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,z))+Math.imul(N,q)|0,a=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,H)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(k,V)|0,a=a+Math.imul(k,W)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,se)|0;var Te=(l+(n=n+Math.imul(c,ue)|0)|0)+((8191&(i=(i=i+Math.imul(c,le)|0)+Math.imul(d,ue)|0))<<13)|0;l=((a=a+Math.imul(d,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,H)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(C,V)|0,a=a+Math.imul(C,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(y,ue)|0,a=a+Math.imul(y,le)|0;var Ee=(l+(n=n+Math.imul(c,ce)|0)|0)+((8191&(i=(i=i+Math.imul(c,de)|0)+Math.imul(d,ce)|0))<<13)|0;l=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,z))+Math.imul(U,q)|0,a=Math.imul(U,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,H)|0,n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,V)|0,a=a+Math.imul(N,W)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Y)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,le)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,le)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,ce)|0,a=a+Math.imul(y,de)|0;var Ae=(l+(n=n+Math.imul(c,pe)|0)|0)+((8191&(i=(i=i+Math.imul(c,ye)|0)+Math.imul(d,pe)|0))<<13)|0;l=((a=a+Math.imul(d,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,K),i=(i=Math.imul(F,H))+Math.imul(U,K)|0,a=Math.imul(U,H),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,W)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,a=a+Math.imul(N,Y)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,le)|0,n=n+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,de)|0;var xe=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;l=((a=a+Math.imul(y,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,V),i=(i=Math.imul(F,W))+Math.imul(U,V)|0,a=Math.imul(U,W),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Q)|0,a=a+Math.imul(N,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,se)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(E,ue)|0,a=a+Math.imul(E,le)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,ce)|0,a=a+Math.imul(_,de)|0;var ke=(l+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ye)|0)+Math.imul(g,pe)|0))<<13)|0;l=((a=a+Math.imul(g,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,J),i=(i=Math.imul(F,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,a=a+Math.imul(N,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(C,ae)|0,a=a+Math.imul(C,se)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,le)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(E,ce)|0,a=a+Math.imul(E,de)|0;var Se=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;l=((a=a+Math.imul(_,ye)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(U,Q)|0,a=Math.imul(U,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(C,ue)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(k,ce)|0,a=a+Math.imul(k,de)|0;var Ie=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ye)|0)+Math.imul(E,pe)|0))<<13)|0;l=((a=a+Math.imul(E,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(U,re)|0,a=Math.imul(U,ne),n=n+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,se)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,le)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(C,ce)|0,a=a+Math.imul(C,de)|0;var Ce=(l+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(k,pe)|0))<<13)|0;l=((a=a+Math.imul(k,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(F,ae),i=(i=Math.imul(F,se))+Math.imul(U,ae)|0,a=Math.imul(U,se),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,le)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,ce)|0,a=a+Math.imul(N,de)|0;var Oe=(l+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(C,pe)|0))<<13)|0;l=((a=a+Math.imul(C,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,le))+Math.imul(U,ue)|0,a=Math.imul(U,le),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,de)|0;var Re=(l+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(N,pe)|0))<<13)|0;l=((a=a+Math.imul(N,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(F,ce),i=(i=Math.imul(F,de))+Math.imul(U,ce)|0,a=Math.imul(U,de);var Ne=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,ye)|0)+Math.imul(D,pe)|0))<<13)|0;l=((a=a+Math.imul(D,ye)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Pe=(l+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,ye))+Math.imul(U,pe)|0))<<13)|0;return l=((a=Math.imul(U,ye))+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,u[0]=me,u[1]=be,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Te,u[8]=Ee,u[9]=Ae,u[10]=xe,u[11]=ke,u[12]=Se,u[13]=Ie,u[14]=Ce,u[15]=Oe,u[16]=Re,u[17]=Ne,u[18]=Pe,0!==l&&(u[19]=l,r.length++),r};function y(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=f),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var s=i;i=0;for(var o=67108863&n,u=Math.min(a,t.length-1),l=Math.max(0,a-e.length+1);l<=u;l++){var h=a-l,c=(0|e.words[h])*(0|t.words[l]),d=67108863&c;o=67108863&(d=d+o|0),i+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[a]=o,n=s,s=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,a){for(var s=0;s<a;s++)n[s]=t[e[s]],i[s]=r[e[s]]},m.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),l=Math.sin(2*Math.PI/o),h=0;h<i;h+=o)for(var c=u,d=l,f=0;f<s;f++){var p=r[h+f],y=n[h+f],m=r[h+f+s],b=n[h+f+s],g=c*m-d*b;b=c*b+d*m,m=g,r[h+f]=p+m,n[h+f]=y+b,r[h+f+s]=p-m,n[h+f+s]=y-b,f!==o&&(g=u*c-l*d,d=u*d+l*c,c=g)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var a=0,s=0;s<t;s++)a+=0|e[s],r[2*s]=8191&a,a>>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===a),n(0==(-8192&a))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),s=new Array(n),o=new Array(n),u=new Array(n),l=new Array(n),h=new Array(n),c=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,l,n),this.transform(s,a,o,u,n,i),this.transform(l,a,h,c,n,i);for(var f=0;f<n;f++){var p=o[f]*h[f]-u[f]*c[f];u[f]=o[f]*c[f]+u[f]*h[f],o[f]=p}return this.conjugate(o,u,n),this.transform(o,u,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),y(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&a,u=(0|this.words[t])-o<<r;this.words[t]=u|s,s=o>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,s=Math.min((e-a)/26,this.length),o=67108863^67108863>>>a<<a,u=r;if(i-=s,i=Math.max(0,i),u){for(var l=0;l<s;l++)u.words[l]=this.words[l];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var h=0;for(l=this.length-1;l>=0&&(0!==h||l>=i);l--){var c=0|this.words[l];this.words[l]=h<<26-a|c>>>a,h=c&o}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i,a,s=e.length+r;this._expand(s);var o=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+o;var u=(0|e.words[i])*t;o=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)o=(a=(0|this.words[i+r])+o)>>26,this.words[i+r]=67108863&a;if(0===o)return this.strip();for(n(-1===o),o=0,i=0;i<this.length;i++)o=(a=-(0|this.words[i])+o)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var o,u=n.length-i.length;if("mod"!==t){(o=new a(null)).length=u+1,o.words=new Array(o.length);for(var l=0;l<o.length;l++)o.words[l]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,o&&(o.words[u]=1));for(var c=u-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);o&&(o.words[c]=d)}return o&&o.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,o},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),s=new a(0),o=new a(0),u=new a(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var h=r.clone(),c=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||u.isOdd())&&(o.iadd(h),u.isub(c)),o.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o),s.isub(u)):(r.isub(t),o.isub(i),u.isub(s))}return{a:o,b:u,gcd:r.iushln(l)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new a(1),o=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(i=0===t.cmpn(1)?s:o).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,s=r;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new T(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}g.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|a>>>22,a=s}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,g),i(_,g),i(M,g),M.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return b[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var o=new a(1).toRed(this),u=o.redNeg(),l=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new a(2*h*h).toRed(this);0!==this.pow(h,l).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),d=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(o);){for(var y=f,m=0;0!==y.cmp(o);m++)y=y.redSqr();n(m<p);var b=this.pow(c,new a(1).iushln(p-m-1));d=d.redMul(b),c=b.redSqr(),f=f.redMul(c),p=m}return d},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,o=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],h=u-1;h>=0;h--){var c=l>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4==++o||0===n&&0===h)&&(i=this.mul(i,r[s]),o=0,s=0)):o=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new E(e)},i(E,T),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6138:(e,t,r)=>{var n=r(980),i=r(9199),a=r(7859),s=r(2144),o=r(3663),u=r(3482),l=r(4818),h=r(9509).Buffer;e.exports=function(e,t,r){var c;c=e.padding?e.padding:r?1:4;var d,f=n(e),p=f.modulus.byteLength();if(t.length>p||new s(t).cmp(f.modulus)>=0)throw new Error("decryption error");d=r?l(new s(t),f):o(t,f);var y=h.alloc(p-d.length);if(d=h.concat([y,d],p),4===c)return function(e,t){var r=e.modulus.byteLength(),n=u("sha1").update(h.alloc(0)).digest(),s=n.length;if(0!==t[0])throw new Error("decryption error");var o=t.slice(1,s+1),l=t.slice(s+1),c=a(o,i(l,s)),d=a(l,i(c,r-s-1));if(function(e,t){e=h.from(e),t=h.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));for(var i=-1;++i<n;)r+=e[i]^t[i];return r}(n,d.slice(0,s)))throw new Error("decryption error");for(var f=s;0===d[f];)f++;if(1!==d[f++])throw new Error("decryption error");return d.slice(f)}(f,d);if(1===c)return function(e,t,r){for(var n=t.slice(0,2),i=2,a=0;0!==t[i++];)if(i>=t.length){a++;break}var s=t.slice(2,i-1);if(("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&a++,s.length<8&&a++,a)throw new Error("decryption error");return t.slice(i)}(0,d,r);if(3===c)return d;throw new Error("unknown padding")}},6559:(e,t,r)=>{var n=r(980),i=r(1798),a=r(3482),s=r(9199),o=r(7859),u=r(2144),l=r(4818),h=r(3663),c=r(9509).Buffer;e.exports=function(e,t,r){var d;d=e.padding?e.padding:r?1:4;var f,p=n(e);if(4===d)f=function(e,t){var r=e.modulus.byteLength(),n=t.length,l=a("sha1").update(c.alloc(0)).digest(),h=l.length,d=2*h;if(n>r-d-2)throw new Error("message too long");var f=c.alloc(r-n-d-2),p=r-h-1,y=i(h),m=o(c.concat([l,f,c.alloc(1,1),t],p),s(y,p)),b=o(y,s(m,h));return new u(c.concat([c.alloc(1),b,m],r))}(p,t);else if(1===d)f=function(e,t,r){var n,a=t.length,s=e.modulus.byteLength();if(a>s-11)throw new Error("message too long");return n=r?c.alloc(s-a-3,255):function(e){for(var t,r=c.allocUnsafe(e),n=0,a=i(2*e),s=0;n<e;)s===a.length&&(a=i(2*e),s=0),(t=a[s++])&&(r[n++]=t);return r}(s-a-3),new u(c.concat([c.from([0,r?1:2]),n,c.alloc(1),t],s))}(p,t,r);else{if(3!==d)throw new Error("unknown padding");if((f=new u(t)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?h(f,p):l(f,p)}},4818:(e,t,r)=>{var n=r(2144),i=r(9509).Buffer;e.exports=function(e,t){return i.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}},7859:e=>{e.exports=function(e,t){for(var r=e.length,n=-1;++n<r;)e[n]^=t[n];return e}},1798:(e,t,r)=>{var n=r(4155),i=65536,a=r(9509).Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0)if(e>i)for(var o=0;o<e;o+=i)s.getRandomValues(r.slice(o,o+i));else s.getRandomValues(r);return"function"==typeof t?n.nextTick((function(){t(null,r)})):r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},7963:(e,t,r)=>{var n=r(4155);function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var a=r(9509),s=r(1798),o=a.Buffer,u=a.kMaxLength,l=r.g.crypto||r.g.msCrypto,h=Math.pow(2,32)-1;function c(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>h||e<0)throw new TypeError("offset must be a uint32");if(e>u||e>t)throw new RangeError("offset out of range")}function d(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>h||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>u)throw new RangeError("buffer too small")}function f(e,t,r,i){if(n.browser){var a=e.buffer,o=new Uint8Array(a,t,r);return l.getRandomValues(o),i?void n.nextTick((function(){i(null,e)})):e}if(!i)return s(r).copy(e,t),e;s(r,(function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)}))}l&&l.getRandomValues||!n.browser?(t.randomFill=function(e,t,n,i){if(!(o.isBuffer(e)||e instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)i=t,t=0,n=e.length;else if("function"==typeof n)i=n,n=e.length-t;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return c(t,e.length),d(n,t,e.length),f(e,t,n,i)},t.randomFillSync=function(e,t,n){if(void 0===t&&(t=0),!(o.isBuffer(e)||e instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return c(t,e.length),void 0===n&&(n=e.length-t),d(n,t,e.length),f(e,t,n)}):(t.randomFill=i,t.randomFillSync=i)},4281:e=>{var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,a,s,o,u;if("string"==typeof t&&(a="not ",t.substr(0,a.length)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var l=("number"!=typeof u&&(u=0),u+".".length>(o=e).length||-1===o.indexOf(".",u)?"argument":"property");s='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6753:(e,t,r)=>{var n=r(4155),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=h;var a=r(9481),s=r(4229);r(5717)(h,a);for(var o=i(s.prototype),u=0;u<o.length;u++){var l=o[u];h.prototype[l]||(h.prototype[l]=s.prototype[l])}function h(e){if(!(this instanceof h))return new h(e);a.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},2725:(e,t,r)=>{e.exports=i;var n=r(4605);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(5717)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},9481:(e,t,r)=>{var n,i=r(4155);e.exports=A,A.ReadableState=E,r(7187).EventEmitter;var a,s=function(e,t){return e.listeners(t).length},o=r(2503),u=r(8764).Buffer,l=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},h=r(4616);a=h&&h.debuglog?h.debuglog("stream"):function(){};var c,d,f,p=r(7327),y=r(1195),m=r(2457).getHighWaterMark,b=r(4281).q,g=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,_=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(A,o);var M=y.errorOrDestroy,T=["error","close","destroy","pause","resume"];function E(e,t,i){n=n||r(6753),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(c||(c=r(2553).s),this.decoder=new c(e.encoding),this.encoding=e.encoding)}function A(e){if(n=n||r(6753),!(this instanceof A))return new A(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function x(e,t,r,n,i){a("readableAddChunk",t);var s,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(a("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?C(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,O(e)))}}(e,o);else if(i||(s=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t)),r}(o,t)),s)M(e,s);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)o.endEmitted?M(e,new _):k(e,o,t,!0);else if(o.ended)M(e,new v);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?k(e,o,t,!1):R(e,o)):k(e,o,t,!1)}else n||(o.reading=!1,R(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function k(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&C(e)),R(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=y.destroy,A.prototype._undestroy=y.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),x(this,e,t,!1,r)},A.prototype.unshift=function(e){return x(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(e){c||(c=r(2553).s);var t=new c(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var S=1073741824;function I(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=S?e=S:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function C(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(O,e))}function O(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function R(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(N,e,t))}function N(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(a("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function P(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function B(e){a("readable nexttick read 0"),e.read(0)}function D(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(j,t,e))}function j(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function q(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}A.prototype.read=function(e){a("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return a("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):C(this),null;if(0===(e=I(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return a("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&a("length less than watermark",i=!0),t.ended||t.reading?a("reading or ended",i=!1):i&&(a("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=I(r,t))),null===(n=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){M(this,new w("_read()"))},A.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,t);var o=t&&!1===t.end||e===i.stdout||e===i.stderr?y:u;function u(){a("onend"),e.end()}n.endEmitted?i.nextTick(o):r.once("end",o),e.on("unpipe",(function t(i,s){a("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,a("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",c),h=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=function(e){return function(){var t=e._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",l);var h=!1;function c(t){a("ondata");var i=e.write(t);a("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==q(n.pipes,e))&&!h&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){a("onerror",t),y(),e.removeListener("error",d),0===s(e,"error")&&M(e,t)}function f(){e.removeListener("finish",p),y()}function p(){a("onfinish"),e.removeListener("close",f),y()}function y(){a("unpipe"),r.unpipe(e)}return r.on("data",c),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=q(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},A.prototype.on=function(e,t){var r=o.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?C(this):n.reading||i.nextTick(B,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(P,this),r},A.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(P,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(D,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<T.length;s++)e.on(T[s],this.emit.bind(this,T[s]));return this._read=function(t){a("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(5850)),d(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=F,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(e,t){return void 0===f&&(f=r(5167)),f(A,e,t)})},4605:(e,t,r)=>{e.exports=h;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,a=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new a);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function h(e){if(!(this instanceof h))return new h(e);u.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",c)}function c(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,r){d(e,t,r)}))}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new o;if(e._transformState.transforming)throw new s;return e.push(null)}r(5717)(h,u),h.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},h.prototype._transform=function(e,t,r){r(new i("_transform()"))},h.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},h.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},h.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},4229:(e,t,r)=>{var n,i=r(4155);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=A,A.WritableState=E;var s,o={deprecate:r(4927)},u=r(2503),l=r(8764).Buffer,h=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},c=r(1195),d=r(2457).getHighWaterMark,f=r(4281).q,p=f.ERR_INVALID_ARG_TYPE,y=f.ERR_METHOD_NOT_IMPLEMENTED,m=f.ERR_MULTIPLE_CALLBACK,b=f.ERR_STREAM_CANNOT_PIPE,g=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,w=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,M=c.errorOrDestroy;function T(){}function E(e,t,s){n=n||r(6753),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,a=r.writecb;if("function"!=typeof a)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,a){--t.pendingcb,r?(i.nextTick(a,n),i.nextTick(O,e,t),e._writableState.errorEmitted=!0,M(e,n)):(a(n),e._writableState.errorEmitted=!0,M(e,n),O(e,t))}(e,r,n,t,a);else{var s=I(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||S(e,r),n?i.nextTick(k,e,r,s,a):k(e,r,s,a)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function A(e){var t=this instanceof(n=n||r(6753));if(!t&&!s.call(A,this))return new A(e);this._writableState=new E(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function x(e,t,r,n,i,a,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function k(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),O(e,t)}function S(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var o=0,u=!0;r;)i[o]=r,r.isBuf||(u=!1),r=r.next,o+=1;i.allBuffers=u,x(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,h=r.encoding,c=r.callback;if(x(e,t,!1,t.objectMode?1:l.length,l,h,c),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function I(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function C(e,t){e._final((function(r){t.pendingcb--,r&&M(e,r),t.prefinished=!0,e.emit("prefinish"),O(e,t)}))}function O(e,t){var r=I(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(C,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(5717)(A,u),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===A&&e&&e._writableState instanceof E}})):s=function(e){return e instanceof this},A.prototype.pipe=function(){M(this,new b)},A.prototype.write=function(e,t,r){var n,a=this._writableState,s=!1,o=!a.objectMode&&(n=e,l.isBuffer(n)||n instanceof h);return o&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof r&&(r=T),a.ending?function(e,t){var r=new w;M(e,r),i.nextTick(t,r)}(this,r):(o||function(e,t,r,n){var a;return null===r?a=new v:"string"==typeof r||t.objectMode||(a=new p("chunk",["string","Buffer"],r)),!a||(M(e,a),i.nextTick(n,a),!1)}(this,a,e,r))&&(a.pendingcb++,s=function(e,t,r,n,i,a){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var o=t.objectMode?1:n.length;t.length+=o;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var h=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},h?h.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else x(e,t,!1,o,n,i,a);return u}(this,a,o,e,t,r)),s},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||S(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,O(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=c.destroy,A.prototype._undestroy=c.undestroy,A.prototype._destroy=function(e,t){t(e)}},5850:(e,t,r)=>{var n,i=r(4155);function a(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(8610),o=Symbol("lastResolve"),u=Symbol("lastReject"),l=Symbol("error"),h=Symbol("ended"),c=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function p(e,t){return{value:e,done:t}}function y(e){var t=e[o];if(null!==t){var r=e[f].read();null!==r&&(e[c]=null,e[o]=null,e[u]=null,t(p(r,!1)))}}function m(e){i.nextTick(y,e)}var b=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((a(n={get stream(){return this[f]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[h])return Promise.resolve(p(void 0,!0));if(this[f].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[l]?r(e[l]):t(p(void 0,!0))}))}));var r,n=this[c];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[h]?r(p(void 0,!0)):t[d](r,n)}),n)}}(n,this));else{var a=this[f].read();if(null!==a)return Promise.resolve(p(a,!1));r=new Promise(this[d])}return this[c]=r,r}},Symbol.asyncIterator,(function(){return this})),a(n,"return",(function(){var e=this;return new Promise((function(t,r){e[f].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),b);e.exports=function(e){var t,r=Object.create(g,(a(t={},f,{value:e,writable:!0}),a(t,o,{value:null,writable:!0}),a(t,u,{value:null,writable:!0}),a(t,l,{value:null,writable:!0}),a(t,h,{value:e._readableState.endEmitted,writable:!0}),a(t,d,{value:function(e,t){var n=r[f].read();n?(r[c]=null,r[o]=null,r[u]=null,e(p(n,!1))):(r[o]=e,r[u]=t)},writable:!0}),t));return r[c]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[c]=null,r[o]=null,r[u]=null,t(e)),void(r[l]=e)}var n=r[o];null!==n&&(r[c]=null,r[o]=null,r[u]=null,n(p(void 0,!0))),r[h]=!0})),e.on("readable",m.bind(null,r)),r}},7327:(e,t,r)=>{function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function o(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var u=r(8764).Buffer,l=r(2361).inspect,h=l&&l.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t,r,n,i=u.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=i,n=s,u.prototype.copy.call(t,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0==(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0==(e-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,t}},{key:h,value:function(e,t){return l(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1195:(e,t,r)=>{var n=r(4155);function i(e,t){s(e,t),a(e)}function a(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return o||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(a,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(a,r),t(e)):n.nextTick(a,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},8610:(e,t,r)=>{var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,a){if("function"==typeof r)return e(t,null,r);r||(r={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(a||i);var s=r.readable||!1!==r.readable&&t.readable,o=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||h()},l=t._writableState&&t._writableState.finished,h=function(){o=!1,l=!0,s||a.call(t)},c=t._readableState&&t._readableState.endEmitted,d=function(){s=!1,c=!0,o||a.call(t)},f=function(e){a.call(t,e)},p=function(){var e;return s&&!c?(t._readableState&&t._readableState.ended||(e=new n),a.call(t,e)):o&&!l?(t._writableState&&t._writableState.ended||(e=new n),a.call(t,e)):void 0},y=function(){t.req.on("finish",h)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",h),t.on("abort",p),t.req?y():t.on("request",y)):o&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",d),t.on("finish",h),!1!==r.error&&t.on("error",f),t.on("close",p),function(){t.removeListener("complete",h),t.removeListener("abort",p),t.removeListener("request",y),t.req&&t.req.removeListener("finish",h),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",h),t.removeListener("end",d),t.removeListener("error",f),t.removeListener("close",p)}}},5167:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(e,t,r)=>{var n,i=r(4281).q,a=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function u(e){e()}function l(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var h,c=function(e){return e.length?"function"!=typeof e[e.length-1]?o:e.pop():o}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new a("streams");var d=t.map((function(e,i){var a=i<t.length-1;return function(e,t,i,a){a=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(a);var o=!1;e.on("close",(function(){o=!0})),void 0===n&&(n=r(8610)),n(e,{readable:t,writable:i},(function(e){if(e)return a(e);o=!0,a()}));var u=!1;return function(t){if(!o&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void a(t||new s("pipe"))}}(e,a,i>0,(function(e){h||(h=e),e&&d.forEach(u),a||(d.forEach(u),c(h))}))}));return t.reduce(l)}},2457:(e,t,r)=>{var n=r(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},2503:(e,t,r)=>{e.exports=r(7187).EventEmitter},8473:(e,t,r)=>{(t=e.exports=r(9481)).Stream=t,t.Readable=t,t.Writable=r(4229),t.Duplex=r(6753),t.Transform=r(4605),t.PassThrough=r(2725),t.finished=r(8610),t.pipeline=r(9946)},9785:(e,t,r)=>{var n=r(8764).Buffer,i=r(5717),a=r(3349),s=new Array(16),o=[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],u=[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],l=[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],h=[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],c=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function f(){a.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function y(e,t,r,n,i,a,s,o){return p(e+(t^r^n)+a+s|0,o)+i|0}function m(e,t,r,n,i,a,s,o){return p(e+(t&r|~t&n)+a+s|0,o)+i|0}function b(e,t,r,n,i,a,s,o){return p(e+((t|~r)^n)+a+s|0,o)+i|0}function g(e,t,r,n,i,a,s,o){return p(e+(t&n|r&~n)+a+s|0,o)+i|0}function v(e,t,r,n,i,a,s,o){return p(e+(t^(r|~n))+a+s|0,o)+i|0}i(f,a),f.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,a=0|this._d,f=0|this._e,w=0|this._a,_=0|this._b,M=0|this._c,T=0|this._d,E=0|this._e,A=0;A<80;A+=1){var x,k;A<16?(x=y(r,n,i,a,f,e[o[A]],c[0],l[A]),k=v(w,_,M,T,E,e[u[A]],d[0],h[A])):A<32?(x=m(r,n,i,a,f,e[o[A]],c[1],l[A]),k=g(w,_,M,T,E,e[u[A]],d[1],h[A])):A<48?(x=b(r,n,i,a,f,e[o[A]],c[2],l[A]),k=b(w,_,M,T,E,e[u[A]],d[2],h[A])):A<64?(x=g(r,n,i,a,f,e[o[A]],c[3],l[A]),k=m(w,_,M,T,E,e[u[A]],d[3],h[A])):(x=v(r,n,i,a,f,e[o[A]],c[4],l[A]),k=y(w,_,M,T,E,e[u[A]],d[4],h[A])),r=f,f=a,a=p(i,10),i=n,n=x,w=E,E=T,T=p(M,10),M=_,_=k}var S=this._b+i+T|0;this._b=this._c+a+E|0,this._c=this._d+f+w|0,this._d=this._e+r+_|0,this._e=this._a+n+M|0,this._a=S},f.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=f},9509:(e,t,r)=>{var n=r(8764),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(a(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),a(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},2399:(e,t,r)=>{var n,i=r(4155),a=r(8764),s=a.Buffer,o={};for(n in a)a.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(o[n]=a[n]);var u=o.Buffer={};for(n in s)s.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(u[n]=s[n]);if(o.Buffer.prototype=s.prototype,u.from&&u.from!==Uint8Array.from||(u.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return s(e,t,r)}),u.alloc||(u.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=s(e);return t&&0!==t.length?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!o.kStringMaxLength)try{o.kStringMaxLength=i.binding("buffer").kStringMaxLength}catch(e){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),e.exports=o},7635:function(e){!function(t){const r=2147483647;function n(e){const t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);let r=1779033703,n=3144134277,i=1013904242,a=2773480762,s=1359893119,o=2600822924,u=528734635,l=1541459225;const h=new Uint32Array(64);function c(e){let c=0,d=e.length;for(;d>=64;){let f,p,y,m,b,g=r,v=n,w=i,_=a,M=s,T=o,E=u,A=l;for(p=0;p<16;p++)y=c+4*p,h[p]=(255&e[y])<<24|(255&e[y+1])<<16|(255&e[y+2])<<8|255&e[y+3];for(p=16;p<64;p++)f=h[p-2],m=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10,f=h[p-15],b=(f>>>7|f<<25)^(f>>>18|f<<14)^f>>>3,h[p]=(m+h[p-7]|0)+(b+h[p-16]|0)|0;for(p=0;p<64;p++)m=(((M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7))+(M&T^~M&E)|0)+(A+(t[p]+h[p]|0)|0)|0,b=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&v^g&w^v&w)|0,A=E,E=T,T=M,M=_+m|0,_=w,w=v,v=g,g=m+b|0;r=r+g|0,n=n+v|0,i=i+w|0,a=a+_|0,s=s+M|0,o=o+T|0,u=u+E|0,l=l+A|0,c+=64,d-=64}}c(e);let d,f=e.length%64,p=e.length/536870912|0,y=e.length<<3,m=f<56?56:120,b=e.slice(e.length-f,e.length);for(b.push(128),d=f+1;d<m;d++)b.push(0);return b.push(p>>>24&255),b.push(p>>>16&255),b.push(p>>>8&255),b.push(p>>>0&255),b.push(y>>>24&255),b.push(y>>>16&255),b.push(y>>>8&255),b.push(y>>>0&255),c(b),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,l>>>24&255,l>>>16&255,l>>>8&255,l>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,a=new Array(i),s=new Array(64);let o,u=[];for(o=0;o<64;o++)a[o]=54;for(o=0;o<e.length;o++)a[o]^=e[o];for(o=0;o<t.length;o++)a[64+o]=t[o];for(o=i-4;o<i;o++)a[o]=0;for(o=0;o<64;o++)s[o]=92;for(o=0;o<e.length;o++)s[o]^=e[o];function l(){for(let e=i-1;e>=i-4;e--){if(a[e]++,a[e]<=255)return;a[e]=0}}for(;r>=32;)l(),u=u.concat(n(s.concat(n(a)))),r-=32;return r>0&&(l(),u=u.concat(n(s.concat(n(a))).slice(0,r))),u}function a(e,t,r,n,i){let a;for(l(e,16*(2*r-1),i,0,16),a=0;a<2*r;a++)u(e,16*a,i,16),o(i,n),l(i,0,e,t+16*a,16);for(a=0;a<r;a++)l(e,t+2*a*16,e,16*a,16);for(a=0;a<r;a++)l(e,t+16*(2*a+1),e,16*(a+r),16)}function s(e,t){return e<<t|e>>>32-t}function o(e,t){l(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=s(t[0]+t[12],7),t[8]^=s(t[4]+t[0],9),t[12]^=s(t[8]+t[4],13),t[0]^=s(t[12]+t[8],18),t[9]^=s(t[5]+t[1],7),t[13]^=s(t[9]+t[5],9),t[1]^=s(t[13]+t[9],13),t[5]^=s(t[1]+t[13],18),t[14]^=s(t[10]+t[6],7),t[2]^=s(t[14]+t[10],9),t[6]^=s(t[2]+t[14],13),t[10]^=s(t[6]+t[2],18),t[3]^=s(t[15]+t[11],7),t[7]^=s(t[3]+t[15],9),t[11]^=s(t[7]+t[3],13),t[15]^=s(t[11]+t[7],18),t[1]^=s(t[0]+t[3],7),t[2]^=s(t[1]+t[0],9),t[3]^=s(t[2]+t[1],13),t[0]^=s(t[3]+t[2],18),t[6]^=s(t[5]+t[4],7),t[7]^=s(t[6]+t[5],9),t[4]^=s(t[7]+t[6],13),t[5]^=s(t[4]+t[7],18),t[11]^=s(t[10]+t[9],7),t[8]^=s(t[11]+t[10],9),t[9]^=s(t[8]+t[11],13),t[10]^=s(t[9]+t[8],18),t[12]^=s(t[15]+t[14],7),t[13]^=s(t[12]+t[15],9),t[14]^=s(t[13]+t[12],13),t[15]^=s(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function u(e,t,r,n){for(let i=0;i<n;i++)r[i]^=e[t+i]}function l(e,t,r,n,i){for(;i--;)r[n++]=e[t++]}function h(e){if(!e||"number"!=typeof e.length)return!1;for(let t=0;t<e.length;t++){const r=e[t];if("number"!=typeof r||r%1||r<0||r>=256)return!1}return!0}function c(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function d(e,t,n,s,o,d,f){if(n=c(n,"N"),s=c(s,"r"),o=c(o,"p"),d=c(d,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/s)throw new Error("N too large");if(s>r/128/o)throw new Error("r too large");if(!h(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!h(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let p=i(e,t,128*o*s);const y=new Uint32Array(32*o*s);for(let e=0;e<y.length;e++){const t=4*e;y[e]=(255&p[t+3])<<24|(255&p[t+2])<<16|(255&p[t+1])<<8|(255&p[t+0])<<0}const m=new Uint32Array(64*s),b=new Uint32Array(32*s*n),g=32*s,v=new Uint32Array(16),w=new Uint32Array(16),_=o*n*2;let M,T,E=0,A=null,x=!1,k=0,S=0;const I=f?parseInt(1e3/s):4294967295,C="undefined"!=typeof setImmediate?setImmediate:setTimeout,O=function(){if(x)return f(new Error("cancelled"),E/_);let t;switch(k){case 0:T=32*S*s,l(y,T,m,0,g),k=1,M=0;case 1:t=n-M,t>I&&(t=I);for(let e=0;e<t;e++)l(m,0,b,(M+e)*g,g),a(m,g,s,v,w);if(M+=t,E+=t,f){const e=parseInt(1e3*E/_);if(e!==A){if(x=f(null,E/_),x)break;A=e}}if(M<n)break;M=0,k=2;case 2:t=n-M,t>I&&(t=I);for(let e=0;e<t;e++){const e=m[16*(2*s-1)]&n-1;u(b,e*g,m,g),a(m,g,s,v,w)}if(M+=t,E+=t,f){const e=parseInt(1e3*E/_);if(e!==A){if(x=f(null,E/_),x)break;A=e}}if(M<n)break;if(l(m,0,y,T,g),S++,S<o){k=0;break}p=[];for(let e=0;e<y.length;e++)p.push(y[e]>>0&255),p.push(y[e]>>8&255),p.push(y[e]>>16&255),p.push(y[e]>>24&255);const r=i(e,p,d);return f&&f(null,1,r),r}f&&C(O)};if(!f)for(;;){const e=O();if(null!=e)return e}O()}const f={scrypt:function(e,t,r,n,i,a,s){return new Promise((function(o,u){let l=0;s&&s(0),d(e,t,r,n,i,a,(function(e,t,r){if(e)u(e);else if(r)s&&1!==l&&s(1),o(new Uint8Array(r));else if(s&&t!==l)return l=t,s(t)}))}))},syncScrypt:function(e,t,r,n,i,a){return new Uint8Array(d(e,t,r,n,i,a))}};e.exports=f}()},4189:(e,t,r)=>{var n=r(9509).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,a=e.length,s=this._len,o=0;o<a;){for(var u=s%i,l=Math.min(a-o,i-u),h=0;h<l;h++)r[u+h]=e[o+h];o+=l,(s+=l)%i==0&&this._update(r)}return this._len+=a,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},9072:(e,t,r)=>{var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(4448),n.sha1=r(8336),n.sha224=r(8432),n.sha256=r(7499),n.sha384=r(1686),n.sha512=r(7816)},4448:(e,t,r)=>{var n=r(5717),i=r(4189),a=r(9509).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function u(){this.init(),this._w=o,i.call(this,64,56)}function l(e){return e<<30|e>>>2}function h(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,o=0|this._d,u=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var d=0;d<80;++d){var f=~~(d/20),p=0|((t=n)<<5|t>>>27)+h(f,i,a,o)+u+r[d]+s[f];u=o,o=a,a=l(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=o+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=a.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},8336:(e,t,r)=>{var n=r(5717),i=r(4189),a=r(9509).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function u(){this.init(),this._w=o,i.call(this,64,56)}function l(e){return e<<5|e>>>27}function h(e){return e<<30|e>>>2}function c(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,o=0|this._d,u=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var f=0;f<80;++f){var p=~~(f/20),y=l(n)+c(p,i,a,o)+u+r[f]+s[p]|0;u=o,o=a,a=h(i),i=n,n=y}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=o+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=a.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},8432:(e,t,r)=>{var n=r(5717),i=r(7499),a=r(4189),s=r(9509).Buffer,o=new Array(64);function u(){this.init(),this._w=o,a.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},7499:(e,t,r)=>{var n=r(5717),i=r(4189),a=r(9509).Buffer,s=[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],o=new Array(64);function u(){this.init(),this._w=o,i.call(this,64,56)}function l(e,t,r){return r^e&(t^r)}function h(e,t,r){return e&t|r&(e|t)}function c(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function f(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,o=0|this._d,u=0|this._e,p=0|this._f,y=0|this._g,m=0|this._h,b=0;b<16;++b)r[b]=e.readInt32BE(4*b);for(;b<64;++b)r[b]=0|(((t=r[b-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[b-7]+f(r[b-15])+r[b-16];for(var g=0;g<64;++g){var v=m+d(u)+l(u,p,y)+s[g]+r[g]|0,w=c(n)+h(n,i,a)|0;m=y,y=p,p=u,u=o+v|0,o=a,a=i,i=n,n=v+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=o+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=y+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=a.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},1686:(e,t,r)=>{var n=r(5717),i=r(7816),a=r(4189),s=r(9509).Buffer,o=new Array(160);function u(){this.init(),this._w=o,a.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=s.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},7816:(e,t,r)=>{var n=r(5717),i=r(4189),a=r(9509).Buffer,s=[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],o=new Array(160);function u(){this.init(),this._w=o,i.call(this,128,112)}function l(e,t,r){return r^e&(t^r)}function h(e,t,r){return e&t|r&(e|t)}function c(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function b(e,t){return e>>>0<t>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,a=0|this._dh,o=0|this._eh,u=0|this._fh,g=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,M=0|this._cl,T=0|this._dl,E=0|this._el,A=0|this._fl,x=0|this._gl,k=0|this._hl,S=0;S<32;S+=2)t[S]=e.readInt32BE(4*S),t[S+1]=e.readInt32BE(4*S+4);for(;S<160;S+=2){var I=t[S-30],C=t[S-30+1],O=f(I,C),R=p(C,I),N=y(I=t[S-4],C=t[S-4+1]),P=m(C,I),B=t[S-14],D=t[S-14+1],L=t[S-32],F=t[S-32+1],U=R+D|0,j=O+B+b(U,R)|0;j=(j=j+N+b(U=U+P|0,P)|0)+L+b(U=U+F|0,F)|0,t[S]=j,t[S+1]=U}for(var q=0;q<160;q+=2){j=t[q],U=t[q+1];var z=h(r,n,i),G=h(w,_,M),K=c(r,w),H=c(w,r),$=d(o,E),V=d(E,o),W=s[q],Z=s[q+1],J=l(o,u,g),Y=l(E,A,x),X=k+V|0,Q=v+$+b(X,k)|0;Q=(Q=(Q=Q+J+b(X=X+Y|0,Y)|0)+W+b(X=X+Z|0,Z)|0)+j+b(X=X+U|0,U)|0;var ee=H+G|0,te=K+z+b(ee,H)|0;v=g,k=x,g=u,x=A,u=o,A=E,o=a+Q+b(E=T+X|0,T)|0,a=i,T=M,i=n,M=_,n=r,_=w,r=Q+te+b(w=X+ee|0,X)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+M|0,this._dl=this._dl+T|0,this._el=this._el+E|0,this._fl=this._fl+A|0,this._gl=this._gl+x|0,this._hl=this._hl+k|0,this._ah=this._ah+r+b(this._al,w)|0,this._bh=this._bh+n+b(this._bl,_)|0,this._ch=this._ch+i+b(this._cl,M)|0,this._dh=this._dh+a+b(this._dl,T)|0,this._eh=this._eh+o+b(this._el,E)|0,this._fh=this._fh+u+b(this._fl,A)|0,this._gh=this._gh+g+b(this._gl,x)|0,this._hh=this._hh+v+b(this._hl,k)|0},u.prototype._hash=function(){var e=a.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},2830:(e,t,r)=>{e.exports=i;var n=r(7187).EventEmitter;function i(){n.call(this)}r(5717)(i,n),i.Readable=r(9481),i.Writable=r(4229),i.Duplex=r(6753),i.Transform=r(4605),i.PassThrough=r(2725),i.finished=r(8610),i.pipeline=r(9946),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(r.on("end",o),r.on("close",u));var s=!1;function o(){s||(s=!0,e.end())}function u(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(h(),0===n.listenerCount(this,"error"))throw e}function h(){r.removeListener("data",i),e.removeListener("drain",a),r.removeListener("end",o),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",h),r.removeListener("close",h),e.removeListener("close",h)}return r.on("error",l),e.on("error",l),r.on("end",h),r.on("close",h),e.on("close",h),e.emit("pipe",r),e}},2553:(e,t,r)=>{var n=r(9509).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=h,this.end=c,t=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function h(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.s=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},9885:e=>{const t=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,r=e=>e.match(t)||[],n=e=>e[0].toUpperCase()+e.slice(1),i=(e,t)=>r(e).join(t).toLowerCase(),a=e=>r(e).reduce(((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`),"");e.exports={words:r,upperFirst:n,camelCase:a,pascalCase:e=>n(a(e)),snakeCase:e=>i(e,"_"),kebabCase:e=>i(e,"-"),sentenceCase:e=>n(i(e," ")),titleCase:e=>r(e).map(n).join(" ")}},4633:e=>{function t(e,t){var r=e.length,n=new Array(r),i={},a=r,s=function(e){for(var t=new Map,r=0,n=e.length;r<n;r++){var i=e[r];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}(t),o=function(e){for(var t=new Map,r=0,n=e.length;r<n;r++)t.set(e[r],r);return t}(e);for(t.forEach((function(e){if(!o.has(e[0])||!o.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")}));a--;)i[a]||u(e[a],a,new Set);return n;function u(e,t,a){if(a.has(e)){var l;try{l=", node was:"+JSON.stringify(e)}catch(e){l=""}throw new Error("Cyclic dependency"+l)}if(!o.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!i[t]){i[t]=!0;var h=s.get(e)||new Set;if(t=(h=Array.from(h)).length){a.add(e);do{var c=h[--t];u(c,o.get(c),a)}while(t);a.delete(e)}n[--r]=e}}}e.exports=function(e){return t(function(e){for(var t=new Set,r=0,n=e.length;r<n;r++){var i=e[r];t.add(i[0]),t.add(i[1])}return Array.from(t)}(e),e)},e.exports.array=t},4927:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},384:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},5955:(e,t,r)=>{var n=r(2584),i=r(8662),a=r(6430),s=r(5692);function o(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,h=o(Object.prototype.toString),c=o(Number.prototype.valueOf),d=o(String.prototype.valueOf),f=o(Boolean.prototype.valueOf);if(u)var p=o(BigInt.prototype.valueOf);if(l)var y=o(Symbol.prototype.valueOf);function m(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function b(e){return"[object Map]"===h(e)}function g(e){return"[object Set]"===h(e)}function v(e){return"[object WeakMap]"===h(e)}function w(e){return"[object WeakSet]"===h(e)}function _(e){return"[object ArrayBuffer]"===h(e)}function M(e){return"undefined"!=typeof ArrayBuffer&&(_.working?_(e):e instanceof ArrayBuffer)}function T(e){return"[object DataView]"===h(e)}function E(e){return"undefined"!=typeof DataView&&(T.working?T(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||E(e)},t.isUint8Array=function(e){return"Uint8Array"===a(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===a(e)},t.isUint16Array=function(e){return"Uint16Array"===a(e)},t.isUint32Array=function(e){return"Uint32Array"===a(e)},t.isInt8Array=function(e){return"Int8Array"===a(e)},t.isInt16Array=function(e){return"Int16Array"===a(e)},t.isInt32Array=function(e){return"Int32Array"===a(e)},t.isFloat32Array=function(e){return"Float32Array"===a(e)},t.isFloat64Array=function(e){return"Float64Array"===a(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===a(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===a(e)},b.working="undefined"!=typeof Map&&b(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(b.working?b(e):e instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(g.working?g(e):e instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(v.working?v(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},_.working="undefined"!=typeof ArrayBuffer&&_(new ArrayBuffer),t.isArrayBuffer=M,T.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&T(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=E;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function x(e){return"[object SharedArrayBuffer]"===h(e)}function k(e){return void 0!==A&&(void 0===x.working&&(x.working=x(new A)),x.working?x(e):e instanceof A)}function S(e){return m(e,c)}function I(e){return m(e,d)}function C(e){return m(e,f)}function O(e){return u&&m(e,p)}function R(e){return l&&m(e,y)}t.isSharedArrayBuffer=k,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===h(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===h(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===h(e)},t.isGeneratorObject=function(e){return"[object Generator]"===h(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===h(e)},t.isNumberObject=S,t.isStringObject=I,t.isBooleanObject=C,t.isBigIntObject=O,t.isSymbolObject=R,t.isBoxedPrimitive=function(e){return S(e)||I(e)||C(e)||O(e)||R(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(M(e)||k(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},9539:(e,t,r)=>{var n=r(4155),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},a=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(l(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(e).replace(a,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),o=n[r];r<i;o=n[++r])b(o)||!M(o)?s+=" "+o:s+=" "+l(o);return s},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),i=!0}return e.apply(this,arguments)}};var s={},o=/^$/;if(n.env.NODE_DEBUG){var u=n.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+u+"$","i")}function l(e,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),d(n,e,n.depth)}function h(e,t){var r=l.styles[t];return r?"["+l.colors[r][0]+"m"+e+"["+l.colors[r][1]+"m":e}function c(e,t){return e}function d(e,r,n){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return v(i)||(i=d(e,i,n)),i}var a=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}(e,r);if(a)return a;var s=Object.keys(r),o=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),E(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return f(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(T(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return f(r)}var l,h="",c=!1,M=["{","}"];return y(r)&&(c=!0,M=["[","]"]),A(r)&&(h=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(h=" "+RegExp.prototype.toString.call(r)),T(r)&&(h=" "+Date.prototype.toUTCString.call(r)),E(r)&&(h=" "+f(r)),0!==s.length||c&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),l=c?function(e,t,r,n,i){for(var a=[],s=0,o=t.length;s<o;++s)I(t,String(s))?a.push(p(e,t,r,n,String(s),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(p(e,t,r,n,i,!0))})),a}(e,r,n,o,s):s.map((function(t){return p(e,r,n,o,t,c)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(l,h,M)):M[0]+h+M[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,a){var s,o,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?o=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(o=e.stylize("[Setter]","special")),I(n,i)||(s="["+i+"]"),o||(e.seen.indexOf(u.value)<0?(o=b(r)?d(e,u.value,null):d(e,u.value,r-1)).indexOf("\n")>-1&&(o=a?o.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+o.split("\n").map((function(e){return" "+e})).join("\n")):o=e.stylize("[Circular]","special")),w(s)){if(a&&i.match(/^\d+$/))return o;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+o}function y(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function b(e){return null===e}function g(e){return"number"==typeof e}function v(e){return"string"==typeof e}function w(e){return void 0===e}function _(e){return M(e)&&"[object RegExp]"===x(e)}function M(e){return"object"==typeof e&&null!==e}function T(e){return M(e)&&"[object Date]"===x(e)}function E(e){return M(e)&&("[object Error]"===x(e)||e instanceof Error)}function A(e){return"function"==typeof e}function x(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(o.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(5955),t.isArray=y,t.isBoolean=m,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=_,t.types.isRegExp=_,t.isObject=M,t.isDate=T,t.types.isDate=T,t.isError=E,t.types.isNativeError=E,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(384);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),S[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(5717),t._extend=function(e,t){if(!t||!M(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var C="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(C&&e[C]){var t;if("function"!=typeof(t=e[C]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),C&&Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=C,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var a=this,s=function(){return i.apply(a,arguments)};e.apply(this,t).then((function(e){n.nextTick(s.bind(null,null,e))}),(function(e){n.nextTick(O.bind(null,e,s))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},6988:e=>{e.exports=function e(n,i){var a,s=0,o=0,u=i=i||0,l=n.length;do{if(u>=l||o>49)throw e.bytes=0,new RangeError("Could not decode varint");a=n[u++],s+=o<28?(a&r)<<o:(a&r)*Math.pow(2,o),o+=7}while(a>=t);return e.bytes=u-i,s};var t=128,r=127},1312:e=>{e.exports=function e(i,a,s){if(Number.MAX_SAFE_INTEGER&&i>Number.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint");a=a||[];for(var o=s=s||0;i>=n;)a[s++]=255&i|t,i/=128;for(;i&r;)a[s++]=255&i|t,i>>>=7;return a[s]=0|i,e.bytes=s-o+1,a};var t=128,r=-128,n=Math.pow(2,31)},4676:(e,t,r)=>{e.exports={encode:r(1312),decode:r(6988),encodingLength:r(82)}},82:e=>{var t=Math.pow(2,7),r=Math.pow(2,14),n=Math.pow(2,21),i=Math.pow(2,28),a=Math.pow(2,35),s=Math.pow(2,42),o=Math.pow(2,49),u=Math.pow(2,56),l=Math.pow(2,63);e.exports=function(e){return e<t?1:e<r?2:e<n?3:e<i?4:e<a?5:e<s?6:e<o?7:e<u?8:e<l?9:10}},6430:(e,t,r)=>{var n=r(4029),i=r(3083),a=r(1924),s=r(7296),o=a("Object.prototype.toString"),u=r(6410)(),l="undefined"==typeof globalThis?r.g:globalThis,h=i(),c=a("String.prototype.slice"),d={},f=Object.getPrototypeOf;u&&s&&f&&n(h,(function(e){if("function"==typeof l[e]){var t=new l[e];if(Symbol.toStringTag in t){var r=f(t),n=s(r,Symbol.toStringTag);if(!n){var i=f(r);n=s(i,Symbol.toStringTag)}d[e]=n.get}}}));var p=r(5692);e.exports=function(e){return!!p(e)&&(u&&Symbol.toStringTag in e?function(e){var t=!1;return n(d,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):c(o(e),8,-1))}},950:()=>{},6601:()=>{},9214:()=>{},8623:()=>{},7748:()=>{},5568:()=>{},6619:()=>{},7108:()=>{},2361:()=>{},4616:()=>{},3083:(e,t,r)=>{var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},4946:e=>{e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},5207:e=>{e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},1308:e=>{e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},3208:e=>{e.exports=JSON.parse('{"O_RDONLY":0,"O_WRONLY":1,"O_RDWR":2,"S_IFMT":61440,"S_IFREG":32768,"S_IFDIR":16384,"S_IFCHR":8192,"S_IFBLK":24576,"S_IFIFO":4096,"S_IFLNK":40960,"S_IFSOCK":49152,"O_CREAT":512,"O_EXCL":2048,"O_NOCTTY":131072,"O_TRUNC":1024,"O_APPEND":8,"O_DIRECTORY":1048576,"O_NOFOLLOW":256,"O_SYNC":128,"O_SYMLINK":2097152,"O_NONBLOCK":4,"S_IRWXU":448,"S_IRUSR":256,"S_IWUSR":128,"S_IXUSR":64,"S_IRWXG":56,"S_IRGRP":32,"S_IWGRP":16,"S_IXGRP":8,"S_IRWXO":7,"S_IROTH":4,"S_IWOTH":2,"S_IXOTH":1,"E2BIG":7,"EACCES":13,"EADDRINUSE":48,"EADDRNOTAVAIL":49,"EAFNOSUPPORT":47,"EAGAIN":35,"EALREADY":37,"EBADF":9,"EBADMSG":94,"EBUSY":16,"ECANCELED":89,"ECHILD":10,"ECONNABORTED":53,"ECONNREFUSED":61,"ECONNRESET":54,"EDEADLK":11,"EDESTADDRREQ":39,"EDOM":33,"EDQUOT":69,"EEXIST":17,"EFAULT":14,"EFBIG":27,"EHOSTUNREACH":65,"EIDRM":90,"EILSEQ":92,"EINPROGRESS":36,"EINTR":4,"EINVAL":22,"EIO":5,"EISCONN":56,"EISDIR":21,"ELOOP":62,"EMFILE":24,"EMLINK":31,"EMSGSIZE":40,"EMULTIHOP":95,"ENAMETOOLONG":63,"ENETDOWN":50,"ENETRESET":52,"ENETUNREACH":51,"ENFILE":23,"ENOBUFS":55,"ENODATA":96,"ENODEV":19,"ENOENT":2,"ENOEXEC":8,"ENOLCK":77,"ENOLINK":97,"ENOMEM":12,"ENOMSG":91,"ENOPROTOOPT":42,"ENOSPC":28,"ENOSR":98,"ENOSTR":99,"ENOSYS":78,"ENOTCONN":57,"ENOTDIR":20,"ENOTEMPTY":66,"ENOTSOCK":38,"ENOTSUP":45,"ENOTTY":25,"ENXIO":6,"EOPNOTSUPP":102,"EOVERFLOW":84,"EPERM":1,"EPIPE":32,"EPROTO":100,"EPROTONOSUPPORT":43,"EPROTOTYPE":41,"ERANGE":34,"EROFS":30,"ESPIPE":29,"ESRCH":3,"ESTALE":70,"ETIME":101,"ETIMEDOUT":60,"ETXTBSY":26,"EWOULDBLOCK":35,"EXDEV":18,"SIGHUP":1,"SIGINT":2,"SIGQUIT":3,"SIGILL":4,"SIGTRAP":5,"SIGABRT":6,"SIGIOT":6,"SIGBUS":10,"SIGFPE":8,"SIGKILL":9,"SIGUSR1":30,"SIGSEGV":11,"SIGUSR2":31,"SIGPIPE":13,"SIGALRM":14,"SIGTERM":15,"SIGCHLD":20,"SIGCONT":19,"SIGSTOP":17,"SIGTSTP":18,"SIGTTIN":21,"SIGTTOU":22,"SIGURG":16,"SIGXCPU":24,"SIGXFSZ":25,"SIGVTALRM":26,"SIGPROF":27,"SIGWINCH":28,"SIGIO":23,"SIGSYS":12,"SSL_OP_ALL":2147486719,"SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION":262144,"SSL_OP_CIPHER_SERVER_PREFERENCE":4194304,"SSL_OP_CISCO_ANYCONNECT":32768,"SSL_OP_COOKIE_EXCHANGE":8192,"SSL_OP_CRYPTOPRO_TLSEXT_BUG":2147483648,"SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS":2048,"SSL_OP_EPHEMERAL_RSA":0,"SSL_OP_LEGACY_SERVER_CONNECT":4,"SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER":32,"SSL_OP_MICROSOFT_SESS_ID_BUG":1,"SSL_OP_MSIE_SSLV2_RSA_PADDING":0,"SSL_OP_NETSCAPE_CA_DN_BUG":536870912,"SSL_OP_NETSCAPE_CHALLENGE_BUG":2,"SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG":1073741824,"SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG":8,"SSL_OP_NO_COMPRESSION":131072,"SSL_OP_NO_QUERY_MTU":4096,"SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION":65536,"SSL_OP_NO_SSLv2":16777216,"SSL_OP_NO_SSLv3":33554432,"SSL_OP_NO_TICKET":16384,"SSL_OP_NO_TLSv1":67108864,"SSL_OP_NO_TLSv1_1":268435456,"SSL_OP_NO_TLSv1_2":134217728,"SSL_OP_PKCS1_CHECK_1":0,"SSL_OP_PKCS1_CHECK_2":0,"SSL_OP_SINGLE_DH_USE":1048576,"SSL_OP_SINGLE_ECDH_USE":524288,"SSL_OP_SSLEAY_080_CLIENT_DH_BUG":128,"SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG":0,"SSL_OP_TLS_BLOCK_PADDING_BUG":512,"SSL_OP_TLS_D5_BUG":256,"SSL_OP_TLS_ROLLBACK_BUG":8388608,"ENGINE_METHOD_DSA":2,"ENGINE_METHOD_DH":4,"ENGINE_METHOD_RAND":8,"ENGINE_METHOD_ECDH":16,"ENGINE_METHOD_ECDSA":32,"ENGINE_METHOD_CIPHERS":64,"ENGINE_METHOD_DIGESTS":128,"ENGINE_METHOD_STORE":256,"ENGINE_METHOD_PKEY_METHS":512,"ENGINE_METHOD_PKEY_ASN1_METHS":1024,"ENGINE_METHOD_ALL":65535,"ENGINE_METHOD_NONE":0,"DH_CHECK_P_NOT_SAFE_PRIME":2,"DH_CHECK_P_NOT_PRIME":1,"DH_UNABLE_TO_CHECK_GENERATOR":4,"DH_NOT_SUITABLE_GENERATOR":8,"NPN_ENABLED":1,"RSA_PKCS1_PADDING":1,"RSA_SSLV23_PADDING":2,"RSA_NO_PADDING":3,"RSA_PKCS1_OAEP_PADDING":4,"RSA_X931_PADDING":5,"RSA_PKCS1_PSS_PADDING":6,"POINT_CONVERSION_COMPRESSED":2,"POINT_CONVERSION_UNCOMPRESSED":4,"POINT_CONVERSION_HYBRID":6,"F_OK":0,"R_OK":4,"W_OK":2,"X_OK":1,"UV_UDP_REUSEADDR":4}')},9799:e=>{e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},8597:e=>{e.exports={i8:"6.5.4"}},2562:e=>{e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={id:e,loaded:!1,exports:{}};return r[e].call(a.exports,a,a.exports,i),a.loaded=!0,a.exports}i.amdO={},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var a=Object.create(null);i.r(a);var s={};e=e||[null,t({}),t([]),t(t)];for(var o=2&n&&r;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach((e=>s[e]=()=>r[e]));return s.default=()=>r,i.d(a,s),a},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var a={};(()=>{i.d(a,{j:()=>Bv,U:()=>Dv});var e={};i.r(e),i.d(e,{arrayify:()=>j,defaultAbiCoder:()=>Kt,formatUnits:()=>Gr,getAddress:()=>Ge,hexlify:()=>H,isAddress:()=>Ke,keccak256:()=>Ie,namehash:()=>br,parseUnits:()=>Kr,randomBytes:()=>kr,sha256:()=>Mr});var t={};i.r(t),i.d(t,{identity:()=>gn});var r={};i.r(r),i.d(r,{base2:()=>vn});var n={};i.r(n),i.d(n,{base8:()=>wn});var s={};i.r(s),i.d(s,{base10:()=>_n});var o={};i.r(o),i.d(o,{base16:()=>Mn,base16upper:()=>Tn});var u={};i.r(u),i.d(u,{base32:()=>En,base32hex:()=>Sn,base32hexpad:()=>Cn,base32hexpadupper:()=>On,base32hexupper:()=>In,base32pad:()=>xn,base32padupper:()=>kn,base32upper:()=>An,base32z:()=>Rn});var l={};i.r(l),i.d(l,{base36:()=>Nn,base36upper:()=>Pn});var h={};i.r(h),i.d(h,{base58btc:()=>Bn,base58flickr:()=>Dn});var c={};i.r(c),i.d(c,{base64:()=>Ln,base64pad:()=>Fn,base64url:()=>Un,base64urlpad:()=>jn});var d={};i.r(d),i.d(d,{base256emoji:()=>Kn});var f={};i.r(f),i.d(f,{sha256:()=>yi,sha512:()=>mi});var p={};i.r(p),i.d(p,{identity:()=>gi});var y={};i.r(y),i.d(y,{code:()=>wi,decode:()=>Mi,encode:()=>_i,name:()=>vi});var m={};i.r(m),i.d(m,{code:()=>xi,decode:()=>Si,encode:()=>ki,name:()=>Ai});var b={};i.r(b),i.d(b,{Web3Provider:()=>yc,yl:()=>bc});var g={};i.r(g),i.d(g,{exclude:()=>Ty,extract:()=>by,parse:()=>gy,parseUrl:()=>wy,pick:()=>My,stringify:()=>vy,stringifyUrl:()=>_y});var v=i(1227),w=i(8764),_=i(3550),M=i.n(_),T=(i(5733),i(6807),i(8826));let E=!1,A=!1;const x={debug:1,default:2,info:2,warning:3,error:4,off:5};let k=x.default,S=null;const I=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var C,O;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(C||(C={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(O||(O={}));const R="0123456789abcdef";class N{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==x[r]&&this.throwArgumentError("invalid log level name","logLevel",e),k>x[r]||console.log.apply(console,t)}debug(...e){this._log(N.levels.DEBUG,e)}info(...e){this._log(N.levels.INFO,e)}warn(...e){this._log(N.levels.WARNING,e)}makeError(e,t,r){if(A)return this.makeError("censored error",t,{});t||(t=N.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=R[t[e]>>4],r+=R[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let a="";switch(t){case O.NUMERIC_FAULT:{a="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":a+="-"+t;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result"}break}case O.CALL_EXCEPTION:case O.INSUFFICIENT_FUNDS:case O.MISSING_NEW:case O.NONCE_EXPIRED:case O.REPLACEMENT_UNDERPRICED:case O.TRANSACTION_REPLACED:case O.UNPREDICTABLE_GAS_LIMIT:a=t}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const s=new Error(e);return s.reason=i,s.code=t,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,N.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),I&&this.throwError("platform missing String.prototype.normalize",N.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:I})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,N.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,N.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,N.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,N.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",N.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",N.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",N.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return S||(S=new N("logger/5.7.0")),S}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",N.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),E){if(!e)return;this.globalLogger().throwError("error censorship permanent",N.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}A=!!e,E=!!t}static setLogLevel(e){const t=x[e.toLowerCase()];null!=t?k=t:N.globalLogger().warn("invalid log level - "+e)}static from(e){return new N(e)}}N.errors=O,N.levels=C;const P=new N("bytes/5.7.0");function B(e){return!!e.toHexString}function D(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return D(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function L(e){return G(e)&&!(e.length%2)||U(e)}function F(e){return"number"==typeof e&&e==e&&e%1==0}function U(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!F(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!F(r)||r<0||r>=256)return!1}return!0}function j(e,t){if(t||(t={}),"number"==typeof e){P.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),D(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),B(e)&&(e=e.toHexString()),G(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":P.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;e<r.length;e+=2)n.push(parseInt(r.substring(e,e+2),16));return D(new Uint8Array(n))}return U(e)?D(new Uint8Array(e)):P.throwArgumentError("invalid arrayify value","value",e)}function q(e){const t=e.map((e=>j(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),D(n)}function z(e){let t=j(e);if(0===t.length)return t;let r=0;for(;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function G(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const K="0123456789abcdef";function H(e,t){if(t||(t={}),"number"==typeof e){P.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=K[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),B(e))return e.toHexString();if(G(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":P.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(U(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+=K[(240&n)>>4]+K[15&n]}return t}return P.throwArgumentError("invalid hexlify value","value",e)}function $(e){if("string"!=typeof e)e=H(e);else if(!G(e)||e.length%2)return null;return(e.length-2)/2}function V(e,t,r){return"string"!=typeof e?e=H(e):(!G(e)||e.length%2)&&P.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function W(e){let t="0x";return e.forEach((e=>{t+=H(e).substring(2)})),t}function Z(e){const t=function(e){"string"!=typeof e&&(e=H(e)),G(e)||P.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}(H(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function J(e,t){for("string"!=typeof e?e=H(e):G(e)||P.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&P.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Y(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(L(e)){let r=j(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=H(r.slice(0,32)),t.s=H(r.slice(32,64))):65===r.length?(t.r=H(r.slice(0,32)),t.s=H(r.slice(32,64)),t.v=r[64]):P.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:P.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=H(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=function(e,t){(e=j(e)).length>t&&P.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),D(r)}(j(t._vs),32);t._vs=H(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&P.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=H(r);null==t.s?t.s=i:t.s!==i&&P.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?P.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&P.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&G(t.r)?t.r=J(t.r,32):P.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&G(t.s)?t.s=J(t.s,32):P.throwArgumentError("signature missing or invalid s","signature",e);const r=j(t.s);r[0]>=128&&P.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=H(r);t._vs&&(G(t._vs)||P.throwArgumentError("signature invalid _vs","signature",e),t._vs=J(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&P.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function X(e){return H(q([(e=Y(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var Q=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{u(n.next(e))}catch(e){a(e)}}function o(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}u((n=n.apply(e,t||[])).next())}))};const ee=new N("properties/5.7.0");function te(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function re(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function ne(e){return Q(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function ie(e,t){e&&"object"==typeof e||ee.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||ee.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function ae(e){const t={};for(const r in e)t[r]=e[r];return t}const se={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function oe(e){if(null==e||se[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch(e){continue}if(!oe(n))return!1}return!0}return ee.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ue(e){if(oe(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>le(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&te(t,r,le(n))}return t}return ee.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function le(e){return ue(e)}class he{constructor(e){for(const t in e)this[t]=le(e[t])}}const ce="abi/5.7.0",de="bignumber/5.7.0";var fe=M().BN;const pe=new N(de),ye={},me=9007199254740991;let be=!1;class ge{constructor(e,t){e!==ye&&pe.throwError("cannot call constructor directly; use BigNumber.from",N.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return we(_e(this).fromTwos(e))}toTwos(e){return we(_e(this).toTwos(e))}abs(){return"-"===this._hex[0]?ge.from(this._hex.substring(1)):this}add(e){return we(_e(this).add(_e(e)))}sub(e){return we(_e(this).sub(_e(e)))}div(e){return ge.from(e).isZero()&&Me("division-by-zero","div"),we(_e(this).div(_e(e)))}mul(e){return we(_e(this).mul(_e(e)))}mod(e){const t=_e(e);return t.isNeg()&&Me("division-by-zero","mod"),we(_e(this).umod(t))}pow(e){const t=_e(e);return t.isNeg()&&Me("negative-power","pow"),we(_e(this).pow(t))}and(e){const t=_e(e);return(this.isNegative()||t.isNeg())&&Me("unbound-bitwise-result","and"),we(_e(this).and(t))}or(e){const t=_e(e);return(this.isNegative()||t.isNeg())&&Me("unbound-bitwise-result","or"),we(_e(this).or(t))}xor(e){const t=_e(e);return(this.isNegative()||t.isNeg())&&Me("unbound-bitwise-result","xor"),we(_e(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Me("negative-width","mask"),we(_e(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Me("negative-width","shl"),we(_e(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Me("negative-width","shr"),we(_e(this).shrn(e))}eq(e){return _e(this).eq(_e(e))}lt(e){return _e(this).lt(_e(e))}lte(e){return _e(this).lte(_e(e))}gt(e){return _e(this).gt(_e(e))}gte(e){return _e(this).gte(_e(e))}isNegative(){return"-"===this._hex[0]}isZero(){return _e(this).isZero()}toNumber(){try{return _e(this).toNumber()}catch(e){Me("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return pe.throwError("this platform does not support BigInt",N.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?be||(be=!0,pe.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?pe.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",N.errors.UNEXPECTED_ARGUMENT,{}):pe.throwError("BigNumber.toString does not accept parameters",N.errors.UNEXPECTED_ARGUMENT,{})),_e(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof ge)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new ge(ye,ve(e)):e.match(/^-?[0-9]+$/)?new ge(ye,ve(new fe(e))):pe.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&Me("underflow","BigNumber.from",e),(e>=me||e<=-me)&&Me("overflow","BigNumber.from",e),ge.from(String(e));const t=e;if("bigint"==typeof t)return ge.from(t.toString());if(U(t))return ge.from(H(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return ge.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(G(e)||"-"===e[0]&&G(e.substring(1))))return ge.from(e)}return pe.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function ve(e){if("string"!=typeof e)return ve(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&pe.throwArgumentError("invalid hex","value",e),"0x00"===(e=ve(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function we(e){return ge.from(ve(e))}function _e(e){const t=ge.from(e).toHexString();return"-"===t[0]?new fe("-"+t.substring(3),16):new fe(t.substring(2),16)}function Me(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),pe.throwError(e,N.errors.NUMERIC_FAULT,n)}const Te=new N(ce);class Ee{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Te.throwArgumentError(e,this.localName,t)}}class Ae{constructor(e){te(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return W(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(q(e._data))}writeBytes(e){let t=j(e);const r=t.length%this.wordSize;return r&&(t=q([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=j(ge.from(e));return t.length>this.wordSize&&Te.throwError("value out-of-bounds",N.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=q([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class xe{constructor(e,t,r,n){te(this,"_data",j(e)),te(this,"wordSize",t||32),te(this,"_coerceFunc",r),te(this,"allowLoose",n),this._offset=0}get data(){return H(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):xe.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:Te.throwError("data out-of-bounds",N.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new xe(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return ge.from(this.readBytes(this.wordSize))}}var ke=i(1094),Se=i.n(ke);function Ie(e){return"0x"+Se().keccak_256(j(e))}const Ce=new N("rlp/5.7.0");function Oe(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function Re(e,t,r){let n=0;for(let i=0;i<r;i++)n=256*n+e[t+i];return n}function Ne(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(Ne(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=Oe(t.length);return r.unshift(247+r.length),r.concat(t)}L(e)||Ce.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(j(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=Oe(t.length);return r.unshift(183+r.length),r.concat(t)}function Pe(e){return H(Ne(e))}function Be(e,t,r,n){const i=[];for(;r<t+1+n;){const a=De(e,r);i.push(a.result),(r+=a.consumed)>t+1+n&&Ce.throwError("child data too short",N.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function De(e,t){if(0===e.length&&Ce.throwError("data too short",N.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&Ce.throwError("data short segment too short",N.errors.BUFFER_OVERRUN,{});const n=Re(e,t+1,r);return t+1+r+n>e.length&&Ce.throwError("data long segment too short",N.errors.BUFFER_OVERRUN,{}),Be(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&Ce.throwError("data array too short",N.errors.BUFFER_OVERRUN,{}),Be(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&Ce.throwError("data array too short",N.errors.BUFFER_OVERRUN,{});const n=Re(e,t+1,r);return t+1+r+n>e.length&&Ce.throwError("data array too short",N.errors.BUFFER_OVERRUN,{}),{consumed:1+r+n,result:H(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;return t+1+r>e.length&&Ce.throwError("data too short",N.errors.BUFFER_OVERRUN,{}),{consumed:1+r,result:H(e.slice(t+1,t+1+r))}}return{consumed:1,result:H(e[t])}}function Le(e){const t=j(e),r=De(t,0);return r.consumed!==t.length&&Ce.throwArgumentError("invalid rlp data","data",e),r.result}const Fe=new N("address/5.7.0");function Ue(e){G(e,20)||Fe.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=j(Ie(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const je={};for(let e=0;e<10;e++)je[String(e)]=String(e);for(let e=0;e<26;e++)je[String.fromCharCode(65+e)]=String(10+e);const qe=Math.floor((ze=9007199254740991,Math.log10?Math.log10(ze):Math.log(ze)/Math.LN10));var ze;function Ge(e){let t=null;if("string"!=typeof e&&Fe.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=Ue(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&Fe.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>je[e])).join("");for(;t.length>=qe;){let e=t.substring(0,qe);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}(e)&&Fe.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new fe(r,36).toString(16);t.length<40;)t="0"+t;t=Ue("0x"+t)}else Fe.throwArgumentError("invalid address","address",e);var r;return t}function Ke(e){try{return Ge(e),!0}catch(e){}return!1}function He(e){let t=null;try{t=Ge(e.from)}catch(t){Fe.throwArgumentError("missing from address","transaction",e)}return Ge(V(Ie(Pe([t,z(j(ge.from(e.nonce).toHexString()))])),12))}class $e extends Ee{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=Ge(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return Ge(J(e.readValue().toHexString(),20))}}class Ve extends Ee{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const We=new N(ce);function Ze(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||We.throwError("cannot encode object for signature with missing names",N.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&We.throwError("cannot encode object for signature with duplicate names",N.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else We.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&We.throwArgumentError("types/value length mismatch","tuple",r);let i=new Ae(e.wordSize),a=new Ae(e.wordSize),s=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=a.length;e.encode(a,r);let n=i.writeUpdatableValue();s.push((e=>{n(e+t)}))}else e.encode(i,r)})),s.forEach((e=>{e(i.length)}));let o=e.appendWriter(i);return o+=e.appendWriter(a),o}function Je(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),a=n.subReader(r.toNumber());try{i=t.decode(a)}catch(e){if(e.code===N.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===N.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));const i=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const a=r[t];a instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw a}}):r[n]=a}));for(let e=0;e<r.length;e++){const t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(r)}class Ye extends Ee{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),We.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let e=0;e<t.length;e++)n.push(this.coder);return Ze(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&We.throwError("insufficient data length",N.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e<t;e++)r.push(new Ve(this.coder));return e.coerce(this.name,Je(e,r))}}class Xe extends Ee{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class Qe extends Ee{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=j(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class et extends Qe{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,H(super.decode(e)))}}class tt extends Ee{constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=j(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,H(e.readBytes(this.size)))}}class rt extends Ee{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}const nt=ge.from(-1),it=ge.from(0),at=ge.from(1),st=ge.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class ot extends Ee{constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let r=ge.from(t),n=st.mask(8*e.wordSize);if(this.signed){let e=n.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(at).mul(nt)))&&this._throwError("value out-of-bounds",t)}else(r.lt(it)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}const ut=new N("strings/5.7.0");var lt,ht;function ct(e,t,r,n,i){if(e===ht.BAD_PREFIX||e===ht.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===ht.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(lt||(lt={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(ht||(ht={}));const dt=Object.freeze({error:function(e,t,r,n,i){return ut.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:ct,replace:function(e,t,r,n,i){return e===ht.OVERLONG?(n.push(i),0):(n.push(65533),ct(e,t,r))}});function ft(e,t){null==t&&(t=dt.error),e=j(e);const r=[];let n=0;for(;n<e.length;){const i=e[n++];if(i>>7==0){r.push(i);continue}let a=null,s=null;if(192==(224&i))a=1,s=127;else if(224==(240&i))a=2,s=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?ht.UNEXPECTED_CONTINUE:ht.BAD_PREFIX,n-1,e,r);continue}a=3,s=65535}if(n-1+a>=e.length){n+=t(ht.OVERRUN,n-1,e,r);continue}let o=i&(1<<8-a-1)-1;for(let i=0;i<a;i++){let i=e[n];if(128!=(192&i)){n+=t(ht.MISSING_CONTINUE,n,e,r),o=null;break}o=o<<6|63&i,n++}null!==o&&(o>1114111?n+=t(ht.OUT_OF_RANGE,n-1-a,e,r,o):o>=55296&&o<=57343?n+=t(ht.UTF16_SURROGATE,n-1-a,e,r,o):o<=s?n+=t(ht.OVERLONG,n-1-a,e,r,o):r.push(o))}return r}function pt(e,t=lt.current){t!=lt.current&&(ut.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const a=65536+((1023&n)<<10)+(1023&i);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return j(r)}function yt(e,t){return ft(e,t).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}class mt extends Qe{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,pt(t))}decode(e){return yt(super.decode(e))}}class bt extends Ee{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)})),super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}encode(e,t){return Ze(e,this.coders,t)}decode(e){return e.coerce(this.name,Je(e,this.coders))}}const gt=new N(ce),vt={};let wt={calldata:!0,memory:!0,storage:!0},_t={calldata:!0,memory:!0};function Mt(e,t){if("bytes"===e||"string"===e){if(wt[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&_t[t])return!0;return(wt[t]||"payable"===t)&>.throwArgumentError("invalid modifier","name",t),!1}function Tt(e,t){for(let r in t)te(e,r,t[r])}const Et=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),At=new RegExp(/^(.*)\[([0-9]*)\]$/);class xt{constructor(e,t){e!==vt&>.throwError("use fromString",N.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Tt(this,t);let r=this.type.match(At);Tt(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:xt.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Et.sighash),Et[e]||gt.throwArgumentError("invalid format type","format",e),e===Et.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Et.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Et.full?", ":",")+")"):t+=this.type,e!==Et.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Et.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?xt.fromString(e,t):xt.fromObject(e)}static fromObject(e){return xt.isParamType(e)?e:new xt(vt,{name:e.name||null,type:Lt(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(xt.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){gt.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let a={type:"",name:"",state:{allowType:!0}},s=a;for(let r=0;r<e.length;r++){let a=e[r];switch(a){case"(":s.state.allowType&&""===s.type?s.type="tuple":s.state.allowParams||n(r),s.state.allowType=!1,s.type=Lt(s.type),s.components=[i(s)],s=s.components[0];break;case")":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),Mt(s.type,s.name)&&(s.name=""),s.type=Lt(s.type);let e=s;s=s.parent,s||n(r),delete e.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),Mt(s.type,s.name)&&(s.name=""),s.type=Lt(s.type);let o=i(s.parent);s.parent.components.push(o),delete s.parent,s=o;break;case" ":s.state.allowType&&""!==s.type&&(s.type=Lt(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&""!==s.name&&("indexed"===s.name?(t||n(r),s.indexed&&n(r),s.indexed=!0,s.name=""):Mt(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||n(r),s.type+=a,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||n(r),s.type+=a,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=a,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=a,delete s.state.allowArray):s.state.readArray?s.type+=a:n(r)}}return s.parent&>.throwArgumentError("unexpected eof","param",e),delete a.state,"indexed"===s.name?(t||n(r.length-7),s.indexed&&n(r.length-7),s.indexed=!0,s.name=""):Mt(s.type,s.name)&&(s.name=""),a.type=Lt(a.type),a}(e,!!t),xt.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}}function kt(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let i=0;i<e.length;i++){let a=e[i];","===a&&0===n?(t.push(r),r=""):(r+=a,"("===a?n++:")"===a&&(n--,-1===n&>.throwArgumentError("unbalanced parenthesis","value",e)))}return r&&t.push(r),t}(e).map((e=>xt.fromString(e,t)))}class St{constructor(e,t){e!==vt&>.throwError("use a static from method",N.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Tt(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return St.isFragment(e)?e:"string"==typeof e?St.fromString(e):St.fromObject(e)}static fromObject(e){if(St.isFragment(e))return e;switch(e.type){case"function":return Pt.fromObject(e);case"event":return It.fromObject(e);case"constructor":return Nt.fromObject(e);case"error":return Dt.fromObject(e);case"fallback":case"receive":return null}return gt.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?It.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Pt.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Nt.fromString(e.trim()):"error"===e.split(" ")[0]?Dt.fromString(e.substring(5).trim()):gt.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class It extends St{format(e){if(e||(e=Et.sighash),Et[e]||gt.throwArgumentError("invalid format type","format",e),e===Et.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Et.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Et.full?", ":",")+") ",e!==Et.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?It.fromString(e):It.fromObject(e)}static fromObject(e){if(It.isEventFragment(e))return e;"event"!==e.type&>.throwArgumentError("invalid event object","value",e);const t={name:Ut(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(xt.fromObject):[],type:"event"};return new It(vt,t)}static fromString(e){let t=e.match(jt);t||gt.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:gt.warn("unknown modifier: "+e)}})),It.fromObject({name:t[1].trim(),anonymous:r,inputs:kt(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Ct(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&>.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||gt.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=ge.from(r[1]),r[0]):e}function Ot(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Rt(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&>.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&>.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||gt.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&>.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&>.throwArgumentError("unable to determine stateMutability","value",e),t}class Nt extends St{format(e){if(e||(e=Et.sighash),Et[e]||gt.throwArgumentError("invalid format type","format",e),e===Et.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Et.sighash&>.throwError("cannot format a constructor for sighash",N.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Et.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?Nt.fromString(e):Nt.fromObject(e)}static fromObject(e){if(Nt.isConstructorFragment(e))return e;"constructor"!==e.type&>.throwArgumentError("invalid constructor object","value",e);let t=Rt(e);t.constant&>.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(xt.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?ge.from(e.gas):null};return new Nt(vt,r)}static fromString(e){let t={type:"constructor"},r=(e=Ct(e,t)).match(jt);return r&&"constructor"===r[1].trim()||gt.throwArgumentError("invalid constructor string","value",e),t.inputs=kt(r[2].trim(),!1),Ot(r[3].trim(),t),Nt.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Pt extends Nt{format(e){if(e||(e=Et.sighash),Et[e]||gt.throwArgumentError("invalid format type","format",e),e===Et.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Et.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Et.full?", ":",")+") ",e!==Et.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?Pt.fromString(e):Pt.fromObject(e)}static fromObject(e){if(Pt.isFunctionFragment(e))return e;"function"!==e.type&>.throwArgumentError("invalid function object","value",e);let t=Rt(e);const r={type:e.type,name:Ut(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(xt.fromObject):[],outputs:e.outputs?e.outputs.map(xt.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?ge.from(e.gas):null};return new Pt(vt,r)}static fromString(e){let t={type:"function"},r=(e=Ct(e,t)).split(" returns ");r.length>2&>.throwArgumentError("invalid function string","value",e);let n=r[0].match(jt);if(n||gt.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Ut(t.name),t.inputs=kt(n[2],!1),Ot(n[3].trim(),t),r.length>1){let n=r[1].match(jt);""==n[1].trim()&&""==n[3].trim()||gt.throwArgumentError("unexpected tokens","value",e),t.outputs=kt(n[2],!1)}else t.outputs=[];return Pt.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function Bt(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||gt.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Dt extends St{format(e){if(e||(e=Et.sighash),Et[e]||gt.throwArgumentError("invalid format type","format",e),e===Et.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Et.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Et.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Dt.fromString(e):Dt.fromObject(e)}static fromObject(e){if(Dt.isErrorFragment(e))return e;"error"!==e.type&>.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Ut(e.name),inputs:e.inputs?e.inputs.map(xt.fromObject):[]};return Bt(new Dt(vt,t))}static fromString(e){let t={type:"error"},r=e.match(jt);return r||gt.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Ut(t.name),t.inputs=kt(r[2],!1),Bt(Dt.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Lt(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Ft=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ut(e){return e&&e.match(Ft)||gt.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const jt=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),qt=new N(ce),zt=new RegExp(/^bytes([0-9]*)$/),Gt=new RegExp(/^(u?int)([0-9]*)$/),Kt=new class{constructor(e){te(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new $e(e.name);case"bool":return new Xe(e.name);case"string":return new mt(e.name);case"bytes":return new et(e.name);case"array":return new Ye(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new bt((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new rt(e.name)}let t=e.type.match(Gt);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&qt.throwArgumentError("invalid "+t[1]+" bit length","param",e),new ot(r/8,"int"===t[1],e.name)}if(t=e.type.match(zt),t){let r=parseInt(t[1]);return(0===r||r>32)&&qt.throwArgumentError("invalid bytes length","param",e),new tt(r,e.name)}return qt.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new xe(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new Ae(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(xt.from(e))));return new bt(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&qt.throwError("types/values length mismatch",N.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(xt.from(e)))),n=new bt(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this._getCoder(xt.from(e))));return new bt(n,"_").decode(this._getReader(j(t),r))}},Ht="hash/5.7.0";function $t(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return j(t)}function Vt(e){e=j(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Wt(e,t){null==t&&(t=1);const r=[],n=r.forEach,i=function(e,t){n.call(e,(function(e){t>0&&Array.isArray(e)?i(e,t-1):r.push(e)}))};return i(e,t),r}function Zt(e){return 1&e?~e>>1:e>>1}function Jt(e,t){let r=Array(e);for(let n=0,i=-1;n<e;n++)r[n]=i+=1+t();return r}function Yt(e,t){let r=Array(e);for(let n=0,i=0;n<e;n++)r[n]=i+=Zt(t());return r}function Xt(e,t){let r=Jt(e(),e),n=e(),i=Jt(n,e),a=function(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}(n,e);for(let e=0;e<n;e++)for(let t=0;t<a[e];t++)r.push(i[e]+t);return t?r.map((e=>t[e])):r}function Qt(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;i<t;i++)Yt(e,r).forEach(((e,t)=>n[t].push(e)));return n}function er(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return Wt(Qt(i.length,1+e,t).map(((e,t)=>{const a=e[0],s=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*n;return[a+t*r,s.map((e=>e+i))]}))})))}function tr(e,t){return Qt(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const rr=function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,a=[0,1];for(let e=1;e<n;e++)a.push(i+=r());let s=r(),o=t;t+=s;let u=0,l=0;function h(){return 0==u&&(l=l<<8|e[t++],u=8),l>>--u&1}const c=Math.pow(2,31),d=c>>>1,f=d>>1,p=c-1;let y=0;for(let e=0;e<31;e++)y=y<<1|h();let m=[],b=0,g=c;for(;;){let e=Math.floor(((y-b+1)*i-1)/g),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<a[n]?r=n:t=n}if(0==t)break;m.push(t);let s=b+Math.floor(g*a[t]/i),o=b+Math.floor(g*a[t+1]/i)-1;for(;0==((s^o)&d);)y=y<<1&p|h(),s=s<<1&p,o=o<<1&p|1;for(;s&~o&f;)y=y&d|y<<1&p>>>1|h(),s=s<<1^d,o=(o^d)<<1|d|1;b=s,g=1+o-s}let v=n-4;return m.map((t=>{switch(t-v){case 3:return v+65792+(e[o++]<<16|e[o++]<<8|e[o++]);case 2:return v+256+(e[o++]<<8|e[o++]);case 1:return v+e[o++];default:return t-1}}))}($t("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))),nr=new Set(Xt(rr)),ir=new Set(Xt(rr)),ar=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(er(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(tr(r,e))}return function(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n[0]]=n[1]}return t}(Wt(t))}(rr),sr=function(e){let t=Xt(e).sort(((e,t)=>e-t));return function r(){let n=[];for(;;){let i=Xt(e,t);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let i=e(),a=i%3;i=i/3|0;let s=!!(1&i);return i>>=1,{branches:n,valid:a,fe0f:s,save:1==i,check:2==i}}()}(rr),or=45,ur=95;function lr(e){return function(e,t=lt.current){return ft(pt(e,t))}(e)}function hr(e){return e.filter((e=>65039!=e))}function cr(e){for(let t of e.split(".")){let e=lr(t);try{for(let t=e.lastIndexOf(ur)-1;t>=0;t--)if(e[t]!==ur)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===or&&e[3]===or)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function dr(e,t){var r;let n,i,a=sr,s=[],o=e.length;for(t&&(t.length=0);o;){let u=e[--o];if(a=null===(r=a.branches.find((e=>e.set.has(u))))||void 0===r?void 0:r.node,!a)break;if(a.save)i=u;else if(a.check&&u===i)break;s.push(u),a.fe0f&&(s.push(65039),o>0&&65039==e[o-1]&&o--),a.valid&&(n=s.slice(),2==a.valid&&n.splice(1,1),t&&t.push(...e.slice(o).reverse()),e.length=o)}return n}const fr=new N(Ht),pr=new Uint8Array(32);function yr(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function mr(e){const t=pt(function(e){return cr(function(e,t){let r=lr(e).reverse(),n=[];for(;r.length;){let e=dr(r);if(e){n.push(...t(e));continue}let i=r.pop();if(nr.has(i)){n.push(i);continue}if(ir.has(i))continue;let a=ar[i];if(!a)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...a)}return cr(String.fromCodePoint(...n).normalize("NFC"))}(e,hr))}(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++)46===t[e]&&(r.push(yr(t.slice(n,e))),n=e+1);if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(yr(t.slice(n))),r}function br(e){"string"!=typeof e&&fr.throwArgumentError("invalid ENS name; not a string","name",e);let t=pr;const r=mr(e);for(;r.length;)t=Ie(q([t,Ie(r.pop())]));return H(t)}pr.fill(0);var gr,vr=i(3715),wr=i.n(vr);!function(e){e.sha256="sha256",e.sha512="sha512"}(gr||(gr={}));const _r=new N("sha2/5.7.0");function Mr(e){return"0x"+wr().sha256().update(j(e)).digest("hex")}function Tr(e,t,r){return gr[e]||_r.throwError("unsupported algorithm "+e,N.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+wr().hmac(wr()[e],j(t)).update(j(r)).digest("hex")}const Er=new N("random/5.7.0"),Ar=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i.g)return i.g;throw new Error("unable to locate global object")}();let xr=Ar.crypto||Ar.msCrypto;function kr(e){(e<=0||e>1024||e%1||e!=e)&&Er.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return xr.getRandomValues(t),j(t)}xr&&xr.getRandomValues||(Er.warn("WARNING: Missing strong random number source"),xr={getRandomValues:function(e){return Er.throwError("no secure random source avaialble",N.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});const Sr=new N(de),Ir={},Cr=ge.from(0),Or=ge.from(-1);function Rr(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),Sr.throwError(e,N.errors.NUMERIC_FAULT,i)}let Nr="0";for(;Nr.length<256;)Nr+=Nr;function Pr(e){if("number"!=typeof e)try{e=ge.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+Nr.substring(0,e):Sr.throwArgumentError("invalid decimal size","decimals",e)}function Br(e,t){null==t&&(t=0);const r=Pr(t),n=(e=ge.from(e)).lt(Cr);n&&(e=e.mul(Or));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(r).toString();return e=1===r.length?a:a+"."+i,n&&(e="-"+e),e}function Dr(e,t){null==t&&(t=0);const r=Pr(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||Sr.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&Sr.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&Sr.throwArgumentError("too many decimal points","value",e);let a=i[0],s=i[1];for(a||(a="0"),s||(s="0");"0"===s[s.length-1];)s=s.substring(0,s.length-1);for(s.length>r.length-1&&Rr("fractional component exceeds decimals","underflow","parseFixed"),""===s&&(s="0");s.length<r.length-1;)s+="0";const o=ge.from(a),u=ge.from(s);let l=o.mul(r).add(u);return n&&(l=l.mul(Or)),l}class Lr{constructor(e,t,r,n){e!==Ir&&Sr.throwError("cannot use FixedFormat constructor; use FixedFormat.from",N.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=Pr(n),Object.freeze(this)}static from(e){if(e instanceof Lr)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||Sr.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],r=parseInt(i[2]),n=parseInt(i[3])}else if(e){const i=(t,r,n)=>null==e[t]?n:(typeof e[t]!==r&&Sr.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&Sr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&Sr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new Lr(Ir,t,r,n)}}class Fr{constructor(e,t,r,n){e!==Ir&&Sr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",N.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Sr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=Dr(this._value,this.format.decimals),r=Dr(e._value,e.format.decimals);return Fr.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=Dr(this._value,this.format.decimals),r=Dr(e._value,e.format.decimals);return Fr.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=Dr(this._value,this.format.decimals),r=Dr(e._value,e.format.decimals);return Fr.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=Dr(this._value,this.format.decimals),r=Dr(e._value,e.format.decimals);return Fr.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Fr.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(Ur.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Fr.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(Ur.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&Sr.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=Fr.from("1"+Nr.substring(0,e),this.format),n=jr.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){return null==e?this._hex:(e%8&&Sr.throwArgumentError("invalid byte width","width",e),J(ge.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Fr.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(ge.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||G(e)||"bigint"==typeof e||U(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),Fr.fromString(Br(e,t),Lr.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=Lr.from(t),n=Dr(e,r.decimals);!r.signed&&n.lt(Cr)&&Rr("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=J(i,r.width/8));const a=Br(n,r.decimals);return new Fr(Ir,i,a,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=Lr.from(t);if(j(e).length>r.width/8)throw new Error("overflow");let n=ge.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),a=Br(n,r.decimals);return new Fr(Ir,i,a,r)}static from(e,t){if("string"==typeof e)return Fr.fromString(e,t);if(U(e))return Fr.fromBytes(e,t);try{return Fr.fromValue(e,0,t)}catch(e){if(e.code!==N.errors.INVALID_ARGUMENT)throw e}return Sr.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const Ur=Fr.from(1),jr=Fr.from("0.5"),qr=new N("units/5.7.0"),zr=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Gr(e,t){if("string"==typeof t){const e=zr.indexOf(t);-1!==e&&(t=3*e)}return Br(e,null!=t?t:18)}function Kr(e,t){if("string"!=typeof e&&qr.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=zr.indexOf(t);-1!==e&&(t=3*e)}return Dr(e,null!=t?t:18)}const Hr="[a-fA-F\\d:]",$r=e=>e&&e.includeBoundaries?`(?:(?<=\\s|^)(?=${Hr})|(?<=${Hr})(?=\\s|$))`:"",Vr="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",Wr="[a-fA-F\\d]{1,4}",Zr=`\n(?:\n(?:${Wr}:){7}(?:${Wr}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:${Wr}:){6}(?:${Vr}|:${Wr}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:${Wr}:){5}(?::${Vr}|(?::${Wr}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:${Wr}:){4}(?:(?::${Wr}){0,1}:${Vr}|(?::${Wr}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:${Wr}:){3}(?:(?::${Wr}){0,2}:${Vr}|(?::${Wr}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:${Wr}:){2}(?:(?::${Wr}){0,3}:${Vr}|(?::${Wr}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:${Wr}:){1}(?:(?::${Wr}){0,4}:${Vr}|(?::${Wr}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::${Wr}){0,5}:${Vr}|(?::${Wr}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),Jr=new RegExp(`(?:^${Vr}$)|(?:^${Zr}$)`),Yr=new RegExp(`^${Vr}$`),Xr=new RegExp(`^${Zr}$`),Qr=e=>e&&e.exact?Jr:new RegExp(`(?:${$r(e)}${Vr}${$r(e)})|(?:${$r(e)}${Zr}${$r(e)})`,"g");Qr.v4=e=>e&&e.exact?Yr:new RegExp(`${$r(e)}${Vr}${$r(e)}`,"g"),Qr.v6=e=>e&&e.exact?Xr:new RegExp(`${$r(e)}${Zr}${$r(e)}`,"g");const en=Qr,{toString:tn}=Object.prototype,rn={global:"g",ignoreCase:"i",multiline:"m",dotAll:"s",sticky:"y",unicode:"u"};function nn(e,t,{timeout:r}={}){try{return function(e){const t=(...t)=>e(...t);return Object.defineProperty(t,"name",{value:`functionTimeout(${e.name||"<anonymous>"})`,configurable:!0}),t}((()=>function(e,t={}){if(r=e,"[object RegExp]"!==tn.call(r))throw new TypeError("Expected a RegExp instance");var r;const n=Object.keys(rn).map((r=>("boolean"==typeof t[r]?t[r]:e[r])?rn[r]:"")).join(""),i=new RegExp(t.source||e.source,n);return i.lastIndex="number"==typeof t.lastIndex?t.lastIndex:e.lastIndex,i}(e).test(t)))()}catch(e){throw e}}const an=45,sn={timeout:400};function on(e){return nn(en({exact:!0}),e.slice(0,an),sn)}const un=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),s=a.charCodeAt(0);if(255!==r[s])throw new TypeError(a+" is ambiguous");r[s]=i}var o=e.length,u=e.charAt(0),l=Math.log(o)/Math.log(256),h=Math.log(256)/Math.log(o);function c(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,i=0;e[t]===u;)n++,t++;for(var a=(e.length-t)*l+1>>>0,s=new Uint8Array(a);e[t];){var h=r[e.charCodeAt(t)];if(255===h)return;for(var c=0,d=a-1;(0!==h||c<i)&&-1!==d;d--,c++)h+=o*s[d]>>>0,s[d]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");i=c,t++}if(" "!==e[t]){for(var f=a-i;f!==a&&0===s[f];)f++;for(var p=new Uint8Array(n+(a-f)),y=n;f!==a;)p[y++]=s[f++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,a=t.length;i!==a&&0===t[i];)i++,r++;for(var s=(a-i)*h+1>>>0,l=new Uint8Array(s);i!==a;){for(var c=t[i],d=0,f=s-1;(0!==c||d<n)&&-1!==f;f--,d++)c+=256*l[f]>>>0,l[f]=c%o>>>0,c=c/o>>>0;if(0!==c)throw new Error("Non-zero carry");n=d,i++}for(var p=s-n;p!==s&&0===l[p];)p++;for(var y=u.repeat(r);p<s;++p)y+=e.charAt(l[p]);return y},decodeUnsafe:c,decode:function(e){var r=c(e);if(r)return r;throw new Error(`Non-${t} character`)}}},ln=(new Uint8Array(0),e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")});class hn{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class cn{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return fn(this,e)}}class dn{constructor(e){this.decoders=e}or(e){return fn(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const fn=(e,t)=>new dn({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class pn{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new hn(e,t,r),this.decoder=new cn(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const yn=({name:e,prefix:t,encode:r,decode:n})=>new pn(e,t,r,n),mn=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=un(r,t);return yn({prefix:e,name:t,encode:n,decode:e=>ln(i(e))})},bn=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>yn({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],i=(1<<r)-1;let a="",s=0,o=0;for(let n=0;n<e.length;++n)for(o=o<<8|e[n],s+=8;s>r;)s-=r,a+=t[i&o>>s];if(s&&(a+=t[i&o<<r-s]),n)for(;a.length*r&7;)a+="=";return a})(e,n,r),decode:t=>((e,t,r,n)=>{const i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let a=e.length;for(;"="===e[a-1];)--a;const s=new Uint8Array(a*r/8|0);let o=0,u=0,l=0;for(let t=0;t<a;++t){const a=i[e[t]];if(void 0===a)throw new SyntaxError(`Non-${n} character`);u=u<<r|a,o+=r,o>=8&&(o-=8,s[l++]=255&u>>o)}if(o>=r||255&u<<8-o)throw new SyntaxError("Unexpected end of data");return s})(t,n,r,e)}),gn=yn({prefix:"\0",name:"identity",encode:e=>{return t=e,(new TextDecoder).decode(t);var t},decode:e=>(e=>(new TextEncoder).encode(e))(e)}),vn=bn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),wn=bn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),_n=mn({prefix:"9",name:"base10",alphabet:"0123456789"}),Mn=bn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Tn=bn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),En=bn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),An=bn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),xn=bn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),kn=bn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Sn=bn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),In=bn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Cn=bn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),On=bn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Rn=bn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Nn=mn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Pn=mn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Bn=mn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Dn=mn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Ln=bn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Fn=bn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Un=bn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),jn=bn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),qn=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),zn=qn.reduce(((e,t,r)=>(e[r]=t,e)),[]),Gn=qn.reduce(((e,t,r)=>(e[t.codePointAt(0)]=r,e)),[]),Kn=yn({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,t)=>e+zn[t]),"")},decode:function(e){const t=[];for(const r of e){const e=Gn[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var Hn=128,$n=-128,Vn=Math.pow(2,31),Wn=128,Zn=127,Jn=Math.pow(2,7),Yn=Math.pow(2,14),Xn=Math.pow(2,21),Qn=Math.pow(2,28),ei=Math.pow(2,35),ti=Math.pow(2,42),ri=Math.pow(2,49),ni=Math.pow(2,56),ii=Math.pow(2,63);const ai={encode:function e(t,r,n){r=r||[];for(var i=n=n||0;t>=Vn;)r[n++]=255&t|Hn,t/=128;for(;t&$n;)r[n++]=255&t|Hn,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r},decode:function e(t,r){var n,i=0,a=0,s=r=r||0,o=t.length;do{if(s>=o)throw e.bytes=0,new RangeError("Could not decode varint");n=t[s++],i+=a<28?(n&Zn)<<a:(n&Zn)*Math.pow(2,a),a+=7}while(n>=Wn);return e.bytes=s-r,i},encodingLength:function(e){return e<Jn?1:e<Yn?2:e<Xn?3:e<Qn?4:e<ei?5:e<ti?6:e<ri?7:e<ni?8:e<ii?9:10}},si=(e,t=0)=>[ai.decode(e,t),ai.decode.bytes],oi=(e,t,r=0)=>(ai.encode(e,t,r),t),ui=e=>ai.encodingLength(e),li=(e,t)=>{const r=t.byteLength,n=ui(e),i=n+ui(r),a=new Uint8Array(i+r);return oi(e,a,0),oi(r,a,n),a.set(t,i),new ci(e,r,t,a)},hi=e=>{const t=ln(e),[r,n]=si(t),[i,a]=si(t.subarray(n)),s=t.subarray(n+a);if(s.byteLength!==i)throw new Error("Incorrect length");return new ci(r,i,s,t)};class ci{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}const di=({name:e,code:t,encode:r})=>new fi(e,t,r);class fi{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?li(this.code,t):t.then((e=>li(this.code,e)))}throw Error("Unknown type, must be binary type")}}const pi=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),yi=di({name:"sha2-256",code:18,encode:pi("SHA-256")}),mi=di({name:"sha2-512",code:19,encode:pi("SHA-512")}),bi=ln,gi={code:0,name:"identity",encode:bi,digest:e=>li(0,bi(e))},vi="raw",wi=85,_i=e=>ln(e),Mi=e=>ln(e),Ti=new TextEncoder,Ei=new TextDecoder,Ai="json",xi=512,ki=e=>Ti.encode(JSON.stringify(e)),Si=e=>JSON.parse(Ei.decode(e));class Ii{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:Fi,byteLength:Fi,code:Li,version:Li,multihash:Li,bytes:Li,_baseCache:Fi,asCID:Fi})}toV0(){if(0===this.version)return this;{const{code:e,multihash:t}=this;if(e!==Ni)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Pi)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Ii.createV0(t)}}toV1(){switch(this.version){case 0:{const{code:e,digest:t}=this.multihash,r=li(e,t);return Ii.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&((t=this.multihash)===(r=e.multihash)||t.code===r.code&&t.size===r.size&&((e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0})(t.bytes,r.bytes));var t,r}toString(e){const{bytes:t,version:r,_baseCache:n}=this;return 0===r?Oi(t,n,e||Bn.encoder):Ri(t,n,e||En.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return Ui(/^0\.0/,ji),!(!e||!e[Di]&&e.asCID!==e)}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof Ii)return e;if(null!=e&&e.asCID===e){const{version:t,code:r,multihash:n,bytes:i}=e;return new Ii(t,r,n,i||Bi(t,r,n.bytes))}if(null!=e&&!0===e[Di]){const{version:t,multihash:r,code:n}=e,i=hi(r);return Ii.create(t,n,i)}return null}static create(e,t,r){if("number"!=typeof t)throw new Error("String codecs are no longer supported");switch(e){case 0:if(t!==Ni)throw new Error(`Version 0 CID must use dag-pb (code: ${Ni}) block encoding`);return new Ii(e,t,r,r.bytes);case 1:{const n=Bi(e,t,r.bytes);return new Ii(e,t,r,n)}default:throw new Error("Invalid version")}}static createV0(e){return Ii.create(0,Ni,e)}static createV1(e,t){return Ii.create(1,e,t)}static decode(e){const[t,r]=Ii.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){const t=Ii.inspectBytes(e),r=t.size-t.multihashSize,n=ln(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");const i=n.subarray(t.multihashSize-t.digestSize),a=new ci(t.multihashCode,t.digestSize,i,n);return[0===t.version?Ii.createV0(a):Ii.createV1(t.codec,a),e.subarray(t.size)]}static inspectBytes(e){let t=0;const r=()=>{const[r,n]=si(e.subarray(t));return t+=n,r};let n=r(),i=Ni;if(18===n?(n=0,t=0):1===n&&(i=r()),0!==n&&1!==n)throw new RangeError(`Invalid CID version ${n}`);const a=t,s=r(),o=r(),u=t+o;return{version:n,codec:i,multihashCode:s,digestSize:o,multihashSize:u-a,size:u}}static parse(e,t){const[r,n]=Ci(e,t),i=Ii.decode(n);return i._baseCache.set(r,e),i}}const Ci=(e,t)=>{switch(e[0]){case"Q":{const r=t||Bn;return[Bn.prefix,r.decode(`${Bn.prefix}${e}`)]}case Bn.prefix:{const r=t||Bn;return[Bn.prefix,r.decode(e)]}case En.prefix:{const r=t||En;return[En.prefix,r.decode(e)]}default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},Oi=(e,t,r)=>{const{prefix:n}=r;if(n!==Bn.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);const i=t.get(n);if(null==i){const i=r.encode(e).slice(1);return t.set(n,i),i}return i},Ri=(e,t,r)=>{const{prefix:n}=r,i=t.get(n);if(null==i){const i=r.encode(e);return t.set(n,i),i}return i},Ni=112,Pi=18,Bi=(e,t,r)=>{const n=ui(e),i=n+ui(t),a=new Uint8Array(i+r.byteLength);return oi(e,a,0),oi(t,a,n),a.set(r,i),a},Di=Symbol.for("@ipld/js-cid/CID"),Li={writable:!1,configurable:!1,enumerable:!0},Fi={writable:!1,enumerable:!1,configurable:!1},Ui=(e,t)=>{if(!e.test("0.0.0-dev"))throw new Error(t);console.warn(t)},ji="CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) {\n doSomethingWithCID(value)\n}\n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) {\n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n}\n",qi={...t,...r,...n,...s,...o,...u,...l,...h,...c,...d};function zi(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Gi(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?zi(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function Ki(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Hi=Ki("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),$i=Ki("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{const t=Gi((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),Vi={utf8:Hi,"utf-8":Hi,hex:qi.base16,latin1:$i,ascii:$i,binary:$i,...qi};function Wi(e,t="utf8"){const r=Vi[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}const Zi=function(e){return nn(en.v4({exact:!0}),e.slice(0,15),sn)},Ji=function(e){return nn(en.v6({exact:!0}),e.slice(0,an),sn)},Yi=function(e){let t,r=0;if(e=e.trim(),Zi(e))t=new Uint8Array(r+4),e.split(/\./g).forEach((e=>{t[r++]=255&parseInt(e,10)}));else if(Ji(e)){const n=e.split(":",8);let i;for(i=0;i<n.length;i++){let e;Zi(n[i])&&(e=Yi(n[i]),n[i]=Wi(e.slice(0,2),"base16")),null!=e&&++i<8&&n.splice(i,0,Wi(e.slice(2,4),"base16"))}if(""===n[0])for(;n.length<8;)n.unshift("0");else if(""===n[n.length-1])for(;n.length<8;)n.push("0");else if(n.length<8){for(i=0;i<n.length&&""!==n[i];i++);const e=[i,1];for(i=9-n.length;i>0;i--)e.push("0");n.splice.apply(n,e)}for(t=new Uint8Array(r+16),i=0;i<n.length;i++){const e=parseInt(n[i],16);t[r++]=e>>8&255,t[r++]=255&e}}if(null==t)throw new Error(`invalid ip address "${e}"`);return t},Xi=function(e,t=0,r){t=~~t,r=r??e.length-t;const n=[];let i="";const a=new DataView(e.buffer);if(4===r){for(let i=0;i<r;i++)n.push(e[t+i]);i=n.join(".")}else if(16===r){for(let e=0;e<r;e+=2)n.push(a.getUint16(t+e).toString(16));i=n.join(":"),i=i.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3"),i=i.replace(/:{3,4}/,"::")}return i},Qi=-1,ea={},ta={};function ra(e){if("number"==typeof e){if(null!=ta[e])return ta[e];throw new Error(`no protocol with code: ${e}`)}if("string"==typeof e){if(null!=ea[e])return ea[e];throw new Error(`no protocol with name: ${e}`)}throw new Error("invalid protocol id type: "+typeof e)}[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,Qi,"ip6zone"],[53,Qi,"dns",!0],[54,Qi,"dns4",!0],[55,Qi,"dns6",!0],[56,Qi,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,Qi,"unix",!1,!0],[421,Qi,"ipfs"],[421,Qi,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,Qi,"garlic64"],[460,0,"quic"],[465,0,"webtransport"],[466,Qi,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,Qi,"memory"]].forEach((e=>{const t=function(e,t,r,n,i){return{code:e,size:t,name:r,resolvable:Boolean(n),path:Boolean(i)}}(...e);ta[t.code]=t,ea[t.name]=t}));var na=i(4676);function ia(e,t="utf8"){const r=Vi[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode(`${r.prefix}${e}`):zi(globalThis.Buffer.from(e,"utf-8"))}function aa(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=Gi(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return zi(r)}function sa(e,t){switch(ra(e).code){case 4:case 41:return function(e){const t=Xi(e,0,e.length);if(null==t)throw new Error("ipBuff is required");if(!on(t))throw new Error(`invalid ip address "${t}"`);return t}(t);case 6:case 273:case 33:case 132:return ca(t).toString();case 53:case 54:case 55:case 56:case 400:case 777:return function(e){const t=na.decode(e);if((e=e.slice(na.decode.bytes)).length!==t)throw new Error("inconsistent lengths");return Wi(e)}(t);case 421:return function(e){const t=na.decode(e),r=e.slice(na.decode.bytes);if(r.length!==t)throw new Error("inconsistent lengths");return Wi(r,"base58btc")}(t);case 444:case 445:return function(e){const t=e.slice(0,e.length-2),r=e.slice(e.length-2);return`${Wi(t,"base32")}:${ca(r)}`}(t);case 466:return function(e){const t=na.decode(e),r=e.slice(na.decode.bytes);if(r.length!==t)throw new Error("inconsistent lengths");return"u"+Wi(r,"base64url")}(t);default:return Wi(t,"base16")}}function oa(e,t){switch(ra(e).code){case 4:case 41:return function(e){if(!on(e))throw new Error(`invalid ip address "${e}"`);return Yi(e)}(t);case 6:case 273:case 33:case 132:return ha(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 777:return function(e){const t=ia(e),r=Uint8Array.from(na.encode(t.length));return aa([r,t],r.length+t.length)}(t);case 421:return function(e){let t;t="Q"===e[0]||"1"===e[0]?hi(Bn.decode(`z${e}`)).bytes:Ii.parse(e).multihash.bytes;const r=Uint8Array.from(na.encode(t.length));return aa([r,t],r.length+t.length)}(t);case 444:return function(e){const t=e.split(":");if(2!==t.length)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(16!==t[0].length)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);const r=En.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");const i=ha(n);return aa([r,i],r.length+i.length)}(t);case 445:return function(e){const t=e.split(":");if(2!==t.length)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(56!==t[0].length)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);const r=En.decode(`b${t[0]}`),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");const i=ha(n);return aa([r,i],r.length+i.length)}(t);case 466:return function(e){const t=la.decode(e),r=Uint8Array.from(na.encode(t.length));return aa([r,t],r.length+t.length)}(t);default:return ia(t,"base16")}}const ua=Object.values(qi).map((e=>e.decoder)),la=function(){let e=ua[0].or(ua[1]);return ua.slice(2).forEach((t=>e=e.or(t))),e}();function ha(e){const t=new ArrayBuffer(2);return new DataView(t).setUint16(0,e),new Uint8Array(t)}function ca(e){return new DataView(e.buffer).getUint16(e.byteOffset)}function da(e){return e.map((e=>{const t=wa(e);return null!=e[1]?[t.code,sa(t.code,e[1])]:[t.code]}))}function fa(e){return ba(aa(e.map((e=>{const t=wa(e);let r=Uint8Array.from(na.encode(t.code));return e.length>1&&null!=e[1]&&(r=aa([r,e[1]])),r}))))}function pa(e,t){return e.size>0?e.size/8:0===e.size?0:na.decode(t)+na.decode.bytes}function ya(e){const t=[];let r=0;for(;r<e.length;){const n=na.decode(e,r),i=na.decode.bytes,a=pa(ra(n),e.slice(r+i));if(0===a){t.push([n]),r+=i;continue}const s=e.slice(r+i,r+i+a);if(r+=a+i,r>e.length)throw va("Invalid address Uint8Array: "+Wi(e,"base16"));t.push([n,s])}return t}function ma(e){return function(e){const t=[];return e.map((e=>{const r=wa(e);return t.push(r.name),e.length>1&&null!=e[1]&&t.push(e[1]),null})),ga(t.join("/"))}(da(ya(e)))}function ba(e){const t=function(e){try{ya(e)}catch(e){return e}}(e);if(null!=t)throw t;return Uint8Array.from(e)}function ga(e){return"/"+e.trim().split("/").filter((e=>e)).join("/")}function va(e){return new Error("Error parsing address: "+e)}function wa(e){return ra(e[0])}var _a=i(2114);const Ma=Symbol.for("nodejs.util.inspect.custom"),Ta=[ra("dns").code,ra("dns4").code,ra("dns6").code,ra("dnsaddr").code],Ea=[ra("p2p").code,ra("ipfs").code],Aa=new Map,xa=Symbol.for("@multiformats/js-multiaddr/multiaddr");class ka{constructor(e){if(null==e&&(e=""),Object.defineProperty(this,xa,{value:!0}),e instanceof Uint8Array)this.bytes=ba(e);else if("string"==typeof e){if(e.length>0&&"/"!==e.charAt(0))throw new Error(`multiaddr "${e}" must start with a "/"`);this.bytes=fa(function(e){const t=[],r=e.split("/").slice(1);if(1===r.length&&""===r[0])return[];for(let n=0;n<r.length;n++){const i=r[n],a=ra(i);if(0!==a.size){if(n++,n>=r.length)throw va("invalid address: "+e);if(!0===a.path){t.push([i,ga(r.slice(n).join("/"))]);break}t.push([i,r[n]])}else t.push([i])}return t}(ga(e)).map((e=>{Array.isArray(e)||(e=[e]);const t=wa(e);return e.length>1?[t.code,oa(t.code,e[1])]:[t.code]})))}else{if(!ka.isMultiaddr(e))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=ba(e.bytes)}}toString(){return ma(this.bytes)}toJSON(){return this.toString()}toOptions(){const e=this.protoCodes(),t=this.toString().split("/").slice(1);let r,n;if(t.length>2)Ta.includes(e[0])&&Ea.includes(e[1])?(r=ra("tcp").name,n=443):(r=ra(t[2]).name,n=parseInt(t[3]));else{if(!Ta.includes(e[0]))throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');r=ra("tcp").name,n=443}return{family:41===e[0]||55===e[0]?6:4,host:t[1],transport:r,port:n}}protos(){return this.protoCodes().map((e=>Object.assign({},ra(e))))}protoCodes(){const e=[],t=this.bytes;let r=0;for(;r<t.length;){const n=na.decode(t,r),i=na.decode.bytes;r+=pa(ra(n),t.slice(r+i))+i,e.push(n)}return e}protoNames(){return this.protos().map((e=>e.name))}tuples(){return ya(this.bytes)}stringTuples(){return da(ya(this.bytes))}encapsulate(e){return e=new ka(e),new ka(this.toString()+e.toString())}decapsulate(e){const t=e.toString(),r=this.toString(),n=r.lastIndexOf(t);if(n<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new ka(r.slice(0,n))}decapsulateCode(e){const t=this.tuples();for(let r=t.length-1;r>=0;r--)if(t[r][0]===e)return new ka(fa(t.slice(0,r)));return this}getPeerId(){try{const e=this.stringTuples().filter((e=>e[0]===ea.ipfs.code)),t=e.pop();if(null!=t?.[1]){const e=t[1];return"Q"===e[0]||"1"===e[0]?Wi(Bn.decode(`z${e}`),"base58btc"):Wi(Ii.parse(e).multihash.bytes,"base58btc")}return null}catch(e){return null}}getPath(){let e=null;try{e=this.stringTuples().filter((e=>!0===ra(e[0]).path))[0][1],null==e&&(e=null)}catch{e=null}return e}equals(e){return function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(this.bytes,e.bytes)}async resolve(e){const t=this.protos().find((e=>e.resolvable));if(null==t)return[this];const r=Aa.get(t.name);if(null==r)throw _a(new Error(`no available resolver for ${t.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await r(this,e)).map((e=>new ka(e)))}nodeAddress(){const e=this.toOptions();if("tcp"!==e.transport&&"udp"!==e.transport)throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){const t=(e??this).protos();return!(2!==t.length||4!==t[0].code&&41!==t[0].code||6!==t[1].code&&273!==t[1].code)}static fromNodeAddress(e,t){if(null==e)throw new Error("requires node address object");if(null==t)throw new Error("requires transport protocol");let r;switch(e.family){case 4:r="ip4";break;case 6:r="ip6";break;default:throw Error("Invalid addr family, should be 4 or 6.")}return new ka("/"+[r,e.address,t,e.port].join("/"))}static isName(e){return!!ka.isMultiaddr(e)&&e.protos().some((e=>e.resolvable))}static isMultiaddr(e){return Boolean(e?.[xa])}[Ma](){return"<Multiaddr "+Wi(this.bytes,"base16")+" - "+ma(this.bytes)+">"}inspect(){return"<Multiaddr "+Wi(this.bytes,"base16")+" - "+ma(this.bytes)+">"}}function Sa(e){return new ka(e)}ka.resolvers=Aa;var Ia=i(5760),Ca=i(9885),Oa=i(4633),Ra=i.n(Oa);const Na=Object.prototype.toString,Pa=Error.prototype.toString,Ba=RegExp.prototype.toString,Da="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",La=/^Symbol\((.*)\)(.*)$/;function Fa(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const r=typeof e;if("number"===r)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===r)return t?`"${e}"`:e;if("function"===r)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===r)return Da.call(e).replace(La,"Symbol($1)");const n=Na.call(e).slice(8,-1);return"Date"===n?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===n||e instanceof Error?"["+Pa.call(e)+"]":"RegExp"===n?Ba.call(e):null}function Ua(e,t){let r=Fa(e,t);return null!==r?r:JSON.stringify(e,(function(e,r){let n=Fa(this[e],t);return null!==n?n:r}),2)}function ja(e){return null==e?[]:[].concat(e)}let qa=/\$\{\s*(\w+)\s*\}/g;class za extends Error{static formatError(e,t){const r=t.label||t.path||"this";return r!==t.path&&(t=Object.assign({},t,{path:r})),"string"==typeof e?e.replace(qa,((e,r)=>Ua(t[r]))):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,r,n){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=t,this.path=r,this.type=n,this.errors=[],this.inner=[],ja(e).forEach((e=>{za.isError(e)?(this.errors.push(...e.errors),this.inner=this.inner.concat(e.inner.length?e.inner:e)):this.errors.push(e)})),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,za)}}let Ga={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:n})=>{const i=null!=n&&n!==r?` (cast from the value \`${Ua(n,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${Ua(r,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Ua(r,!0)}\``+i}},Ka={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ha={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},$a={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Va={isValue:"${path} field must be ${value}"},Wa={noUnknown:"${path} field has unspecified keys: ${unknown}"},Za={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed:Ga,string:Ka,number:Ha,date:$a,object:Wa,array:Za,boolean:Va});const Ja=e=>e&&e.__isYupSchema__;class Ya{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:n,otherwise:i}=t,a="function"==typeof r?r:(...e)=>e.every((e=>e===r));return new Ya(e,((e,t)=>{var r;let s=a(...e)?n:i;return null!=(r=null==s?void 0:s(t))?r:t}))}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let r=this.refs.map((e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context))),n=this.fn(r,e,t);if(void 0===n||n===e)return e;if(!Ja(n))throw new TypeError("conditions must return a schema object");return n.resolve(t)}}class Xa{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext="$"===this.key[0],this.isValue="."===this.key[0],this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?"$":this.isValue?".":"";this.path=this.key.slice(r.length),this.getter=this.path&&(0,Ia.getter)(this.path,!0),this.map=t.map}getValue(e,t,r){let n=this.isContext?r:this.isValue?e:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}Xa.prototype.__isYupRef=!0;const Qa=e=>null==e;function es(e){function t({value:t,path:r="",options:n,originalValue:i,schema:a},s,o){const{name:u,test:l,params:h,message:c,skipAbsent:d}=e;let{parent:f,context:p,abortEarly:y=a.spec.abortEarly}=n;function m(e){return Xa.isRef(e)?e.getValue(t,f,p):e}function b(e={}){const n=Object.assign({value:t,originalValue:i,label:a.spec.label,path:e.path||r,spec:a.spec},h,e.params);for(const e of Object.keys(n))n[e]=m(n[e]);const s=new za(za.formatError(e.message||c,n),t,n.path,e.type||u);return s.params=n,s}const g=y?s:o;let v={path:r,parent:f,type:u,from:n.from,createError:b,resolve:m,options:n,originalValue:i,schema:a};const w=e=>{za.isError(e)?g(e):e?o(null):g(b())},_=e=>{za.isError(e)?g(e):s(e)},M=d&&Qa(t);if(!n.sync){try{Promise.resolve(!!M||l.call(v,t,v)).then(w,_)}catch(e){_(e)}return}let T;try{var E;if(T=!!M||l.call(v,t,v),"function"==typeof(null==(E=T)?void 0:E.then))throw new Error(`Validation test of type: "${v.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(e){return void _(e)}w(T)}return t.OPTIONS=e,t}function ts(e,t,r,n=r){let i,a,s;return t?((0,Ia.forEach)(t,((o,u,l)=>{let h=u?o.slice(1,o.length-1):o,c="tuple"===(e=e.resolve({context:n,parent:i,value:r})).type,d=l?parseInt(h,10):0;if(e.innerType||c){if(c&&!l)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(r&&d>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${o}, in the path: ${t}. because there is no value at that index. `);i=r,r=r&&r[d],e=c?e.spec.types[d]:e.innerType}if(!l){if(!e.fields||!e.fields[h])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${s} which is a type: "${e.type}")`);i=r,r=r&&r[h],e=e.fields[h]}a=h,s=u?"["+o+"]":"."+o})),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class rs extends Set{describe(){const e=[];for(const t of this.values())e.push(Xa.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const r of this.values())t.push(e(r));return t}clone(){return new rs(this.values())}merge(e,t){const r=this.clone();return e.forEach((e=>r.add(e))),t.forEach((e=>r.delete(e))),r}}function ns(e,t=new Map){if(Ja(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let n=0;n<e.length;n++)r[n]=ns(e[n],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[n,i]of e.entries())r.set(n,ns(i,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const n of e)r.add(ns(n,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);r={},t.set(e,r);for(const[n,i]of Object.entries(e))r[n]=ns(i,t)}return r}class is{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new rs,this._blacklist=new rs,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation((()=>{this.typeError(Ga.notType)})),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,optional:!0,coerce:!0},null==e?void 0:e.spec),this.withMutation((e=>{e.nonNullable()}))}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=ns(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=t,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,r=e.clone();const n=Object.assign({},t.spec,r.spec);return r.spec=n,r.internalTests=Object.assign({},t.internalTests,r.internalTests),r._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),r._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),r.tests=t.tests,r.exclusiveTests=t.exclusiveTests,r.withMutation((t=>{e.tests.forEach((e=>{t.test(e.OPTIONS)}))})),r.transforms=[...t.transforms,...r.transforms],r}isType(e){return null==e?!(!this.spec.nullable||null!==e)||!(!this.spec.optional||void 0!==e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let r=t.conditions;t=t.clone(),t.conditions=[],t=r.reduce(((t,r)=>r.resolve(t,e)),t),t=t.resolve(e)}return t}resolveOptions(e){var t,r,n;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(r=e.abortEarly)?r:this.spec.abortEarly,recursive:null!=(n=e.recursive)?n:this.spec.recursive})}cast(e,t={}){let r=this.resolve(Object.assign({value:e},t)),n="ignore-optionality"===t.assert,i=r._cast(e,t);if(!1!==t.assert&&!r.isType(i)){if(n&&Qa(i))return i;let a=Ua(e),s=Ua(i);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". \n\nattempted value: ${a} \n`+(s!==a?`result of cast: ${s}`:""))}return i}_cast(e,t){let r=void 0===e?e:this.transforms.reduce(((t,r)=>r.call(this,t,e,this)),e);return void 0===r&&(r=this.getDefault(t)),r}_validate(e,t={},r,n){let{path:i,originalValue:a=e,strict:s=this.spec.strict}=t,o=e;s||(o=this._cast(o,Object.assign({assert:!1},t)));let u=[];for(let e of Object.values(this.internalTests))e&&u.push(e);this.runTests({path:i,value:o,originalValue:a,options:t,tests:u},r,(e=>{if(e.length)return n(e,o);this.runTests({path:i,value:o,originalValue:a,options:t,tests:this.tests},r,n)}))}runTests(e,t,r){let n=!1,{tests:i,value:a,originalValue:s,path:o,options:u}=e,l=e=>{n||(n=!0,t(e,a))},h=e=>{n||(n=!0,r(e,a))},c=i.length,d=[];if(!c)return h([]);let f={value:a,originalValue:s,path:o,options:u,schema:this};for(let e=0;e<i.length;e++)(0,i[e])(f,l,(function(e){e&&(d=d.concat(e)),--c<=0&&h(d)}))}asNestedTest({key:e,index:t,parent:r,parentPath:n,originalParent:i,options:a}){const s=null!=e?e:t;if(null==s)throw TypeError("Must include `key` or `index` for nested validations");const o="number"==typeof s;let u=r[s];const l=Object.assign({},a,{strict:!0,parent:r,value:u,originalValue:i[s],key:void 0,[o?"index":"key"]:s,path:o||s.includes(".")?`${n||""}[${u?s:`"${s}"`}]`:(n?`${n}.`:"")+e});return(e,t,r)=>this.resolve(l)._validate(u,l,t,r)}validate(e,t){let r=this.resolve(Object.assign({},t,{value:e}));return new Promise(((n,i)=>r._validate(e,t,((e,t)=>{za.isError(e)&&(e.value=t),i(e)}),((e,t)=>{e.length?i(new za(e,t)):n(t)}))))}validateSync(e,t){let r;return this.resolve(Object.assign({},t,{value:e}))._validate(e,Object.assign({},t,{sync:!0}),((e,t)=>{throw za.isError(e)&&(e.value=t),e}),((t,n)=>{if(t.length)throw new za(t,e);r=n})),r}isValid(e,t){return this.validate(e,t).then((()=>!0),(e=>{if(za.isError(e))return!1;throw e}))}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(za.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this):ns(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return 0===arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const r=this.clone({nullable:e});return r.internalTests.nullable=es({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),r}optionality(e,t){const r=this.clone({optional:e});return r.internalTests.optionality=es({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),r}optional(){return this.optionality(!0)}defined(e=Ga.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Ga.notNull){return this.nullability(!1,e)}required(e=Ga.required){return this.clone().withMutation((t=>t.nonNullable(e).defined(e)))}notRequired(){return this.clone().withMutation((e=>e.nullable().optional()))}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=Ga.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let r=this.clone(),n=es(t),i=t.exclusive||t.name&&!0===r.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(r.exclusiveTests[t.name]=!!t.exclusive),r.tests=r.tests.filter((e=>{if(e.OPTIONS.name===t.name){if(i)return!1;if(e.OPTIONS.test===n.OPTIONS.test)return!1}return!0})),r.tests.push(n),r}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let r=this.clone(),n=ja(e).map((e=>new Xa(e)));return n.forEach((e=>{e.isSibling&&r.deps.push(e.key)})),r.conditions.push("function"==typeof t?new Ya(n,t):Ya.fromOptions(n,t)),r}typeError(e){let t=this.clone();return t.internalTests.typeError=es({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=Ga.oneOf){let r=this.clone();return e.forEach((e=>{r._whitelist.add(e),r._blacklist.delete(e)})),r.internalTests.whiteList=es({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,r=t.resolveAll(this.resolve);return!!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}notOneOf(e,t=Ga.notOneOf){let r=this.clone();return e.forEach((e=>{r._blacklist.add(e),r._whitelist.delete(e)})),r.internalTests.blacklist=es({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,r=t.resolveAll(this.resolve);return!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:r,meta:n,optional:i,nullable:a}=t.spec;return{meta:n,label:r,optional:i,nullable:a,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map((e=>({name:e.OPTIONS.name,params:e.OPTIONS.params}))).filter(((e,t,r)=>r.findIndex((t=>t.name===e.name))===t))}}}is.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])is.prototype[`${e}At`]=function(t,r,n={}){const{parent:i,parentPath:a,schema:s}=ts(this,t,r,n.context);return s[e](i&&i[a],Object.assign({},n,{parent:i,path:t}))};for(const e of["equals","is"])is.prototype[e]=is.prototype.oneOf;for(const e of["not","nope"])is.prototype[e]=is.prototype.notOneOf;const as=()=>!0;function ss(e){return new os(e)}class os extends is{constructor(e){super("function"==typeof e?{type:"mixed",check:e}:Object.assign({type:"mixed",check:as},e))}}function us(){return new ls}ss.prototype=os.prototype;class ls extends is{constructor(){super({type:"boolean",check:e=>(e instanceof Boolean&&(e=e.valueOf()),"boolean"==typeof e)}),this.withMutation((()=>{this.transform(((e,t,r)=>{if(r.spec.coerce&&!r.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e}))}))}isTrue(e=Va.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test:e=>Qa(e)||!0===e})}isFalse(e=Va.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test:e=>Qa(e)||!1===e})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}}us.prototype=ls.prototype;let hs=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,cs=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,ds=/^(?:[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,fs=e=>Qa(e)||e===e.trim(),ps={}.toString();function ys(){return new ms}class ms extends is{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation((()=>{this.transform(((e,t,r)=>{if(!r.spec.coerce||r.isType(e))return e;if(Array.isArray(e))return e;const n=null!=e&&e.toString?e.toString():e;return n===ps?e:n}))}))}required(e){return super.required(e).withMutation((t=>t.test({message:e||Ga.required,name:"required",skipAbsent:!0,test:e=>!!e.length})))}notRequired(){return super.notRequired().withMutation((e=>(e.tests=e.tests.filter((e=>"required"!==e.OPTIONS.name)),e)))}length(e,t=Ka.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=Ka.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=Ka.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let r,n,i=!1;return t&&("object"==typeof t?({excludeEmptyString:i=!1,message:r,name:n}=t):r=t),this.test({name:n||"matches",message:r||Ka.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&i||-1!==t.search(e)})}email(e=Ka.email){return this.matches(hs,{name:"email",message:e,excludeEmptyString:!0})}url(e=Ka.url){return this.matches(cs,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Ka.uuid){return this.matches(ds,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform((e=>null===e?"":e))}trim(e=Ka.trim){return this.transform((e=>null!=e?e.trim():e)).test({message:e,name:"trim",test:fs})}lowercase(e=Ka.lowercase){return this.transform((e=>Qa(e)?e:e.toLowerCase())).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Qa(e)||e===e.toLowerCase()})}uppercase(e=Ka.uppercase){return this.transform((e=>Qa(e)?e:e.toUpperCase())).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>Qa(e)||e===e.toUpperCase()})}}function bs(){return new gs}ys.prototype=ms.prototype;class gs extends is{constructor(){super({type:"number",check:e=>(e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&!(e=>e!=+e)(e))}),this.withMutation((()=>{this.transform(((e,t,r)=>{if(!r.spec.coerce)return e;let n=e;if("string"==typeof n){if(n=n.replace(/\s/g,""),""===n)return NaN;n=+n}return r.isType(n)||null===n?n:parseFloat(n)}))}))}min(e,t=Ha.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t>=this.resolve(e)}})}max(e,t=Ha.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(t){return t<=this.resolve(e)}})}lessThan(e,t=Ha.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(t){return t<this.resolve(e)}})}moreThan(e,t=Ha.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(t){return t>this.resolve(e)}})}positive(e=Ha.positive){return this.moreThan(0,e)}negative(e=Ha.negative){return this.lessThan(0,e)}integer(e=Ha.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:e=>Number.isInteger(e)})}truncate(){return this.transform((e=>Qa(e)?e:0|e))}round(e){var t;let r=["ceil","floor","round","trunc"];if("trunc"===(e=(null==(t=e)?void 0:t.toLowerCase())||"round"))return this.truncate();if(-1===r.indexOf(e.toLowerCase()))throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform((t=>Qa(t)?t:Math[e](t)))}}bs.prototype=gs.prototype;var vs=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;let ws=new Date("");function _s(){return new Ms}class Ms extends is{constructor(){super({type:"date",check(e){return t=e,"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(e.getTime());var t}}),this.withMutation((()=>{this.transform(((e,t,r)=>!r.spec.coerce||r.isType(e)||null===e?e:(e=function(e){var t,r,n=[1,4,5,6,7,10,11],i=0;if(r=vs.exec(e)){for(var a,s=0;a=n[s];++s)r[a]=+r[a]||0;r[2]=(+r[2]||1)-1,r[3]=+r[3]||1,r[7]=r[7]?String(r[7]).substr(0,3):0,void 0!==r[8]&&""!==r[8]||void 0!==r[9]&&""!==r[9]?("Z"!==r[8]&&void 0!==r[9]&&(i=60*r[10]+r[11],"+"===r[9]&&(i=0-i)),t=Date.UTC(r[1],r[2],r[3],r[4],r[5]+i,r[6],r[7])):t=+new Date(r[1],r[2],r[3],r[4],r[5],r[6],r[7])}else t=Date.parse?Date.parse(e):NaN;return t}(e),isNaN(e)?Ms.INVALID_DATE:new Date(e))))}))}prepareParam(e,t){let r;if(Xa.isRef(e))r=e;else{let n=this.cast(e);if(!this._typeCheck(n))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);r=n}return r}min(e,t=$a.min){let r=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(r)}})}max(e,t=$a.max){let r=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(r)}})}}function Ts(e,t){let r=1/0;return e.some(((e,n)=>{var i;if(null!=(i=t.path)&&i.includes(e))return r=n,!0})),r}function Es(e){return(t,r)=>Ts(e,t)-Ts(e,r)}Ms.INVALID_DATE=ws,_s.prototype=Ms.prototype,_s.INVALID_DATE=ws;const As=(e,t,r)=>{if("string"!=typeof e)return e;let n=e;try{n=JSON.parse(e)}catch(e){}return r.isType(n)?n:e};function xs(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=xs(n);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=xs(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(xs)}):"optional"in e?e.optional():e}let ks=e=>"[object Object]"===Object.prototype.toString.call(e);const Ss=Es([]);function Is(e){return new Cs(e)}class Cs extends is{constructor(e){super({type:"object",check:e=>ks(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=Ss,this._nodes=[],this._excludedEdges=[],this.withMutation((()=>{e&&this.shape(e)}))}_cast(e,t={}){var r;let n=super._cast(e,t);if(void 0===n)return this.getDefault(t);if(!this._typeCheck(n))return n;let i=this.fields,a=null!=(r=t.stripUnknown)?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(n).filter((e=>!this._nodes.includes(e)))),o={},u=Object.assign({},t,{parent:o,__validating:t.__validating||!1}),l=!1;for(const e of s){let r=i[e],s=e in n;if(r){let i,a=n[e];u.path=(t.path?`${t.path}.`:"")+e,r=r.resolve({value:a,context:t.context,parent:o});let s=r instanceof is?r.spec:void 0,h=null==s?void 0:s.strict;if(null!=s&&s.strip){l=l||e in n;continue}i=t.__validating&&h?n[e]:r.cast(n[e],u),void 0!==i&&(o[e]=i)}else s&&!a&&(o[e]=n[e]);s===e in o&&o[e]===n[e]||(l=!0)}return l?o:n}_validate(e,t={},r,n){let{from:i=[],originalValue:a=e,recursive:s=this.spec.recursive}=t;t.from=[{schema:this,value:a},...i],t.__validating=!0,t.originalValue=a,super._validate(e,t,r,((e,i)=>{if(!s||!ks(i))return void n(e,i);a=a||i;let o=[];for(let e of this._nodes){let r=this.fields[e];r&&!Xa.isRef(r)&&o.push(r.asNestedTest({options:t,key:e,parent:i,parentPath:t.path,originalParent:a}))}this.runTests({tests:o,value:i,originalValue:a,options:t},r,(t=>{n(t.sort(this._sortErrors).concat(e),i)}))}))}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),r=t.fields;for(let[e,t]of Object.entries(this.fields)){const n=r[e];r[e]=void 0===n?t:n}return t.withMutation((t=>t.setFields(r,[...this._excludedEdges,...e._excludedEdges])))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach((r=>{var n;const i=this.fields[r];let a=e;null!=(n=a)&&n.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[r]})),t[r]=i&&"getDefault"in i?i.getDefault(a):void 0})),t}setFields(e,t){let r=this.clone();return r.fields=e,r._nodes=function(e,t=[]){let r=[],n=new Set,i=new Set(t.map((([e,t])=>`${e}-${t}`)));function a(e,t){let a=(0,Ia.split)(e)[0];n.add(a),i.has(`${t}-${a}`)||r.push([t,a])}for(const t of Object.keys(e)){let r=e[t];n.add(t),Xa.isRef(r)&&r.isSibling?a(r.path,t):Ja(r)&&"deps"in r&&r.deps.forEach((e=>a(e,t)))}return Ra().array(Array.from(n),r).reverse()}(e,t),r._sortErrors=Es(Object.keys(e)),t&&(r._excludedEdges=t),r}shape(e,t=[]){return this.clone().withMutation((r=>{let n=r._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),n=[...r._excludedEdges,...t]),r.setFields(Object.assign(r.fields,e),n)}))}partial(){const e={};for(const[t,r]of Object.entries(this.fields))e[t]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(e)}deepPartial(){return xs(this)}pick(e){const t={};for(const r of e)this.fields[r]&&(t[r]=this.fields[r]);return this.setFields(t)}omit(e){const t=Object.assign({},this.fields);for(const r of e)delete t[r];return this.setFields(t)}from(e,t,r){let n=(0,Ia.getter)(e,!0);return this.transform((i=>{if(!i)return i;let a=i;return((e,t)=>{const r=[...(0,Ia.normalizePath)(t)];if(1===r.length)return r[0]in e;let n=r.pop(),i=(0,Ia.getter)((0,Ia.join)(r),!0)(e);return!(!i||!(n in i))})(i,e)&&(a=Object.assign({},i),r||delete a[e],a[t]=n(i)),a}))}json(){return this.transform(As)}noUnknown(e=!0,t=Wa.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const r=function(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter((e=>-1===r.indexOf(e)))}(this.schema,t);return!e||0===r.length||this.createError({params:{unknown:r.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,t=Wa.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform((t=>{if(!t)return t;const r={};for(const n of Object.keys(t))r[e(n)]=t[n];return r}))}camelCase(){return this.transformKeys(Ca.camelCase)}snakeCase(){return this.transformKeys(Ca.snakeCase)}constantCase(){return this.transformKeys((e=>(0,Ca.snakeCase)(e).toUpperCase()))}describe(e){let t=super.describe(e);t.fields={};for(const[n,i]of Object.entries(this.fields)){var r;let a=e;null!=(r=a)&&r.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[n]})),t.fields[n]=i.describe(a)}return t}}function Os(e){return new Rs(e)}Is.prototype=Cs.prototype;class Rs extends is{constructor(e){super({type:"array",spec:{types:e},check:e=>Array.isArray(e)}),this.innerType=void 0,this.innerType=e}_cast(e,t){const r=super._cast(e,t);if(!this._typeCheck(r)||!this.innerType)return r;let n=!1;const i=r.map(((e,r)=>{const i=this.innerType.cast(e,Object.assign({},t,{path:`${t.path||""}[${r}]`}));return i!==e&&(n=!0),i}));return n?i:r}_validate(e,t={},r,n){var i;let a=this.innerType,s=null!=(i=t.recursive)?i:this.spec.recursive;null!=t.originalValue&&t.originalValue,super._validate(e,t,r,((i,o)=>{var u;if(!s||!a||!this._typeCheck(o))return void n(i,o);let l=new Array(o.length);for(let r=0;r<o.length;r++){var h;l[r]=a.asNestedTest({options:t,index:r,parent:o,parentPath:t.path,originalParent:null!=(h=t.originalValue)?h:e})}this.runTests({value:o,tests:l,originalValue:null!=(u=t.originalValue)?u:e,options:t},r,(e=>n(e.concat(i),o)))}))}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(As)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!Ja(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Ua(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=Za.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t){return t=t||Za.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t){return t=t||Za.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}ensure(){return this.default((()=>[])).transform(((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t)))}compact(e){let t=e?(t,r,n)=>!e(t,r,n):e=>!!e;return this.transform((e=>null!=e?e.filter(t):e))}describe(e){let t=super.describe(e);if(this.innerType){var r;let n=e;null!=(r=n)&&r.value&&(n=Object.assign({},n,{parent:n.value,value:n.value[0]})),t.innerType=this.innerType.describe(n)}return t}}Os.prototype=Rs.prototype;class Ns{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(e,t={})=>{let r=this.builder(e,t);if(!Ja(r))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(r=r.optional()),r.resolve(t)},this.builder=e,this.spec={meta:void 0,optional:!1}}clone(e){const t=new Ns(this.builder);return t.spec=Object.assign({},this.spec,e),t}optionality(e){return this.clone({optional:e})}optional(){return this.optionality(!0)}resolve(e){return this._resolve(e.value,e)}cast(e,t){return this._resolve(e,t).cast(e,t)}asNestedTest(e){let{key:t,index:r,parent:n,options:i}=e,a=n[null!=r?r:t];return this._resolve(a,Object.assign({},i,{value:a,parent:n})).asNestedTest(e)}validate(e,t){return this._resolve(e,t).validate(e,t)}validateSync(e,t){return this._resolve(e,t).validateSync(e,t)}validateAt(e,t,r){return this._resolve(t,r).validateAt(e,t,r)}validateSyncAt(e,t,r){return this._resolve(t,r).validateSyncAt(e,t,r)}isValid(e,t){return this._resolve(e,t).isValid(e,t)}isValidSync(e,t){return this._resolve(e,t).isValidSync(e,t)}describe(e){return e?this.resolve(e).describe(e):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}}const Ps=e=>{const{name:t,message:r,stack:n,constructor:i,originalError:a,toJSON:s,...o}=e;return o};class Bs extends Error{constructor(...e){super(...e),this.name=this.constructor.name}}class Ds extends Error{constructor(e,t){super(e),this.name=this.constructor.name,this.originalError=t,t&&"object"==typeof t&&Object.assign(this,Ps(t))}}class Ls extends Ds{constructor(...e){super(...e),this.name=this.constructor.name}}class Fs extends Ds{constructor(...e){super(...e),this.name=this.constructor.name}}class Us extends Ds{constructor(...e){super(...e),this.name=this.constructor.name}}class js extends Error{constructor(e,t,r){super(`No ${e} found for id ${t} on chain ${r}`),this.name=this.constructor.name,this.objName=e,this.chainId=r,this.objectId=t}}class qs extends Error{constructor(e,t){super(`Failed to get bridged chain confirmation for transaction ${t}`),this.name=this.constructor.name,this.sendTxHash=t,this.originalError=e,e&&"object"==typeof e&&Object.assign(this,Ps(e))}}const zs="app",Gs="dataset",Ks="workerpool",Hs="apporder",$s="datasetorder",Vs="workerpoolorder",Ws="requestorder",Zs="0x",Js="0x0000000000000000000000000000000000000000",Ys="0x0000000000000000000000000000000000000000000000000000000000000000",Xs={dataset:Js,datasetprice:0,volume:0,tag:Ys,apprestrict:Js,workerpoolrestrict:Js,requesterrestrict:Js,salt:Ys,sign:Zs},Qs="iexec:workerpool-api:url",eo={SCONE:"scone",GRAMINE:"gramine"},to={IPFS:"ipfs",DROPBOX:"dropbox"},ro="iexec_secrets",no="iexec_result_encryption",io="iexec_result_storage_provider",ao="any",so=_,{getAddress:oo,randomBytes:uo,formatUnits:lo,parseUnits:ho,hexlify:co}=e,fo=v("iexec:utils"),po=/^(0x)([0-9a-f]{2}){32}$/,yo=e=>ge.from(e.toString()),mo=e=>new so(e.toString()),bo=e=>e.toString(),go=e=>{try{return lo(bo(e),9)}catch(e){throw fo("formatRLC()",e),Error("Invalid nRLC")}},vo=e=>{const t=e.toString(),r=t.length>9?t.slice(0,-9):"0";return new so(r)},wo=e=>{const t=e.toString(),r="0"!==t?t.concat("000000000"):"0";return new so(r)},_o=e=>{const t=Array.isArray(e)?[]:{};return Object.entries(e).forEach((e=>{const[r,n]=e;(e=>!(!e._ethersType||"BigNumber"!==e._ethersType))(n)?t[r]=mo(n):"object"==typeof n&&n._hex?t[r]=new so(n._hex.substring(2),16):t[r]="object"==typeof n?_o(n):n})),t},Mo=e=>oo(e),To=e=>w.Buffer.from(e,"utf8"),Eo=e=>w.Buffer.from(e.substr(2),"hex"),Ao=e=>{let t;const r=Eo(e);try{t=Sa(new Uint8Array(r)).toString()}catch(e){t=r.toString()}return t},xo=e=>Object.keys(e).reduce(((t,r)=>{if(Number.isNaN(parseInt(r,10))){let n;return n=Array.isArray(e[r])&&!e[r].find((e=>"object"==typeof e))?e[r]:"object"==typeof e[r]?xo(e[r]):e[r],Object.assign(t,{[r]:n})}return t}),{}),ko=(e,t)=>{let r=!1;return t.forEach((t=>{t.event===e&&(r=!0)})),r},So=(e,t,{strict:r=!0}={})=>{const n=t.find((t=>t.event===e));if(!n){if(r)throw new Error(`Unknown event ${e}`);return{}}return n},Io={tee:0,[eo.SCONE]:1,[eo.GRAMINE]:2,gpu:8};Object.assign(Io,Object.fromEntries(Object.entries(Io).map((([e,t])=>[t,e]))));const Co=e=>{const t=new Array(256).fill(!1);e.forEach((e=>{if(""!==e){if(void 0===Io[e]||"number"!=typeof Io[e])throw new za(`Unknown tag ${e}`);t[Io[e]]=!0}}));const r=t.reduce(((e,t)=>t?`1${e}`:`0${e}`),""),n=new so(r,2).toString("hex");return Ys.substring(0,66-n.length).concat(n)},Oo=e=>{const t=e.map((e=>{if("string"!=typeof e||!e.match(po))throw new za("tag must be bytes32 hex string");return new so(e.substring(2),"hex").toString(2)}));let r="";for(let e=0;e<255;e+=1){let n="0";t.forEach((t=>{"1"===t.charAt(t.length-e-1)&&(n="1")})),r=n+r}const n=new so(r,2).toString("hex");return Ys.substring(0,66-n.length).concat(n)},Ro=(e,t)=>{if("string"!=typeof e||!po.test(e))throw new za("tag must be bytes32 hex string");if("number"!=typeof t||t<0||t>255)throw new za("Invalid bit tag");const r=new so(e.substring(2),"hex").toString(2);return"1"===r.charAt(r.length-t-1)},No=e=>{if(!e||!e.signer)throw new Bs("The current provider is not a signer, impossible to sign messages or transactions")},Po=new N("networks/5.7.1");function Bo(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const a=new t.PocketProvider(e,r.pocket);a.network&&-1===i.indexOf(a.network.name)&&n.push(a)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],a=new t.AnkrProvider(e,r.ankr);a.network&&-1===i.indexOf(a.network.name)&&n.push(a)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return Bo(e)},t}function Do(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return Do(e,t)},r}const Lo={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Bo("homestead")},Fo={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Bo("ropsten")},Uo={chainId:63,name:"classicMordor",_defaultProvider:Do("https://www.ethercluster.com/mordor","classicMordor")},jo={unspecified:{chainId:0,name:"unspecified"},homestead:Lo,mainnet:Lo,morden:{chainId:2,name:"morden"},ropsten:Fo,testnet:Fo,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Bo("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Bo("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Bo("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Bo("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:Do("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Uo,classicTestnet:Uo,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Do("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Bo("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Bo("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function qo(e){if(null==e)return null;if("number"==typeof e){for(const t in jo){const r=jo[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=jo[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=jo[e.name];if(!t)return"number"!=typeof e.chainId&&Po.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&Po.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}function zo(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self&&self;var Go=Ko;function Ko(e,t){if(!e)throw new Error(t||"Assertion failed")}Ko.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Ho=zo((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),a=i>>8,s=255&i;a?r.push(a,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),$o=zo((function(e,t){var r=t;r.assert=Go,r.toArray=Ho.toArray,r.zero2=Ho.zero2,r.toHex=Ho.toHex,r.encode=Ho.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,a=e.clone(),s=0;s<n.length;s++){var o,u=a.andln(i-1);a.isOdd()?(o=u>(i>>1)-1?(i>>1)-u:u,a.isubn(o)):o=0,n[s]=o,a.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,a=0;e.cmpn(-i)>0||t.cmpn(-a)>0;){var s,o,u=e.andln(3)+i&3,l=t.andln(3)+a&3;3===u&&(u=-1),3===l&&(l=-1),s=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==l?u:-u,r[0].push(s),o=0==(1&l)?0:3!=(n=t.andln(7)+a&7)&&5!==n||2!==u?l:-l,r[1].push(o),2*i===s+1&&(i=1-i),2*a===o+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(M())(e,"hex","le")}})),Vo=$o.getNAF,Wo=$o.getJSF,Zo=$o.assert;function Jo(e,t){this.type=e,this.p=new(M())(t.p,16),this.red=t.prime?M().red(t.prime):M().mont(this.p),this.zero=new(M())(0).toRed(this.red),this.one=new(M())(1).toRed(this.red),this.two=new(M())(2).toRed(this.red),this.n=t.n&&new(M())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Yo=Jo;function Xo(e,t){this.curve=e,this.type=t,this.precomputed=null}Jo.prototype.point=function(){throw new Error("Not implemented")},Jo.prototype.validate=function(){throw new Error("Not implemented")},Jo.prototype._fixedNafMul=function(e,t){Zo(e.precomputed);var r=e._getDoubles(),n=Vo(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var a,s,o=[];for(a=0;a<n.length;a+=r.step){s=0;for(var u=a+r.step-1;u>=a;u--)s=(s<<1)+n[u];o.push(s)}for(var l=this.jpoint(null,null,null),h=this.jpoint(null,null,null),c=i;c>0;c--){for(a=0;a<o.length;a++)(s=o[a])===c?h=h.mixedAdd(r.points[a]):s===-c&&(h=h.mixedAdd(r.points[a].neg()));l=l.add(h)}return l.toP()},Jo.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=Vo(t,r,this._bitLength),s=this.jpoint(null,null,null),o=a.length-1;o>=0;o--){for(var u=0;o>=0&&0===a[o];o--)u++;if(o>=0&&u++,s=s.dblp(u),o<0)break;var l=a[o];Zo(0!==l),s="affine"===e.type?l>0?s.mixedAdd(i[l-1>>1]):s.mixedAdd(i[-l-1>>1].neg()):l>0?s.add(i[l-1>>1]):s.add(i[-l-1>>1].neg())}return"affine"===e.type?s.toP():s},Jo.prototype._wnafMulAdd=function(e,t,r,n,i){var a,s,o,u=this._wnafT1,l=this._wnafT2,h=this._wnafT3,c=0;for(a=0;a<n;a++){var d=(o=t[a])._getNAFPoints(e);u[a]=d.wnd,l[a]=d.points}for(a=n-1;a>=1;a-=2){var f=a-1,p=a;if(1===u[f]&&1===u[p]){var y=[t[f],null,null,t[p]];0===t[f].y.cmp(t[p].y)?(y[1]=t[f].add(t[p]),y[2]=t[f].toJ().mixedAdd(t[p].neg())):0===t[f].y.cmp(t[p].y.redNeg())?(y[1]=t[f].toJ().mixedAdd(t[p]),y[2]=t[f].add(t[p].neg())):(y[1]=t[f].toJ().mixedAdd(t[p]),y[2]=t[f].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],b=Wo(r[f],r[p]);for(c=Math.max(b[0].length,c),h[f]=new Array(c),h[p]=new Array(c),s=0;s<c;s++){var g=0|b[0][s],v=0|b[1][s];h[f][s]=m[3*(g+1)+(v+1)],h[p][s]=0,l[f]=y}}else h[f]=Vo(r[f],u[f],this._bitLength),h[p]=Vo(r[p],u[p],this._bitLength),c=Math.max(h[f].length,c),c=Math.max(h[p].length,c)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(a=c;a>=0;a--){for(var M=0;a>=0;){var T=!0;for(s=0;s<n;s++)_[s]=0|h[s][a],0!==_[s]&&(T=!1);if(!T)break;M++,a--}if(a>=0&&M++,w=w.dblp(M),a<0)break;for(s=0;s<n;s++){var E=_[s];0!==E&&(E>0?o=l[s][E-1>>1]:E<0&&(o=l[s][-E-1>>1].neg()),w="affine"===o.type?w.mixedAdd(o):w.add(o))}}for(a=0;a<n;a++)l[a]=null;return i?w:w.toP()},Jo.BasePoint=Xo,Xo.prototype.eq=function(){throw new Error("Not implemented")},Xo.prototype.validate=function(){return this.curve.validate(this)},Jo.prototype.decodePoint=function(e,t){e=$o.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?Zo(e[e.length-1]%2==0):7===e[0]&&Zo(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},Xo.prototype.encodeCompressed=function(e){return this.encode(e,!0)},Xo.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},Xo.prototype.encode=function(e,t){return $o.encode(this._encode(t),e)},Xo.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},Xo.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)},Xo.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var a=0;a<e;a++)n=n.dbl();r.push(n)}return{step:e,points:r}},Xo.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},Xo.prototype._getBeta=function(){return null},Xo.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var Qo=zo((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),eu=$o.assert;function tu(e){Yo.call(this,"short",e),this.a=new(M())(e.a,16).toRed(this.red),this.b=new(M())(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Qo(tu,Yo);var ru=tu;function nu(e,t,r,n){Yo.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(M())(t,16),this.y=new(M())(r,16),n&&(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)}function iu(e,t,r,n){Yo.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(M())(0)):(this.x=new(M())(t,16),this.y=new(M())(r,16),this.z=new(M())(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.zOne=this.z===this.curve.one}tu.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new(M())(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new(M())(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],eu(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new(M())(e.a,16),b:new(M())(e.b,16)}})):this._getEndoBasis(r)}}},tu.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:M().mont(e),r=new(M())(2).toRed(t).redInvm(),n=r.redNeg(),i=new(M())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},tu.prototype._getEndoBasis=function(e){for(var t,r,n,i,a,s,o,u,l,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=e,d=this.n.clone(),f=new(M())(1),p=new(M())(0),y=new(M())(0),m=new(M())(1),b=0;0!==c.cmpn(0);){var g=d.div(c);u=d.sub(g.mul(c)),l=y.sub(g.mul(f));var v=m.sub(g.mul(p));if(!n&&u.cmp(h)<0)t=o.neg(),r=f,n=u.neg(),i=l;else if(n&&2==++b)break;o=u,d=c,c=u,y=f,f=l,m=p,p=v}a=u.neg(),s=l;var w=n.sqr().add(i.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:i},{a,b:s}]},tu.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),o=a.mul(n.a),u=i.mul(r.b),l=a.mul(n.b);return{k1:e.sub(s).sub(o),k2:u.add(l).neg()}},tu.prototype.pointFromX=function(e,t){(e=new(M())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},tu.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},tu.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a<e.length;a++){var s=this._endoSplit(t[a]),o=e[a],u=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*a]=o,n[2*a+1]=u,i[2*a]=s.k1,i[2*a+1]=s.k2}for(var l=this._wnafMulAdd(1,n,i,2*a,r),h=0;h<2*a;h++)n[h]=null,i[h]=null;return l},Qo(nu,Yo.BasePoint),tu.prototype.point=function(e,t,r){return new nu(this,e,t,r)},tu.prototype.pointFromJSON=function(e,t){return nu.fromJSON(this,e,t)},nu.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 r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.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}},nu.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]},nu.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var a=t[2];return n.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[n].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[n].concat(a.naf.points.map(i))}},n},nu.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)+">"},nu.prototype.isInfinity=function(){return this.inf},nu.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(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},nu.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)},nu.prototype.getX=function(){return this.x.fromRed()},nu.prototype.getY=function(){return this.y.fromRed()},nu.prototype.mul=function(e){return e=new(M())(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)},nu.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},nu.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},nu.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},nu.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},nu.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Qo(iu,Yo.BasePoint),tu.prototype.jpoint=function(e,t,r){return new iu(this,e,t,r)},iu.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},iu.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},iu.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),o=n.redSub(i),u=a.redSub(s);if(0===o.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),h=l.redMul(o),c=n.redMul(l),d=u.redSqr().redIAdd(h).redISub(c).redISub(c),f=u.redMul(c.redISub(d)).redISub(a.redMul(h)),p=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(d,f,p)},iu.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),s=r.redSub(n),o=i.redSub(a);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),h=r.redMul(u),c=o.redSqr().redIAdd(l).redISub(h).redISub(h),d=o.redMul(h.redISub(c)).redISub(i.redMul(l)),f=this.z.redMul(s);return this.curve.jpoint(c,d,f)},iu.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,a=this.x,s=this.y,o=this.z,u=o.redSqr().redSqr(),l=s.redAdd(s);for(t=0;t<e;t++){var h=a.redSqr(),c=l.redSqr(),d=c.redSqr(),f=h.redAdd(h).redIAdd(h).redIAdd(n.redMul(u)),p=a.redMul(c),y=f.redSqr().redISub(p.redAdd(p)),m=p.redISub(y),b=f.redMul(m);b=b.redIAdd(b).redISub(d);var g=l.redMul(o);t+1<e&&(u=u.redMul(d)),a=y,o=g,l=b}return this.curve.jpoint(a,l.redMul(i),o)},iu.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},iu.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(a);s=s.redIAdd(s);var o=n.redAdd(n).redIAdd(n),u=o.redSqr().redISub(s).redISub(s),l=a.redIAdd(a);l=(l=l.redIAdd(l)).redIAdd(l),e=u,t=o.redMul(s.redISub(u)).redISub(l),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),c=this.y.redSqr(),d=c.redSqr(),f=this.x.redAdd(c).redSqr().redISub(h).redISub(d);f=f.redIAdd(f);var p=h.redAdd(h).redIAdd(h),y=p.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=y.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},iu.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(a);s=s.redIAdd(s);var o=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=o.redSqr().redISub(s).redISub(s);e=u;var l=a.redIAdd(a);l=(l=l.redIAdd(l)).redIAdd(l),t=o.redMul(s.redISub(u)).redISub(l),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),c=this.y.redSqr(),d=this.x.redMul(c),f=this.x.redSub(h).redMul(this.x.redAdd(h));f=f.redAdd(f).redIAdd(f);var p=d.redIAdd(d),y=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(h);var m=c.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=f.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},iu.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),a=t.redSqr(),s=r.redSqr(),o=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i)),u=t.redAdd(t),l=(u=u.redIAdd(u)).redMul(s),h=o.redSqr().redISub(l.redAdd(l)),c=l.redISub(h),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=o.redMul(c).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(h,f,p)},iu.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),a=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(a)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=i.redIAdd(s).redSqr().redISub(a).redISub(o).redISub(u),h=t.redMul(l);h=(h=h.redIAdd(h)).redIAdd(h);var c=this.x.redMul(o).redISub(h);c=(c=c.redIAdd(c)).redIAdd(c);var d=this.y.redMul(l.redMul(u.redISub(l)).redISub(s.redMul(o)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=this.z.redAdd(s).redSqr().redISub(r).redISub(o);return this.curve.jpoint(c,d,f)},iu.prototype.mul=function(e,t){return e=new(M())(e,t),this.curve._wnafMul(this,e)},iu.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},iu.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},iu.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)+">"},iu.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var au=zo((function(e,t){var r=t;r.base=Yo,r.short=ru,r.mont=null,r.edwards=null})),su=zo((function(e,t){var r,n=t,i=$o.assert;function a(e){"short"===e.type?this.curve=new au.short(e):"edwards"===e.type?this.curve=new au.edwards(e):this.curve=new au.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new a(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=a,s("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:wr().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:wr().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:wr().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:wr().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"]}),s("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:wr().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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:wr().sha256,gRed:!1,g:["9"]}),s("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:wr().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("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:wr().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function ou(e){if(!(this instanceof ou))return new ou(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Ho.toArray(e.entropy,e.entropyEnc||"hex"),r=Ho.toArray(e.nonce,e.nonceEnc||"hex"),n=Ho.toArray(e.pers,e.persEnc||"hex");Go(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var uu=ou;ou.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},ou.prototype._hmac=function(){return new(wr().hmac)(this.hash,this.K)},ou.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())},ou.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=Ho.toArray(e,t),r=Ho.toArray(r,n),Go(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},ou.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=Ho.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var a=i.slice(0,e);return this._update(r),this._reseed++,Ho.encode(a,t)};var lu=$o.assert;function hu(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var cu=hu;hu.fromPublic=function(e,t,r){return t instanceof hu?t:new hu(e,{pub:t,pubEnc:r})},hu.fromPrivate=function(e,t,r){return t instanceof hu?t:new hu(e,{priv:t,privEnc:r})},hu.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"}},hu.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},hu.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},hu.prototype._importPrivate=function(e,t){this.priv=new(M())(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},hu.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?lu(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||lu(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},hu.prototype.derive=function(e){return e.validate()||lu(e.validate(),"public point not validated"),e.mul(this.priv).getX()},hu.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},hu.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},hu.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var du=$o.assert;function fu(e,t){if(e instanceof fu)return e;this._importDER(e,t)||(du(e.r&&e.s,"Signature without r or s"),this.r=new(M())(e.r,16),this.s=new(M())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var pu=fu;function yu(){this.place=0}function mu(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,a=0,s=t.place;a<n;a++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function bu(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function gu(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}fu.prototype._importDER=function(e,t){e=$o.toArray(e,t);var r=new yu;if(48!==e[r.place++])return!1;var n=mu(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=mu(e,r);if(!1===i)return!1;var a=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var s=mu(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var o=e.slice(r.place,s+r.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}return this.r=new(M())(a),this.s=new(M())(o),this.recoveryParam=null,!0},fu.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=bu(t),r=bu(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];gu(n,t.length),(n=n.concat(t)).push(2),gu(n,r.length);var i=n.concat(r),a=[48];return gu(a,i.length),a=a.concat(i),$o.encode(a,e)};var vu=function(){throw new Error("unsupported")},wu=$o.assert;function _u(e){if(!(this instanceof _u))return new _u(e);"string"==typeof e&&(wu(Object.prototype.hasOwnProperty.call(su,e),"Unknown curve "+e),e=su[e]),e instanceof su.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Mu=_u;_u.prototype.keyPair=function(e){return new cu(this,e)},_u.prototype.keyFromPrivate=function(e,t){return cu.fromPrivate(this,e,t)},_u.prototype.keyFromPublic=function(e,t){return cu.fromPublic(this,e,t)},_u.prototype.genKeyPair=function(e){e||(e={});for(var t=new uu({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||vu(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(M())(2));;){var i=new(M())(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},_u.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},_u.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(M())(e,16));for(var i=this.n.byteLength(),a=t.getPrivate().toArray("be",i),s=e.toArray("be",i),o=new uu({hash:this.hash,entropy:a,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new(M())(1)),l=0;;l++){var h=n.k?n.k(l):new(M())(o.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(u)>=0)){var c=this.g.mul(h);if(!c.isInfinity()){var d=c.getX(),f=d.umod(this.n);if(0!==f.cmpn(0)){var p=h.invm(this.n).mul(f.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var y=(c.getY().isOdd()?1:0)|(0!==d.cmp(f)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),y^=1),new pu({r:f,s:p,recoveryParam:y})}}}}}},_u.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(M())(e,16)),r=this.keyFromPublic(r,n);var i=(t=new pu(t,"hex")).r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,o=a.invm(this.n),u=o.mul(e).umod(this.n),l=o.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),l)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(u,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},_u.prototype.recoverPubKey=function(e,t,r,n){wu((3&r)===r,"The recovery param is more than two bits"),t=new pu(t,n);var i=this.n,a=new(M())(e),s=t.r,o=t.s,u=1&r,l=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var h=t.r.invm(i),c=i.sub(a).mul(h).umod(i),d=o.mul(h).umod(i);return this.g.mulAdd(c,s,d)},_u.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new pu(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Tu=zo((function(e,t){var r=t;r.version="6.5.4",r.utils=$o,r.rand=function(){throw new Error("unsupported")},r.curve=au,r.curves=su,r.ec=Mu,r.eddsa=null})).ec;const Eu=new N("signing-key/5.7.0");let Au=null;function xu(){return Au||(Au=new Tu("secp256k1")),Au}class ku{constructor(e){te(this,"curve","secp256k1"),te(this,"privateKey",H(e)),32!==$(this.privateKey)&&Eu.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=xu().keyFromPrivate(j(this.privateKey));te(this,"publicKey","0x"+t.getPublic(!1,"hex")),te(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),te(this,"_isSigningKey",!0)}_addPoint(e){const t=xu().keyFromPublic(j(this.publicKey)),r=xu().keyFromPublic(j(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=xu().keyFromPrivate(j(this.privateKey)),r=j(e);32!==r.length&&Eu.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Y({recoveryParam:n.recoveryParam,r:J("0x"+n.r.toString(16),32),s:J("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=xu().keyFromPrivate(j(this.privateKey)),r=xu().keyFromPublic(j(Su(e)));return J("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function Su(e,t){const r=j(e);if(32===r.length){const e=new ku(r);return t?"0x"+xu().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?H(r):"0x"+xu().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+xu().keyFromPublic(r).getPublic(!0,"hex"):H(r):Eu.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Iu=new N("transactions/5.7.0");var Cu;function Ou(e){return"0x"===e?null:Ge(e)}function Ru(e){return"0x"===e?it:ge.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Cu||(Cu={}));const Nu=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Pu={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Bu(e){return Ge(V(Ie(V(Su(e),1)),12))}function Du(e,t){return Bu(function(e,t){const r=Y(t),n={r:j(r.r),s:j(r.s)};return"0x"+xu().recoverPubKey(j(e),n,r.recoveryParam).encode("hex",!1)}(j(e),t))}function Lu(e,t){const r=z(ge.from(e).toHexString());return r.length>32&&Iu.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Fu(e,t){return{address:Ge(e),storageKeys:(t||[]).map(((t,r)=>(32!==$(t)&&Iu.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function Uu(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&Iu.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),Fu(e[0],e[1])):Fu(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Fu(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function ju(e){return Uu(e).map((e=>[e.address,e.storageKeys]))}function qu(e,t){if(null!=e.gasPrice){const t=ge.from(e.gasPrice),r=ge.from(e.maxFeePerGas||0);t.eq(r)||Iu.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[Lu(e.chainId||0,"chainId"),Lu(e.nonce||0,"nonce"),Lu(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Lu(e.maxFeePerGas||0,"maxFeePerGas"),Lu(e.gasLimit||0,"gasLimit"),null!=e.to?Ge(e.to):"0x",Lu(e.value||0,"value"),e.data||"0x",ju(e.accessList||[])];if(t){const e=Y(t);r.push(Lu(e.recoveryParam,"recoveryParam")),r.push(z(e.r)),r.push(z(e.s))}return W(["0x02",Pe(r)])}function zu(e,t){const r=[Lu(e.chainId||0,"chainId"),Lu(e.nonce||0,"nonce"),Lu(e.gasPrice||0,"gasPrice"),Lu(e.gasLimit||0,"gasLimit"),null!=e.to?Ge(e.to):"0x",Lu(e.value||0,"value"),e.data||"0x",ju(e.accessList||[])];if(t){const e=Y(t);r.push(Lu(e.recoveryParam,"recoveryParam")),r.push(z(e.r)),r.push(z(e.s))}return W(["0x01",Pe(r)])}function Gu(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&Iu.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){ie(e,Pu);const r=[];Nu.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=j(H(n,i)),t.length&&n.length!==t.length&&n.length>0&&Iu.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=z(n),n.length>t.maxLength&&Iu.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(H(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&Iu.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!L(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(H(n)),r.push("0x"),r.push("0x")),!t)return Pe(r);const i=Y(t);let a=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),a+=2*n+8,i.v>28&&i.v!==a&&Iu.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==a&&Iu.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(H(a)),r.push(z(j(i.r))),r.push(z(j(i.s))),Pe(r)}(e,t);switch(e.type){case 1:return zu(e,t);case 2:return qu(e,t)}return Iu.throwError(`unsupported transaction type: ${e.type}`,N.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function Ku(e,t,r){try{const r=Ru(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){Iu.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=J(t[1],32),e.s=J(t[2],32);try{const t=Ie(r(e));e.from=Du(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}const Hu="providers/5.7.2",$u=new N(Hu);class Vu{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),a=this.hash.bind(this),s=this.hex.bind(this),o=this.number.bind(this),u=this.type.bind(this);return e.transaction={hash:a,type:u,accessList:Vu.allowNull(this.accessList.bind(this),null),blockHash:Vu.allowNull(a,null),blockNumber:Vu.allowNull(o,null),transactionIndex:Vu.allowNull(o,null),confirmations:Vu.allowNull(o,null),from:t,gasPrice:Vu.allowNull(r),maxPriorityFeePerGas:Vu.allowNull(r),maxFeePerGas:Vu.allowNull(r),gasLimit:r,to:Vu.allowNull(t,null),value:r,nonce:o,data:i,r:Vu.allowNull(this.uint256),s:Vu.allowNull(this.uint256),v:Vu.allowNull(o),creates:Vu.allowNull(t,null),raw:Vu.allowNull(i)},e.transactionRequest={from:Vu.allowNull(t),nonce:Vu.allowNull(o),gasLimit:Vu.allowNull(r),gasPrice:Vu.allowNull(r),maxPriorityFeePerGas:Vu.allowNull(r),maxFeePerGas:Vu.allowNull(r),to:Vu.allowNull(t),value:Vu.allowNull(r),data:Vu.allowNull((e=>this.data(e,!0))),type:Vu.allowNull(o),accessList:Vu.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:o,blockNumber:o,transactionHash:a,address:t,topics:Vu.arrayOf(a),data:i,logIndex:o,blockHash:a},e.receipt={to:Vu.allowNull(this.address,null),from:Vu.allowNull(this.address,null),contractAddress:Vu.allowNull(t,null),transactionIndex:o,root:Vu.allowNull(s),gasUsed:r,logsBloom:Vu.allowNull(i),blockHash:a,transactionHash:a,logs:Vu.arrayOf(this.receiptLog.bind(this)),blockNumber:o,confirmations:Vu.allowNull(o,null),cumulativeGasUsed:r,effectiveGasPrice:Vu.allowNull(r),status:Vu.allowNull(o),type:u},e.block={hash:Vu.allowNull(a),parentHash:a,number:o,timestamp:o,nonce:Vu.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Vu.allowNull(t),extraData:i,transactions:Vu.allowNull(Vu.arrayOf(a)),baseFeePerGas:Vu.allowNull(r)},e.blockWithTransactions=ae(e.block),e.blockWithTransactions.transactions=Vu.allowNull(Vu.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Vu.allowNull(n,void 0),toBlock:Vu.allowNull(n,void 0),blockHash:Vu.allowNull(a,void 0),address:Vu.allowNull(t,void 0),topics:Vu.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Vu.allowNull(o),blockHash:Vu.allowNull(a),transactionIndex:o,removed:Vu.allowNull(this.boolean.bind(this)),address:t,data:Vu.allowFalsish(i,"0x"),topics:Vu.arrayOf(a),transactionHash:a,logIndex:o},e}accessList(e){return Uu(e||[])}number(e){return"0x"===e?0:ge.from(e).toNumber()}type(e){return"0x"===e||null==e?0:ge.from(e).toNumber()}bigNumber(e){return ge.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),G(e))?e.toLowerCase():$u.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return Ge(e)}callAddress(e){if(!G(e,32))return null;const t=Ge(V(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return He(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||G(e))return Z(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==$(r)?$u.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=ge.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!G(e))throw new Error("invalid uint256");return J(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=Vu.check(t,e);return n._difficulty=null==r?null:ge.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Vu.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&ge.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Vu.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;G(r)&&(r=ge.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),G(r)&&(r=ge.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return function(e){const t=j(e);if(t[0]>127)return function(e){const t=Le(e);9!==t.length&&6!==t.length&&Iu.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Ru(t[0]).toNumber(),gasPrice:Ru(t[1]),gasLimit:Ru(t[2]),to:Ou(t[3]),value:Ru(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=ge.from(t[6]).toNumber()}catch(e){return r}if(r.r=J(t[7],32),r.s=J(t[8],32),ge.from(r.r).isZero()&&ge.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push(H(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const a=Ie(Pe(i));try{r.from=Du(a,{r:H(r.r),s:H(r.s),recoveryParam:n})}catch(e){}r.hash=Ie(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=Le(e.slice(1));8!==t.length&&11!==t.length&&Iu.throwArgumentError("invalid component count for transaction type: 1","payload",H(e));const r={type:1,chainId:Ru(t[0]).toNumber(),nonce:Ru(t[1]).toNumber(),gasPrice:Ru(t[2]),gasLimit:Ru(t[3]),to:Ou(t[4]),value:Ru(t[5]),data:t[6],accessList:Uu(t[7])};return 8===t.length||(r.hash=Ie(e),Ku(r,t.slice(8),zu)),r}(t);case 2:return function(e){const t=Le(e.slice(1));9!==t.length&&12!==t.length&&Iu.throwArgumentError("invalid component count for transaction type: 2","payload",H(e));const r=Ru(t[2]),n=Ru(t[3]),i={type:2,chainId:Ru(t[0]).toNumber(),nonce:Ru(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Ru(t[4]),to:Ou(t[5]),value:Ru(t[6]),data:t[7],accessList:Uu(t[8])};return 9===t.length||(i.hash=Ie(e),Ku(i,t.slice(9),qu)),i}(t)}return Iu.throwError(`unsupported transaction type: ${t[0]}`,N.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}(e)}receiptLog(e){return Vu.check(this.formats.receiptLog,e)}receipt(e){const t=Vu.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=ge.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&$u.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):$u.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&$u.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return Vu.check(this.formats.filter,e)}filterLog(e){return Vu.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}function Wu(e){return function(e){return e&&"function"==typeof e.isCommunityResource}(e)&&e.isCommunityResource()}let Zu=!1;function Ju(){Zu||(Zu=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var Yu=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{u(n.next(e))}catch(e){a(e)}}function o(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}u((n=n.apply(e,t||[])).next())}))};const Xu=new N("abstract-signer/5.7.0"),Qu=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],el=[N.errors.INSUFFICIENT_FUNDS,N.errors.NONCE_EXPIRED,N.errors.REPLACEMENT_UNDERPRICED];class tl{constructor(){Xu.checkAbstract(new.target,tl),te(this,"_isSigner",!0)}getBalance(e){return Yu(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return Yu(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return Yu(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield ne(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return Yu(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield ne(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return Yu(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return Yu(this,void 0,void 0,(function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Yu(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Yu(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return Yu(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===Qu.indexOf(t)&&Xu.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=ae(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&Xu.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return Yu(this,void 0,void 0,(function*(){const t=yield ne(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>Yu(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Xu.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||Xu.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Xu.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&Xu.throwError("network does not support EIP-1559",N.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Xu.throwError("failed to get consistent fee data",N.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(el.indexOf(e.code)>=0)throw e;return Xu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",N.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&Xu.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield ne(t)}))}_checkProvider(e){this.provider||Xu.throwError("missing provider",N.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class rl extends tl{constructor(e,t){super(),te(this,"address",e),te(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{Xu.throwError(e,N.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new rl(this.address,e)}}function nl(e){return Ie(pt(e))}const il=new N(Ht),al=new Uint8Array(32);al.fill(0);const sl=ge.from(-1),ol=ge.from(0),ul=ge.from(1),ll=ge.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),hl=J(ul.toHexString(),32),cl=J(ol.toHexString(),32),dl={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},fl=["name","version","chainId","verifyingContract","salt"];function pl(e){return function(t){return"string"!=typeof t&&il.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const yl={name:pl("name"),version:pl("version"),chainId:function(e){try{return ge.from(e).toString()}catch(e){}return il.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return Ge(e).toLowerCase()}catch(e){}return il.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=j(e);if(32!==t.length)throw new Error("bad length");return H(t)}catch(e){}return il.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function ml(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&il.throwArgumentError("invalid numeric width","type",e);const i=ll.mask(r?n-1:n),a=r?i.add(ul).mul(sl):ol;return function(t){const r=ge.from(t);return(r.lt(a)||r.gt(i))&&il.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),J(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&il.throwArgumentError("invalid bytes width","type",e),function(t){return j(t).length!==r&&il.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=j(e),r=t.length%32;return r?W([t,al.slice(r)]):H(t)}(t)}}}switch(e){case"address":return function(e){return J(Ge(e),32)};case"bool":return function(e){return e?hl:cl};case"bytes":return function(e){return Ie(e)};case"string":return function(e){return nl(e)}}return null}function bl(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class gl{constructor(e){te(this,"types",Object.freeze(le(e))),te(this,"_encoderCache",{}),te(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const i={};e[n].forEach((a=>{i[a.name]&&il.throwArgumentError(`duplicate variable name ${JSON.stringify(a.name)} in ${JSON.stringify(n)}`,"types",e),i[a.name]=!0;const s=a.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&il.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e),ml(s)||(r[s]||il.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),r[s].push(n),t[n][s]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?il.throwArgumentError("missing primary type","types",e):i.length>1&&il.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),te(this,"primaryType",i[0]),function i(a,s){s[a]&&il.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),s[a]=!0,Object.keys(t[a]).forEach((e=>{r[e]&&(i(e,s),Object.keys(s).forEach((t=>{n[t][e]=!0})))})),delete s[a]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=bl(t,e[t])+r.map((t=>bl(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=ml(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&il.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(Ie)),Ie(W(i))}}const r=this.types[e];if(r){const t=nl(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?Ie(n):n}));return n.unshift(t),W(n)}}return il.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||il.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return Ie(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(ml(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&il.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const i=this.types[e];return i?i.reduce(((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e)),{}):il.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new gl(e)}static getPrimaryType(e){return gl.from(e).primaryType}static hashStruct(e,t,r){return gl.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=dl[r];n||il.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>fl.indexOf(e.name)-fl.indexOf(t.name))),gl.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return W(["0x1901",gl.hashDomain(e),gl.from(t).hash(r)])}static hash(e,t,r){return Ie(gl.encode(e,t,r))}static resolveNames(e,t,r,n){return i=this,a=void 0,o=function*(){e=ae(e);const i={};e.verifyingContract&&!G(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const a=gl.from(t);a.visit(r,((e,t)=>("address"!==e||G(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=a.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}},new((s=void 0)||(s=Promise))((function(e,t){function r(e){try{u(o.next(e))}catch(e){t(e)}}function n(e){try{u(o.throw(e))}catch(e){t(e)}}function u(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s((function(e){e(i)}))).then(r,n)}u((o=o.apply(i,a||[])).next())}));var i,a,s,o}static getPayload(e,t,r){gl.hashDomain(e);const n={},i=[];fl.forEach((t=>{const r=e[t];null!=r&&(n[t]=yl[t](r),i.push({name:t,type:dl[t]}))}));const a=gl.from(t),s=ae(t);return s.EIP712Domain?il.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):s.EIP712Domain=i,a.encode(r),{types:s,domain:n,primaryType:a.primaryType,message:a.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return H(j(t));if(e.match(/^u?int/))return ge.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&il.throwArgumentError("invalid string","value",t),t}return il.throwArgumentError("unsupported type","type",e)}))}}}var vl=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{u(n.next(e))}catch(e){a(e)}}function o(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}u((n=n.apply(e,t||[])).next())}))};function wl(e,t){return vl(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),i=yield n.arrayBuffer(),a={};return n.headers.forEach?n.headers.forEach(((e,t)=>{a[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{a[e.toLowerCase()]=n.headers.get(e)})),{headers:a,statusCode:n.status,statusMessage:n.statusText,body:j(new Uint8Array(i))}}))}const _l=new N("web/5.7.1");function Ml(e){return new Promise((t=>{setTimeout(t,e)}))}function Tl(e,t){if(null==e)return null;if("string"==typeof e)return e;if(L(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return yt(e)}catch(e){}return H(e)}return e}function El(e,t,r){let n=null;if(null!=t){n=pt(t);const r="string"==typeof e?{url:e}:ae(e);r.headers?0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length||(r.headers=ae(r.headers),r.headers["content-type"]="application/json"):r.headers={"content-type":"application/json"},e=r}return function(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;_l.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof e?e.throttleCallback:null,a="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;_l.assertArgument(a>0&&a%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",a);const s="object"==typeof e&&!!e.errorPassThrough,o={};let u=null;const l={method:"GET"};let h=!1,c=12e4;if("string"==typeof e)u=e;else if("object"==typeof e){if(null!=e&&null!=e.url||_l.throwArgumentError("missing URL","connection.url",e),u=e.url,"number"==typeof e.timeout&&e.timeout>0&&(c=e.timeout),e.headers)for(const t in e.headers)o[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(h=!0);if(l.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==u.substring(0,6)&&!0!==e.allowInsecureAuthentication&&_l.throwError("basic authentication requires a secure https url",N.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;o.authorization={key:"Authorization",value:"Basic "+Vt(pt(t))}}null!=e.skipFetchSetup&&(l.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(l.fetchOptions=ae(e.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),f=u?u.match(d):null;if(f)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":f[1]||"text/plain"},body:f[2]?$t(f[3]):(p=f[3],pt(p.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){_l.throwError("processing response error",N.errors.SERVER_ERROR,{body:Tl(f[1],f[2]),error:e,requestBody:null,requestMethod:"GET",url:u})}var p;t&&(l.method="POST",l.body=t,null==o["content-type"]&&(o["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==o["content-length"]&&(o["content-length"]={key:"Content-Length",value:String(t.length)}));const y={};Object.keys(o).forEach((e=>{const t=o[e];y[t.key]=t.value})),l.headers=y;const m=function(){let e=null;return{promise:new Promise((function(t,r){c&&(e=setTimeout((()=>{null!=e&&(e=null,r(_l.makeError("timeout",N.errors.TIMEOUT,{requestBody:Tl(l.body,y["content-type"]),requestMethod:l.method,timeout:c,url:u})))}),c))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),b=function(){return e=this,t=void 0,c=function*(){for(let e=0;e<n;e++){let t=null;try{if(t=yield wl(u,l),e<n)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===l.method&&e.match(/^https:/)){u=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(i&&(r=yield i(e,u)),r){let r=0;const n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):a*parseInt(String(Math.random()*Math.pow(2,e))),yield Ml(r);continue}}}catch(e){t=e.response,null==t&&(m.cancel(),_l.throwError("missing response",N.errors.SERVER_ERROR,{requestBody:Tl(l.body,y["content-type"]),requestMethod:l.method,serverError:e,url:u}))}let o=t.body;if(h&&304===t.statusCode?o=null:!s&&(t.statusCode<200||t.statusCode>=300)&&(m.cancel(),_l.throwError("bad response",N.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Tl(o,t.headers?t.headers["content-type"]:null),requestBody:Tl(l.body,y["content-type"]),requestMethod:l.method,url:u})),r)try{const e=yield r(o,t);return m.cancel(),e}catch(r){if(r.throttleRetry&&e<n){let t=!0;if(i&&(t=yield i(e,u)),t){const t=a*parseInt(String(Math.random()*Math.pow(2,e)));yield Ml(t);continue}}m.cancel(),_l.throwError("processing response error",N.errors.SERVER_ERROR,{body:Tl(o,t.headers?t.headers["content-type"]:null),error:r,requestBody:Tl(l.body,y["content-type"]),requestMethod:l.method,url:u})}return m.cancel(),o}return _l.throwError("failed response",N.errors.SERVER_ERROR,{requestBody:Tl(l.body,y["content-type"]),requestMethod:l.method,url:u})},new((o=void 0)||(o=Promise))((function(r,n){function i(e){try{s(c.next(e))}catch(e){n(e)}}function a(e){try{s(c.throw(e))}catch(e){n(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}s((c=c.apply(e,t||[])).next())}));var e,t,o,c}();return Promise.race([m.promise,b])}(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(yt(e))}catch(t){_l.throwError("invalid JSON",N.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Al(e,t){return t||(t={}),null==(t=ae(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let i=null,a=!1;const s=()=>!a&&(a=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{s()&&n(new Error("timeout"))}),t.timeout));const o=t.retryLimit;let u=0;!function i(){return e().then((function(e){if(void 0!==e)s()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!a){if(u++,u>o)return void(s()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){s()&&n(e)}))}()}))}const xl=new N("abstract-provider/5.7.0");class kl extends he{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class Sl{constructor(){xl.checkAbstract(new.target,Sl),te(this,"_isProvider",!0)}getFeeData(){return e=this,t=void 0,n=function*(){const{block:e,gasPrice:t}=yield ne({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,i=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,i=ge.from("1500000000"),n=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:i,gasPrice:t}},new((r=void 0)||(r=Promise))((function(i,a){function s(e){try{u(n.next(e))}catch(e){a(e)}}function o(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}u((n=n.apply(e,t||[])).next())}));var e,t,r,n}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}class Il{constructor(e){te(this,"alphabet",e),te(this,"base",e.length),te(this,"_alphabetMap",{}),te(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=j(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let n=t[e];for(let e=0;e<r.length;++e)n+=r[e]<<8,r[e]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e<t.length-1;++e)n+=this._leader;for(let e=r.length-1;e>=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let i=n;for(let e=0;e<t.length;++e)i+=t[e]*this.base,t[e]=255&i,i>>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return j(new Uint8Array(t.reverse()))}}new Il("abcdefghijklmnopqrstuvwxyz234567");const Cl=new Il("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var Ol=i(2882),Rl=i.n(Ol),Nl=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{u(n.next(e))}catch(e){a(e)}}function o(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}u((n=n.apply(e,t||[])).next())}))};const Pl=new N(Hu);function Bl(e){return null==e?"null":(32!==$(e)&&Pl.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Dl(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[Bl(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return Bl(e)})).join("&")}function Ll(e){if("string"==typeof e){if(32===$(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Dl(e);if(kl.isForkEvent(e))throw Pl.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Dl(e.topics||[])}throw new Error("invalid event - "+e)}function Fl(){return(new Date).getTime()}function Ul(e){return new Promise((t=>{setTimeout(t,e)}))}const jl=["block","network","pending","poll"];class ql{constructor(e,t,r){te(this,"tag",e),te(this,"listener",t),te(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const i={};return r.length>0&&(i.topics=r),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||jl.indexOf(this.tag)>=0}}const zl={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Gl(e){return J(ge.from(e).toHexString(),32)}function Kl(e){return Cl.encode(q([e,V(Mr(Mr(e)),0,4)]))}const Hl=new RegExp("^(ipfs)://(.*)$","i"),$l=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Hl,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Vl(e,t){try{return yt(Wl(e,t))}catch(e){}return null}function Wl(e,t){if("0x"===e)return null;const r=ge.from(V(e,t,t+32)).toNumber(),n=ge.from(V(e,r,r+32)).toNumber();return V(e,r+32,r+32+n)}function Zl(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Pl.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function Jl(e){const t=j(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function Yl(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Xl(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(null),r+=32;for(let n=0;n<e.length;n++){const i=j(e[n]);t[n]=Jl(r),t.push(Jl(i.length)),t.push(Yl(i)),r+=32+32*Math.ceil(i.length/32)}return W(t)}class Ql{constructor(e,t,r,n){te(this,"provider",e),te(this,"name",r),te(this,"address",e.formatter.address(t)),te(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((e=>ge.from(e).eq(1))).catch((e=>{if(e.code===N.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Nl(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:W([e,br(this.name),t||"0x"])};let n=!1;var i;(yield this.supportsWildcard())&&(n=!0,r.data=W(["0x9061b923",Xl([(i=this.name,H(q(mr(i).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),r.data])]));try{let e=yield this.provider.call(r);return j(e).length%32==4&&Pl.throwError("resolver threw error",N.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=Wl(e,0)),e}catch(e){if(e.code===N.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Nl(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?Wl(r,0):null}))}_getAddress(e,t){const r=zl[String(e)];if(null==r&&Pl.throwError(`unsupported coin type: ${e}`,N.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=j(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return Kl(q([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return Kl(q([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=Rl().toWords(n.slice(2));return e.unshift(t),Rl().encode(r.prefix,e)}}return null}getAddress(e){return Nl(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||"0x0000000000000000000000000000000000000000000000000000000000000000"===e?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===N.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",Gl(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Pl.throwError("invalid or unsupported coin data",N.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return Nl(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;r<$l.length;r++){const n=t.match($l[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:Zl(t)};case"erc721":case"erc1155":{const r="erc721"===i?"0xc87b56dd":"0x0e89341c";e.push({type:i,content:t});const a=this._resolvedAddress||(yield this.getAddress()),s=(n[2]||"").split("/");if(2!==s.length)return null;const o=yield this.provider.formatter.address(s[0]),u=J(ge.from(s[1]).toHexString(),32);if("erc721"===i){const t=this.provider.formatter.callAddress(yield this.provider.call({to:o,data:W(["0x6352211e",u])}));if(a!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===i){const t=ge.from(yield this.provider.call({to:o,data:W(["0x00fdd58e",J(a,32),u])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const l={to:this.provider.formatter.address(s[0]),data:W([r,u])};let h=Vl(yield this.provider.call(l),0);if(null==h)return null;e.push({type:"metadata-url-base",content:h}),"erc1155"===i&&(h=h.replace("{id}",u.substring(2)),e.push({type:"metadata-url-expanded",content:h})),h.match(/^ipfs:/i)&&(h=Zl(h)),e.push({type:"metadata-url",content:h});const c=yield El(h);if(!c)return null;e.push({type:"metadata",content:JSON.stringify(c)});let d=c.image;if("string"!=typeof d)return null;if(d.match(/^(https:\/\/|data:)/i));else{if(null==d.match(Hl))return null;e.push({type:"url-ipfs",content:d}),d=Zl(d)}return e.push({type:"url",content:d}),{linkage:e,url:d}}}}}catch(e){}return null}))}getContentHash(){return Nl(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+Cl.encode("0x"+t[1])}const r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const e=parseInt(r[3],16);if(r[4].length===2*e)return"ipns://"+Cl.encode("0x"+r[1])}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const i=e.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+Vt("0x"+i[1]).replace(/[=+\/]/g,(t=>e[t]))}return Pl.throwError("invalid or unsupported content hash data",N.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Nl(this,void 0,void 0,(function*(){let t=pt(e);t=q([Gl(64),Gl(t.length),t]),t.length%32!=0&&(t=q([t,J("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",H(t));return null==r||"0x"===r?null:yt(r)}))}}let eh=null,th=1;class rh extends Sl{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),te(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=re(new.target,"getNetwork")(e);t?(te(this,"_network",t),this.emit("network",t,null)):Pl.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Nl(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||Pl.throwError("no network detected",N.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:te(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Al((()=>this._ready().then((e=>e),(e=>{if(e.code!==N.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==eh&&(eh=new Vu),eh}static getNetwork(e){return qo(null==e?"homestead":e)}ccipReadFetch(e,t,r){return Nl(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),a=[];for(let e=0;e<r.length;e++){const t=r[e],s=t.replace("{sender}",n).replace("{data}",i),o=t.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),u=yield El({url:s,errorPassThrough:!0},o,((e,t)=>(e.status=t.statusCode,e)));if(u.data)return u.data;const l=u.message||"unknown error";if(u.status>=400&&u.status<500)return Pl.throwError(`response not found during CCIP fetch: ${l}`,N.errors.SERVER_ERROR,{url:t,errorMessage:l});a.push(l)}return Pl.throwError(`error encountered during CCIP fetch: ${a.map((e=>JSON.stringify(e))).join(", ")}`,N.errors.SERVER_ERROR,{urls:r,errorMessages:a})}))}_getInternalBlockNumber(e){return Nl(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(Fl()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Fl(),r=ne({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=Fl();return(e=ge.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:i}}));return this._internalBlockNumber=r,r.catch((e=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return Nl(this,void 0,void 0,(function*(){const e=th++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)Pl.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Pl.makeError("network block skew detected",N.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);const a=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(a)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Nl(this,void 0,void 0,(function*(){return Pl.throwError("provider does not support network detection",N.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Nl(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield Ul(0),this._network;const r=Pl.makeError("underlying network changed",N.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=Fl();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=Fl(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return Nl(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return Nl(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,a)=>{const s=[];let o=!1;const u=function(){return!!o||(o=!0,s.forEach((e=>{e()})),!1)},l=e=>{e.confirmations<t||u()||i(e)};if(this.on(e,l),s.push((()=>{this.removeListener(e,l)})),n){let r=n.startBlock,i=null;const l=s=>Nl(this,void 0,void 0,(function*(){o||(yield Ul(1e3),this.getTransactionCount(n.from).then((h=>Nl(this,void 0,void 0,(function*(){if(!o){if(h<=n.nonce)r=s;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3,i<n.startBlock&&(i=n.startBlock));i<=s;){if(o)return;const r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){const s=r.transactions[i];if(s.hash===e)return;if(s.from===n.from&&s.nonce===n.nonce){if(o)return;const r=yield this.waitForTransaction(s.hash,t);if(u())return;let i="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?i="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(i="cancelled"),void a(Pl.makeError("transaction was replaced",N.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(s),hash:e,receipt:r}))}}i++}}o||this.once("block",l)}}))),(e=>{o||this.once("block",l)})))}));if(o)return;this.once("block",l),s.push((()=>{this.removeListener("block",l)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{u()||a(Pl.makeError("timeout exceeded",N.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),s.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Nl(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Nl(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return ge.from(e)}catch(t){return Pl.throwError("bad result from backend",N.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Nl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ne({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return ge.from(n)}catch(e){return Pl.throwError("bad result from backend",N.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return Nl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ne({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return ge.from(n).toNumber()}catch(e){return Pl.throwError("bad result from backend",N.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return Nl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ne({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return H(n)}catch(e){return Pl.throwError("bad result from backend",N.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return Nl(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield ne({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>Z(e)))}),i=yield this.perform("getStorageAt",n);try{return H(i)}catch(e){return Pl.throwError("bad result from backend",N.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==$(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&Pl.throwError("Transaction hash mismatch from Provider.sendTransaction.",N.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>Nl(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const a=yield this._waitForTransaction(e.hash,t,n,i);return null==a&&0===t?null:(this._emitted["t:"+e.hash]=a.blockNumber,0===a.status&&Pl.throwError("transaction failed",N.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:a}),a)})),n}sendTransaction(e){return Nl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>H(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return Nl(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?ge.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?H(e):null)))})),this.formatter.transactionRequest(yield ne(r))}))}_getFilter(e){return Nl(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield ne(t))}))}_call(e,t,r){return Nl(this,void 0,void 0,(function*(){r>=10&&Pl.throwError("CCIP read exceeded maximum redirections",N.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&$(i)%32==4)try{const a=V(i,4),s=V(a,0,32);ge.from(s).eq(n)||Pl.throwError("CCIP Read sender did not match",N.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const o=[],u=ge.from(V(a,32,64)).toNumber(),l=ge.from(V(a,u,u+32)).toNumber(),h=V(a,u+32);for(let t=0;t<l;t++){const r=Vl(h,32*t);null==r&&Pl.throwError("CCIP Read contained corrupt URL string",N.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),o.push(r)}const c=Wl(a,64);ge.from(V(a,100,128)).isZero()||Pl.throwError("CCIP Read callback selector included junk",N.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const d=V(a,96,100),f=Wl(a,128),p=yield this.ccipReadFetch(e,c,o);null==p&&Pl.throwError("CCIP Read disabled or provided no URLs",N.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const y={to:n,data:W([d,Xl([p,f])])};return this._call(y,t,r+1)}catch(e){if(e.code===N.errors.SERVER_ERROR)throw e}try{return H(i)}catch(r){return Pl.throwError("bad result from backend",N.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:i,error:r})}}))}call(e,t){return Nl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ne({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(e){return Nl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield ne({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return ge.from(r)}catch(e){return Pl.throwError("bad result from backend",N.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}}))}_getAddress(e){return Nl(this,void 0,void 0,(function*(){"string"!=typeof(e=yield e)&&Pl.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&Pl.throwError("ENS name not configured",N.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return Nl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if(G(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),G(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(t){Pl.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return Al((()=>Nl(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;r<e.transactions.length;r++){const n=e.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}}const r=this.formatter.blockWithTransactions(e);return r.transactions=r.transactions.map((e=>this._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Nl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Al((()=>Nl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return Nl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Al((()=>Nl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return Nl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield ne({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),Vu.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return Nl(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Nl(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Pl.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return Nl(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new Ql(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Nl(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Pl.throwError("network does not support ENS",N.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+br(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return Nl(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(G(e))throw t}"string"!=typeof e&&Pl.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Nl(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=Vl(yield this.call({to:r,data:"0x691f3431"+br(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return Nl(this,void 0,void 0,(function*(){let t=null;if(G(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new Ql(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==N.errors.CALL_EXCEPTION)throw e}try{const e=Vl(yield this.call({to:n,data:"0x691f3431"+br(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==N.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return Pl.throwError(e+" not implemented",N.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new ql(Ll(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=Ll(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=Ll(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Ll(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,i=Ll(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||!!n||(n=!0,r.push(e),!1))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=Ll(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var nh=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{u(n.next(e))}catch(e){a(e)}}function o(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}u((n=n.apply(e,t||[])).next())}))};const ih=new N(Hu),ah=["call","estimateGas"];function sh(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=G(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=sh(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return sh(JSON.parse(e),t)}catch(e){}return null}function oh(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=sh(t,!0);if(e)return e.data;ih.throwError("missing revert data in call exception; Transaction reverted without a reason string",N.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=sh(t.body,!1);null==r&&(r=sh(t,!1)),r&&ih.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",N.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===N.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&ih.throwError("insufficient funds for intrinsic transaction cost",N.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&ih.throwError("nonce has already been used",N.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ih.throwError("replacement fee too low",N.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&ih.throwError("legacy pre-eip-155 transactions not supported",N.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),ah.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ih.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",N.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function uh(e){return new Promise((function(t){setTimeout(t,e)}))}function lh(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function hh(e){return e?e.toLowerCase():e}const ch={};class dh extends tl{constructor(e,t,r){if(super(),e!==ch)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");te(this,"provider",t),null==r&&(r=0),"string"==typeof r?(te(this,"_address",this.provider.formatter.address(r)),te(this,"_index",null)):"number"==typeof r?(te(this,"_index",r),te(this,"_address",null)):ih.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return ih.throwError("cannot alter JSON-RPC Signer connection",N.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new fh(ch,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&ih.throwError("unknown account #"+this._index,N.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=ae(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=ae(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>nh(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&ih.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),ne({tx:ne(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&ih.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&ih.throwError("user rejected transaction",N.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),oh("sendTransaction",e,n))))}))}signTransaction(e){return ih.throwError("signing transactions is unsupported",N.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return nh(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Al((()=>nh(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return nh(this,void 0,void 0,(function*(){const t="string"==typeof e?pt(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[H(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&ih.throwError("user rejected signing",N.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return nh(this,void 0,void 0,(function*(){const t="string"==typeof e?pt(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),H(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&ih.throwError("user rejected signing",N.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return nh(this,void 0,void 0,(function*(){const n=yield gl.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(gl.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&ih.throwError("user rejected signing",N.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return nh(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class fh extends dh{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const ph={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class yh extends rh{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=re(this.constructor,"defaultUrl")()),te(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(ae(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return nh(this,void 0,void 0,(function*(){yield uh(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=re(this.constructor,"getNetwork");try{return t(ge.from(e).toNumber())}catch(t){return ih.throwError("could not detect network",N.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return ih.throwError("could not detect network",N.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new dh(ch,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:le(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=El(this.connection,JSON.stringify(r),lh).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[hh(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[hh(t.address),t.blockTag]];case"getCode":return["eth_getCode",[hh(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[hh(t.address),J(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[re(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[re(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=hh(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return nh(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&ge.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=ae(t)).transaction=ae(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&ih.throwError(e+" not implemented",N.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return oh(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return uh(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=ae(ph);if(t)for(const e in t)t[e]&&(r[e]=!0);ie(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=Z(ge.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=H(e[t]))})),e.accessList&&(n.accessList=Uu(e.accessList)),n}}let mh=null;try{if(mh=WebSocket,null==mh)throw new Error("inject please")}catch(e){const t=new N(Hu);mh=function(){t.throwError("WebSockets not supported in this environment",N.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var bh=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{u(n.next(e))}catch(e){a(e)}}function o(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}u((n=n.apply(e,t||[])).next())}))};const gh=new N(Hu);let vh=1;class wh extends yh{constructor(e,t){"any"===t&&gh.throwError("WebSocketProvider does not support 'any' network yet",N.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"==typeof e?e:"_websocket",t),this._pollingInterval=-1,this._wsReady=!1,te(this,"_websocket","string"==typeof e?new mh(this.connection.url):e),te(this,"_requests",{}),te(this,"_subs",{}),te(this,"_subIds",{}),te(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((e=>{this.websocket.send(this._requests[e].payload)}))},this.websocket.onmessage=e=>{const t=e.data,r=JSON.parse(t);if(null!=r.id){const e=String(r.id),n=this._requests[e];if(delete this._requests[e],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let e=null;r.error?(e=new Error(r.error.message||"unknown error"),te(e,"code",r.error.code||null),te(e,"response",t)):e=new Error("unknown error"),n.callback(e,void 0),this.emit("debug",{action:"response",error:e,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const e=this._subs[r.params.subscription];e&&e.processFunc(r.params.result)}else console.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){gh.throwError("cannot reset events block on WebSocketProvider",N.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){gh.throwError("cannot set polling interval on WebSocketProvider",N.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return bh(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&gh.throwError("cannot set polling on WebSocketProvider",N.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const r=vh++;return new Promise(((n,i)=>{const a=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(a),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?i(e):n(t)},payload:a},this._wsReady&&this.websocket.send(a)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return bh(this,void 0,void 0,(function*(){let n=this._subIds[e];null==n&&(n=Promise.all(t).then((e=>this.send("eth_subscribe",e))),this._subIds[e]=n);const i=yield n;this._subs[i]={tag:e,processFunc:r}}))}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],(e=>{const t=ge.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(e=>{this.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))}));break;case"tx":{const t=e=>{const t=e.hash;this.getTransactionReceipt(t).then((e=>{e&&this.emit(t,e)}))};t(e),this._subscribe("tx",["newHeads"],(e=>{this._events.filter((e=>"tx"===e.type)).forEach(t)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter((e=>"tx"===e.type)).length)return;t="tx"}else if(this.listenerCount(e.event))return;const r=this._subIds[t];r&&(delete this._subIds[t],r.then((e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))})))}destroy(){return bh(this,void 0,void 0,(function*(){this.websocket.readyState===mh.CONNECTING&&(yield new Promise((e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}}))),this.websocket.close(1e3)}))}}const _h=new N(Hu);class Mh extends yh{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return t=this,r=void 0,i=function*(){let t=this.network;return null==t&&(t=yield e.detectNetwork.call(this),t||_h.throwError("no network detected",N.errors.UNKNOWN_ERROR,{}),null==this._network&&(te(this,"_network",t),this.emit("network",t,null))),t},new((n=void 0)||(n=Promise))((function(e,a){function s(e){try{u(i.next(e))}catch(e){a(e)}}function o(e){try{u(i.throw(e))}catch(e){a(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,o)}u((i=i.apply(t,r||[])).next())}));var t,r,n,i}}class Th extends Mh{constructor(e,t){_h.checkAbstract(new.target,Th),e=re(new.target,"getNetwork")(e),t=re(new.target,"getApiKey")(t),super(re(new.target,"getUrl")(e,t),e),"string"==typeof t?te(this,"apiKey",t):null!=t&&Object.keys(t).forEach((e=>{te(this,e,t[e])}))}_startPending(){_h.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return _h.throwError("API provider does not support signing",N.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return _h.throwError("not implemented; sub-classes must override getUrl",N.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const Eh=new N(Hu),Ah="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class xh extends wh{constructor(e,t){const r=new kh(e,t);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),te(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===Ah}}class kh extends Th{static getWebSocketProvider(e,t){return new xh(e,t)}static getApiKey(e){return null==e?Ah:(e&&"string"!=typeof e&&Eh.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:Eh.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===Ah&&Ju(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===Ah}}const Sh=new N(Hu),Ih="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Ch(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return Sh.throwArgumentError("unsupported network","name",e)}class Oh extends Th{isCommunityResource(){return this.apiKey===Ih}static getApiKey(e){return null==e?Ih:e}static getUrl(e,t){null==t&&(t=Ih);const r={allowGzip:!0,url:"https://"+Ch(e.name)+t,throttleCallback:(e,r)=>(t.apiKey===Ih&&Ju(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}const Rh=new N(Hu);class Nh extends Th{static getApiKey(e){return null!=e&&Rh.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;return"homestead"===e.name?r="https://cloudflare-eth.com/":Rh.throwArgumentError("unsupported network","network",arguments[0]),r}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return n=this,i=void 0,s=function*(){return"getBlockNumber"===e?(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number:r.perform.call(this,e,t)},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{u(s.next(e))}catch(e){t(e)}}function o(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a((function(e){e(n)}))).then(r,o)}u((s=s.apply(n,i||[])).next())}));var n,i,a,s}}var Ph=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{u(n.next(e))}catch(e){a(e)}}function o(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}u((n=n.apply(e,t||[])).next())}))};const Bh=new N(Hu);function Dh(e){const t={};for(let r in e){if(null==e[r])continue;let n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?Z(H(n)):"accessList"===r?"["+Uu(n).map((e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`)).join(",")+"]":H(n),t[r]=n)}return t}function Lh(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!=typeof e.message||!e.message.match(/^OK/)){const t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function Fh(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){const t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function Uh(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function jh(e,t,r){if("call"===e&&t.code===N.errors.SERVER_ERROR){const e=t.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){let r=e.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),G(r))return r;Bh.throwError("missing revert data in call exception",N.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===N.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?n=t.error.message:"string"==typeof t.body?n=t.body:"string"==typeof t.responseText&&(n=t.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&Bh.throwError("insufficient funds for intrinsic transaction cost",N.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Bh.throwError("nonce has already been used",N.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&Bh.throwError("replacement fee too low",N.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&Bh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",N.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class qh extends rh{constructor(e,t){super(e),te(this,"baseUrl",this.getBaseUrl()),te(this,"apiKey",t||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return Bh.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,t){const r=Object.keys(t).reduce(((e,r)=>{const n=t[r];return null!=n&&(e+=`&${r}=${n}`),e}),""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,r){return Ph(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null,a="proxy"===e?Fh:Lh;this.emit("debug",{action:"request",request:n,provider:this});const s={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&Ju(),Promise.resolve(!0))};let o=null;i&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},o=Object.keys(i).map((e=>`${e}=${i[e]}`)).join("&"));const u=yield El(s,o,a||Fh);return this.emit("debug",{action:"response",request:n,response:le(u),provider:this}),u}))}detectNetwork(){return Ph(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return Ph(this,void 0,void 0,(function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((e=>jh("sendTransaction",e,t.signedTransaction)));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const e=Dh(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(e){return jh("call",e,t.transaction)}}case"estimateGas":{const e=Dh(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(e){return jh("estimateGas",e,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=Uh(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=Uh(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Bh.throwError("unsupported topic count",N.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const r=t.filter.topics[0];"string"==typeof r&&66===r.length||Bh.throwError("unsupported topic format",N.errors.UNSUPPORTED_OPERATION,{topic0:r}),e.topic0=r}const r=yield this.fetch("logs",e);let n={};for(let e=0;e<r.length;e++){const t=r[e];if(null==t.blockHash){if(null==n[t.blockNumber]){const e=yield this.getBlock(t.blockNumber);e&&(n[t.blockNumber]=e.hash)}t.blockHash=n[t.blockNumber]}}return r}case"getEtherPrice":return"homestead"!==this.network.name?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd)}return r.perform.call(this,e,t)}))}getHistory(e,t,r){return Ph(this,void 0,void 0,(function*(){const n={action:"txlist",address:yield this.resolveName(e),startblock:null==t?0:t,endblock:null==r?99999999:r,sort:"asc"};return(yield this.fetch("account",n)).map((e=>{["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);const t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t}))}))}isCommunityResource(){return null==this.apiKey}}var zh=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{u(n.next(e))}catch(e){a(e)}}function o(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}u((n=n.apply(e,t||[])).next())}))};const Gh=new N(Hu);function Kh(){return(new Date).getTime()}function Hh(e){let t=null;for(let r=0;r<e.length;r++){const n=e[r];if(null==n)return null;t?t.name===n.name&&t.chainId===n.chainId&&(t.ensAddress===n.ensAddress||null==t.ensAddress&&null==n.ensAddress)||Gh.throwArgumentError("provider mismatch","networks",e):t=n}return t}function $h(e,t){e=e.slice().sort();const r=Math.floor(e.length/2);if(e.length%2)return e[r];const n=e[r-1],i=e[r];return null!=t&&Math.abs(n-i)>t?null:(n+i)/2}function Vh(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(ge.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>Vh(e))));if("object"==typeof e){const t=Object.keys(e);return t.sort(),"{"+t.map((t=>{let r=e[t];return r="function"==typeof r?"[function]":Vh(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let Wh=1;function Zh(e){let t=null,r=null,n=new Promise((n=>{t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:e=>(n=n.then(e),n)}}const Jh=[N.errors.CALL_EXCEPTION,N.errors.INSUFFICIENT_FUNDS,N.errors.NONCE_EXPIRED,N.errors.REPLACEMENT_UNDERPRICED,N.errors.UNPREDICTABLE_GAS_LIMIT],Yh=["address","args","errorArgs","errorSignature","method","transaction"];function Xh(e,t){const r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function Qh(e,t){return zh(this,void 0,void 0,(function*(){const r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:Al((()=>new Promise(((n,i)=>{setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function ec(e,t,r,n){return zh(this,void 0,void 0,(function*(){let i=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&G(n.blockTag)&&(i=yield Qh(e,t)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&G(n.blockTag)&&(i=yield Qh(e,t)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&G(n.blockTag)&&(i=yield Qh(e,t)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&G(n.blockTag)&&(i=yield Qh(e,t)),"call"===r&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&G(r.fromBlock)||r.toBlock&&G(r.toBlock))&&(i=yield Qh(e,t)),i.getLogs(r)}}return Gh.throwError("unknown method error",N.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class tc extends rh{constructor(e,t){0===e.length&&Gh.throwArgumentError("missing providers","providers",e);const r=e.map(((e,t)=>{if(Sl.isProvider(e)){const t=Wu(e)?2e3:750,r=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:r})}const r=ae(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=Wu(e)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&Gh.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,n),Object.freeze(r)})),n=r.reduce(((e,t)=>e+t.weight),0);null==t?t=n/2:t>n&&Gh.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let i=Hh(r.map((e=>e.provider.network)));null==i&&(i=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then(e,t)}),0)}))),super(i),te(this,"providerConfigs",Object.freeze(r)),te(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return zh(this,void 0,void 0,(function*(){return Hh(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}))}perform(e,t){return zh(this,void 0,void 0,(function*(){if("sendTransaction"===e){const e=yield Promise.all(this.providerConfigs.map((e=>e.provider.sendTransaction(t.signedTransaction).then((e=>e.hash),(e=>e)))));for(let t=0;t<e.length;t++){const r=e[t];if("string"==typeof r)return r}throw e[0]}-1===this._highestBlockNumber&&"getBlockNumber"!==e&&(yield this.getBlockNumber());const r=function(e,t,r){let n=Vh;switch(t){case"getBlockNumber":return function(t){const r=t.map((e=>e.result));let n=$h(t.map((e=>e.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){const t=e.map((e=>e.result));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return $h(e.map((e=>e.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=ae(e)).confirmations=-1,Vh(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=ae(e)).transactions=e.transactions.map((e=>((e=ae(e)).confirmations=-1,e))),Vh(e))}:function(e){return null==e?null:Vh(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){const n={};r.forEach((t=>{const r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));const i=Object.keys(n);for(let e=0;e<i.length;e++){const r=n[i[e]];if(r.count>=t)return r.result}}}(n,e.quorum)}(this,e,t),n=function(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}(this.providerConfigs.map(ae));n.sort(((e,t)=>e.priority-t.priority));const i=this._highestBlockNumber;let a=0,s=!0;for(;;){const o=Kh();let u=n.filter((e=>e.runner&&o-e.start<e.stallTimeout)).reduce(((e,t)=>e+t.weight),0);for(;u<this.quorum&&a<n.length;){const r=n[a++],s=Wh++;r.start=Kh(),r.staller=Zh(r.stallTimeout),r.staller.wait((()=>{r.staller=null})),r.runner=ec(r,i,e,t).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Xh(r,Kh()),request:{method:e,params:le(t)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Xh(r,Kh()),request:{method:e,params:le(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Xh(r,null),request:{method:e,params:le(t)},provider:this}),u+=r.weight}const l=[];n.forEach((e=>{!e.done&&e.runner&&(l.push(e.runner),e.staller&&l.push(e.staller.getPromise()))})),l.length&&(yield Promise.race(l));const h=n.filter((e=>e.done&&null==e.error));if(h.length>=this.quorum){const e=r(h);if(void 0!==e)return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;s||(yield Zh(100).getPromise()),s=!1}const c=n.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const r=t.error.code;return Jh.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{});if(Object.keys(c).forEach((e=>{const t=c[e];if(t.weight<this.quorum)return;n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}));const r=t.error,i={};Yh.forEach((e=>{null!=r[e]&&(i[e]=r[e])})),Gh.throwError(r.reason||r.message,e,i)})),0===n.filter((e=>!e.done)).length)break}return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),Gh.throwError("failed to meet quorum",N.errors.SERVER_ERROR,{method:e,params:t,results:n.map((e=>Xh(e))),provider:this})}))}}const rc=null,nc=new N(Hu),ic="84842078b09946638c03157f83405213";class ac extends wh{constructor(e,t){const r=new sc(e,t),n=r.connection;n.password&&nc.throwError("INFURA WebSocket project secrets unsupported",N.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"}),super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),te(this,"apiKey",r.projectId),te(this,"projectId",r.projectId),te(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===ic}}class sc extends Th{static getWebSocketProvider(e,t){return new ac(e,t)}static getApiKey(e){const t={apiKey:ic,projectId:ic,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(nc.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),nc.assertArgument("string"==typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:nc.throwError("unsupported network",N.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===ic&&Ju(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===ic}}const oc=new N(Hu);class uc extends Th{static getApiKey(e){return e&&"string"!=typeof e&&oc.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){oc.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:oc.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}const lc=new N(Hu),hc="62e1ad51b37b8e00394bda3b";class cc extends Th{static getApiKey(e){const t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=hc:"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:lc.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:lc.throwError("unsupported network",N.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={headers:{},url:`https://${r}/v1/lb/${t.applicationId}`};return null!=t.applicationSecretKey&&(n.user="",n.password=t.applicationSecretKey),n}isCommunityResource(){return this.applicationId===hc}}const dc=new N(Hu);let fc=1;function pc(e,t){const r="Web3LegacyFetcher";return function(e,n){const i={method:e,params:n,id:fc++,jsonrpc:"2.0"};return new Promise(((e,n)=>{this.emit("debug",{action:"request",fetcher:r,request:le(i),provider:this}),t(i,((t,a)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:i,provider:this}),n(t);if(this.emit("debug",{action:"response",fetcher:r,request:i,response:a,provider:this}),a.error){const e=new Error(a.error.message);return e.code=a.error.code,e.data=a.error.data,n(e)}e(a.result)}))}))}}class yc extends yh{constructor(e,t){null==e&&dc.throwArgumentError("missing provider","provider",e);let r=null,n=null,i=null;"function"==typeof e?(r="unknown:",n=e):(r=e.host||e.path||"",!r&&e.isMetaMask&&(r="metamask"),i=e,e.request?(""===r&&(r="eip-1193:"),n=function(e){return function(t,r){null==r&&(r=[]);const n={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:le(n),provider:this}),e.request(n).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:e,provider:this}),e}))}}(e)):e.sendAsync?n=pc(0,e.sendAsync.bind(e)):e.send?n=pc(0,e.send.bind(e)):dc.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),te(this,"jsonRpcFetchFunc",n),te(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const mc=new N(Hu);function bc(e,t){if(null==e&&(e="homestead"),"string"==typeof e){const t=e.match(/^(ws|http)s?:/i);if(t)switch(t[1].toLowerCase()){case"http":case"https":return new yh(e);case"ws":case"wss":return new wh(e);default:mc.throwArgumentError("unsupported URL scheme","network",e)}}const r=qo(e);return r&&r._defaultProvider||mc.throwError("unsupported getDefaultProvider network",N.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:tc,AlchemyProvider:kh,AnkrProvider:Oh,CloudflareProvider:Nh,EtherscanProvider:qh,InfuraProvider:sc,JsonRpcProvider:yh,NodesmithProvider:uc,PocketProvider:cc,Web3Provider:yc,IpcProvider:rc},t)}function gc(e,t,r,n,i){let a;e=j(e),t=j(t);let s=1;const o=new Uint8Array(n),u=new Uint8Array(t.length+4);let l,h;u.set(t);for(let c=1;c<=s;c++){u[t.length]=c>>24&255,u[t.length+1]=c>>16&255,u[t.length+2]=c>>8&255,u[t.length+3]=255&c;let d=j(Tr(i,e,u));a||(a=d.length,h=new Uint8Array(a),s=Math.ceil(n/a),l=n-(s-1)*a),h.set(d);for(let t=1;t<r;t++){d=j(Tr(i,e,d));for(let e=0;e<a;e++)h[e]^=d[e]}const f=(c-1)*a,p=c===s?l:a;o.set(j(h).slice(0,p),f)}return H(o)}const vc=new N("wordlists/5.7.0");class wc{constructor(e){vc.checkAbstract(new.target,wc),te(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const t=[];for(let r=0;r<2048;r++){const n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return nl(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}let _c=null;function Mc(e){if(null==_c&&(_c="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==wc.check(e)))throw _c=null,new Error("BIP39 Wordlist for en (English) FAILED")}const Tc=new class extends wc{constructor(){super("en")}getWord(e){return Mc(this),_c[e]}getWordIndex(e){return Mc(this),_c.indexOf(e)}};wc.register(Tc);const Ec={en:Tc},Ac=new N("hdnode/5.7.0"),xc=ge.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),kc=pt("Bitcoin seed"),Sc=2147483648;function Ic(e){return(1<<e)-1<<8-e}function Cc(e){return J(H(e),32)}function Oc(e){return Cl.encode(q([e,V(Mr(Mr(e)),0,4)]))}function Rc(e){if(null==e)return Ec.en;if("string"==typeof e){const t=Ec[e];return null==t&&Ac.throwArgumentError("unknown locale","wordlist",e),t}return e}const Nc={},Pc="m/44'/60'/0'/0/0";class Bc{constructor(e,t,r,n,i,a,s,o){if(e!==Nc)throw new Error("HDNode constructor cannot be called directly");if(t){const e=new ku(t);te(this,"privateKey",e.privateKey),te(this,"publicKey",e.compressedPublicKey)}else te(this,"privateKey",null),te(this,"publicKey",H(r));var u;te(this,"parentFingerprint",n),te(this,"fingerprint",V((u=Mr(this.publicKey),"0x"+wr().ripemd160().update(j(u)).digest("hex")),0,4)),te(this,"address",Bu(this.publicKey)),te(this,"chainCode",i),te(this,"index",a),te(this,"depth",s),null==o?(te(this,"mnemonic",null),te(this,"path",null)):"string"==typeof o?(te(this,"mnemonic",null),te(this,"path",o)):(te(this,"mnemonic",o),te(this,"path",o.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return Oc(q([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",H(this.depth),this.parentFingerprint,J(H(this.index),4),this.chainCode,null!=this.privateKey?q(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Bc(Nc,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&Sc){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(j(this.privateKey),1),t&&(t+="'")}else r.set(j(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=j(Tr(gr.sha512,this.chainCode,r)),i=n.slice(0,32),a=n.slice(32);let s=null,o=null;this.privateKey?s=Cc(ge.from(i).add(this.privateKey).mod(xc)):o=new ku(H(i))._addPoint(this.publicKey);let u=t;const l=this.mnemonic;return l&&(u=Object.freeze({phrase:l.phrase,path:t,locale:l.locale||"en"})),new Bc(Nc,s,o,this.fingerprint,Cc(a),e,this.depth+1,u)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e<t.length;e++){const n=t[e];if(n.match(/^[0-9]+'$/)){const e=parseInt(n.substring(0,n.length-1));if(e>=Sc)throw new Error("invalid path index - "+n);r=r._derive(Sc+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=Sc)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=j(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=j(Tr(gr.sha512,kc,r));return new Bc(Nc,Cc(n.slice(0,32)),null,"0x00000000",Cc(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Lc(Dc(e,r=Rc(r)),r),Bc._fromSeed(function(e,t){t||(t="");const r=pt("mnemonic"+t,lt.NFKD);return gc(pt(e,lt.NFKD),r,2048,64,"sha512")}(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return Bc._fromSeed(e,null)}static fromExtendedKey(e){const t=Cl.decode(e);82===t.length&&Oc(t.slice(0,78))===e||Ac.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=H(t.slice(5,9)),i=parseInt(H(t.slice(9,13)).substring(2),16),a=H(t.slice(13,45)),s=t.slice(45,78);switch(H(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Bc(Nc,null,H(s),n,a,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break;return new Bc(Nc,H(s.slice(1)),null,n,a,i,r,null)}return Ac.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Dc(e,t){t=Rc(t),Ac.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=j(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let e=0;e<r.length;e++){let a=t.getWordIndex(r[e].normalize("NFKD"));if(-1===a)throw new Error("invalid mnemonic");for(let e=0;e<11;e++)a&1<<10-e&&(n[i>>3]|=1<<7-i%8),i++}const a=32*r.length/3,s=Ic(r.length/3);if((j(Mr(n.slice(0,a/8)))[0]&s)!=(n[n.length-1]&s))throw new Error("invalid checksum");return H(n.slice(0,a/8))}function Lc(e,t){if(t=Rc(t),(e=j(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let t=0;t<e.length;t++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);const i=e.length/4,a=j(Mr(e))[0]&Ic(i);return r[r.length-1]<<=i,r[r.length-1]|=a>>8-i,t.join(r.map((e=>t.getWord(e))))}var Fc=i(8709),Uc=i.n(Fc),jc=i(7635),qc=i.n(jc);function zc(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),j(e)}function Gc(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function Kc(e){return"string"==typeof e?pt(e,lt.NFKC):j(e)}function Hc(e,t){let r=e;const n=t.toLowerCase().split("/");for(let e=0;e<n.length;e++){let t=null;for(const i in r)if(i.toLowerCase()===n[e]){t=r[i];break}if(null===t)return null;r=t}return r}function $c(e){const t=j(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=H(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const Vc="json-wallets/5.7.0";const Wc=new N(Vc);function Zc(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class Jc extends he{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function Yc(e,t){const r=zc(Hc(e,"crypto/ciphertext"));if(H(Ie(q([t.slice(16,32),r]))).substring(2)!==Hc(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===Hc(e,"crypto/cipher")){const n=zc(Hc(e,"crypto/cipherparams/iv")),i=new(Uc().Counter)(n);return j(new(Uc().ModeOfOperation.ctr)(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||Wc.throwError("unsupported cipher",N.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),a=Bu(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),Ge(t)!==a)throw new Error("address mismatch")}const s={_isKeystoreAccount:!0,address:a,privateKey:H(n)};if("0.1"===Hc(e,"x-ethers/version")){const t=zc(Hc(e,"x-ethers/mnemonicCiphertext")),r=zc(Hc(e,"x-ethers/mnemonicCounter")),n=new(Uc().Counter)(r),a=new(Uc().ModeOfOperation.ctr)(i,n),o=Hc(e,"x-ethers/path")||Pc,u=Hc(e,"x-ethers/locale")||"en",l=j(a.decrypt(t));try{const e=Lc(l,u),t=Bc.fromMnemonic(e,null,u).derivePath(o);if(t.privateKey!=s.privateKey)throw new Error("mnemonic mismatch");s.mnemonic=t.mnemonic}catch(e){if(e.code!==N.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new Jc(s)}function Xc(e,t,r,n,i){return j(gc(e,t,r,n,i))}function Qc(e,t,r,n,i){return Promise.resolve(Xc(e,t,r,n,i))}function ed(e,t,r,n,i){const a=Kc(t),s=Hc(e,"crypto/kdf");if(s&&"string"==typeof s){const t=function(e,t){return Wc.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===s.toLowerCase()){const r=zc(Hc(e,"crypto/kdfparams/salt")),o=parseInt(Hc(e,"crypto/kdfparams/n")),u=parseInt(Hc(e,"crypto/kdfparams/r")),l=parseInt(Hc(e,"crypto/kdfparams/p"));o&&u&&l||t("kdf",s),0!=(o&o-1)&&t("N",o);const h=parseInt(Hc(e,"crypto/kdfparams/dklen"));return 32!==h&&t("dklen",h),n(a,r,o,u,l,64,i)}if("pbkdf2"===s.toLowerCase()){const n=zc(Hc(e,"crypto/kdfparams/salt"));let i=null;const s=Hc(e,"crypto/kdfparams/prf");"hmac-sha256"===s?i="sha256":"hmac-sha512"===s?i="sha512":t("prf",s);const o=parseInt(Hc(e,"crypto/kdfparams/c")),u=parseInt(Hc(e,"crypto/kdfparams/dklen"));return 32!==u&&t("dklen",u),r(a,n,o,u,i)}}return Wc.throwArgumentError("unsupported key-derivation function","kdf",s)}const td=new N(Vc);class rd extends he{isCrowdsaleAccount(e){return!(!e||!e._isCrowdsaleAccount)}}function nd(e,t){const r=JSON.parse(e);t=Kc(t);const n=Ge(Hc(r,"ethaddr")),i=zc(Hc(r,"encseed"));i&&i.length%16==0||td.throwArgumentError("invalid encseed","json",e);const a=j(gc(t,t,2e3,32,"sha256")).slice(0,16),s=i.slice(0,16),o=i.slice(16),u=new(Uc().ModeOfOperation.cbc)(a,s),l=Uc().padding.pkcs7.strip(j(u.decrypt(o)));let h="";for(let e=0;e<l.length;e++)h+=String.fromCharCode(l[e]);const c=Ie(pt(h));return new rd({_isCrowdsaleAccount:!0,address:n,privateKey:c})}function id(e){let t=null;try{t=JSON.parse(e)}catch(e){return!1}return t.encseed&&t.ethaddr}function ad(e){let t=null;try{t=JSON.parse(e)}catch(e){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}function sd(e,t,r){if(id(e)){r&&r(0);const n=nd(e,t);return r&&r(1),Promise.resolve(n)}return ad(e)?function(e,t,r){return n=this,i=void 0,s=function*(){const n=JSON.parse(e);return Yc(n,yield ed(n,t,Qc,qc().scrypt,r))},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{u(s.next(e))}catch(e){t(e)}}function o(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a((function(e){e(n)}))).then(r,o)}u((s=s.apply(n,i||[])).next())}));var n,i,a,s}(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}var od=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{u(n.next(e))}catch(e){a(e)}}function o(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}u((n=n.apply(e,t||[])).next())}))};const ud=new N("wallet/5.7.0");class ld extends tl{constructor(e,t){if(super(),null!=(r=e)&&G(r.privateKey,32)&&null!=r.address){const t=new ku(e.privateKey);if(te(this,"_signingKey",(()=>t)),te(this,"address",Bu(this.publicKey)),this.address!==Ge(e.address)&&ud.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;te(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||Pc,locale:t.locale||"en"})));const r=this.mnemonic;Bu(Bc.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&ud.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else te(this,"_mnemonic",(()=>null))}else{if(ku.isSigningKey(e))"secp256k1"!==e.curve&&ud.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),te(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new ku(e);te(this,"_signingKey",(()=>t))}te(this,"_mnemonic",(()=>null)),te(this,"address",Bu(this.publicKey))}var r;t&&!Sl.isProvider(t)&&ud.throwArgumentError("invalid provider","provider",t),te(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new ld(this,e)}signTransaction(e){return ne(e).then((t=>{null!=t.from&&(Ge(t.from)!==this.address&&ud.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(Ie(Gu(t)));return Gu(t,r)}))}signMessage(e){return od(this,void 0,void 0,(function*(){return X(this._signingKey().signDigest(function(e){return"string"==typeof e&&(e=pt(e)),Ie(q([pt("Ethereum Signed Message:\n"),pt(String(e.length)),e]))}(e)))}))}_signTypedData(e,t,r){return od(this,void 0,void 0,(function*(){const n=yield gl.resolveNames(e,t,r,(e=>(null==this.provider&&ud.throwError("cannot resolve ENS names without a provider",N.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return X(this._signingKey().signDigest(gl.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),function(e,t,r,n){try{if(Ge(e.address)!==Bu(e.privateKey))throw new Error("address/privateKey mismatch");if(Zc(e)){const t=e.mnemonic;if(Bc.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||Pc).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const i=j(e.privateKey),a=Kc(t);let s=null,o=null,u=null;if(Zc(e)){const t=e.mnemonic;s=j(Dc(t.phrase,t.locale||"en")),o=t.path||Pc,u=t.locale||"en"}let l=r.client;l||(l="ethers.js");let h=null;h=r.salt?j(r.salt):kr(32);let c=null;if(r.iv){if(c=j(r.iv),16!==c.length)throw new Error("invalid iv")}else c=kr(16);let d=null;if(r.uuid){if(d=j(r.uuid),16!==d.length)throw new Error("invalid uuid")}else d=kr(16);let f=1<<17,p=8,y=1;return r.scrypt&&(r.scrypt.N&&(f=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(y=r.scrypt.p)),qc().scrypt(a,h,f,p,y,64,n).then((t=>{const r=(t=j(t)).slice(0,16),n=t.slice(16,32),a=t.slice(32,64),m=new(Uc().Counter)(c),b=j(new(Uc().ModeOfOperation.ctr)(r,m).encrypt(i)),g=Ie(q([n,b])),v={address:e.address.substring(2).toLowerCase(),id:$c(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:H(c).substring(2)},ciphertext:H(b).substring(2),kdf:"scrypt",kdfparams:{salt:H(h).substring(2),n:f,dklen:32,p:y,r:p},mac:g.substring(2)}};if(s){const e=kr(16),t=new(Uc().Counter)(e),r=j(new(Uc().ModeOfOperation.ctr)(a,t).encrypt(s)),n=new Date,i=n.getUTCFullYear()+"-"+Gc(n.getUTCMonth()+1,2)+"-"+Gc(n.getUTCDate(),2)+"T"+Gc(n.getUTCHours(),2)+"-"+Gc(n.getUTCMinutes(),2)+"-"+Gc(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:l,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:H(e).substring(2),mnemonicCiphertext:H(r).substring(2),path:o,locale:u,version:"0.1"}}return JSON.stringify(v)}))}(this,e,t,r)}static createRandom(e){let t=kr(16);e||(e={}),e.extraEntropy&&(t=j(V(Ie(q([t,e.extraEntropy])),0,16)));const r=Lc(t,e.locale);return ld.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return sd(e,t,r).then((e=>new ld(e)))}static fromEncryptedJsonSync(e,t){return new ld(function(e,t){if(id(e))return nd(e,t);if(ad(e))return function(e,t){const r=JSON.parse(e);return Yc(r,ed(r,t,Xc,qc().syncScrypt))}(e,t);throw new Error("invalid JSON wallet")}(e,t))}static fromMnemonic(e,t,r){return t||(t=Pc),new ld(Bc.fromMnemonic(e,null,r).derivePath(t))}}const hd={1:"mainnet",134:"https://bellecour.iex.ec"},cd={1:{publicResolver:"0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"},134:{registry:"0x5f5B93fca68c9C79318d1F3868A354EE67D8c006",publicResolver:"0x1347d8a1840A810B990d0B774A6b7Bb8A1bd62BB"}},dd={134:{name:"bellecour",chainId:134,ensAddress:cd[134].registry}},fd={standard:{},enterprise:{}},pd={standard:{134:{[eo.SCONE]:"https://sms.scone-prod.v8-bellecour.iex.ec",[eo.GRAMINE]:"https://sms.gramine.v8-bellecour.iex.ec"}},enterprise:{}},yd={standard:{134:"https://result.v8-bellecour.iex.ec"},enterprise:{}},md={standard:{1:{contract:"0x4e55c9B8953AB1957ad0A59D413631A66798c6a2",bridgedChainId:"134"},134:{contract:"0x188A4376a1D818bF2434972Eb34eFd57102a19b7",bridgedChainId:"1"}},enterprise:{}},bd={},gd={standard:{134:"https://ipfs-gateway.v8-bellecour.iex.ec"},enterprise:{}},vd={standard:{134:"https://api.market.v8-bellecour.iex.ec"},enterprise:{}},wd={mainnet:1,bellecour:134},_d=({id:e,flavour:t})=>({host:hd[e],hub:fd[t]&&fd[t][e],sms:pd[t]&&pd[t][e],ensRegistry:cd[e]&&cd[e].registry,ensPublicResolver:cd[e]&&cd[e].publicResolver,resultProxy:yd[t]&&yd[t][e],ipfsGateway:gd[t]&&gd[t][e],iexecGateway:vd[t]&&vd[t][e],bridge:md[t]&&md[t][e],flavour:t,network:dd[e]}),Md=(e,t={})=>{const r=t.providers||{},n=t.network;let i=e;const a=_d({id:(s=e,wd[s]||s)});var s;if(a&&a.host)i=a.host;else if("string"!=typeof i||!i.startsWith("http"))throw Error("Invalid provider host name or url");let o=n;if(!o&&a&&a.network&&(o=a.network),i.startsWith("http"))return new yh(i,o);const{quorum:u,...l}=r,h=["etherscan","infura","alchemy","pocket","ankr"],c=h.filter((e=>!Object.keys(l).includes(e)));return bc(o||i,{quorum:u||1,...c.length<h.length&&Object.fromEntries(c.map((e=>[e,"-"]))),...l})},{Web3Provider:Td}=b;class Ed extends ld{constructor(e,t,r={}){if(super(e,t),this._options=r,r.gasPrice)try{ge.from(r.gasPrice)}catch(e){throw Error("Invalid gasPrice option")}if(void 0!==r.getTransactionCount&&"function"!=typeof r.getTransactionCount)throw Error("Invalid getTransactionCount option, must be a function")}static createRandom(){return new Ed(super.createRandom().privateKey)}connect(e){return new Ed(this.privateKey,e,this._options)}getGasPrice(){return void 0===this._options.gasPrice?super.getGasPrice():ge.from(this._options.gasPrice)}getTransactionCount(...e){return void 0===this._options.getTransactionCount?super.getTransactionCount(...e):this._options.getTransactionCount(...e)}sendTransaction(e){let t;return void 0!==this._options.gasPrice&&(t=ge.from(this._options.gasPrice).toHexString()),super.sendTransaction({gasPrice:t,...e})}}class Ad extends tl{constructor(...e){super();const t=new Td(...e);this.provider=t}getAddress(){return this.provider.getSigner().getAddress()}signMessage(e){return this.provider.getSigner().signMessage(e)}signTypedData(...e){const t=this.provider.getSigner();return t._signTypedData&&"function"==typeof t._signTypedData?t._signTypedData(...e):t.signTypedData(...e)}sendTransaction(e){return this.provider.getSigner().sendTransaction(e)}}const xd=new N(ce);class kd extends he{}class Sd extends he{}class Id extends he{}class Cd extends he{static isIndexed(e){return!(!e||!e._isIndexed)}}const Od={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Rd(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class Nd{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,te(this,"fragments",t.map((e=>St.from(e))).filter((e=>null!=e))),te(this,"_abiCoder",re(new.target,"getAbiCoder")()),te(this,"functions",{}),te(this,"errors",{}),te(this,"events",{}),te(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void xd.warn("duplicate definition - constructor"):void te(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?xd.warn("duplicate definition - "+r):t[r]=e})),this.deploy||te(this,"deploy",Nt.from({payable:!1,type:"constructor"})),te(this,"_isInterface",!0)}format(e){e||(e=Et.full),e===Et.sighash&&xd.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Et.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return Kt}static getAddress(e){return Ge(e)}static getSighash(e){return V(nl(e.format()),0,4)}static getEventTopic(e){return nl(e.format())}getFunction(e){if(G(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];xd.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?xd.throwArgumentError("no matching function","name",t):r.length>1&&xd.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Pt.fromString(e).format()];return t||xd.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(G(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];xd.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?xd.throwArgumentError("no matching event","name",t):r.length>1&&xd.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[It.fromString(e).format()];return t||xd.throwArgumentError("no matching event","signature",e),t}getError(e){if(G(e)){const t=re(this.constructor,"getSighash");for(const r in this.errors)if(e===t(this.errors[r]))return this.errors[r];xd.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?xd.throwArgumentError("no matching error","name",t):r.length>1&&xd.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Pt.fromString(e).format()];return t||xd.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return re(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),re(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=j(t);return H(r.slice(0,4))!==this.getSighash(e)&&xd.throwArgumentError(`data signature does not match error ${e.name}.`,"data",H(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),H(q([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=j(t);return H(r.slice(0,4))!==this.getSighash(e)&&xd.throwArgumentError(`data signature does not match function ${e.name}.`,"data",H(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),H(q([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=j(t),n=null,i="",a=null,s=null,o=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=H(r.slice(0,4)),t=Od[e];if(t)a=this._abiCoder.decode(t.inputs,r.slice(4)),s=t.name,o=t.signature,t.reason&&(n=a[0]),"Error"===s?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(a[0])}`:"Panic"===s&&(i=`; VM Exception while processing transaction: reverted with panic code ${a[0]}`);else try{const t=this.getError(e);a=this._abiCoder.decode(t.inputs,r.slice(4)),s=t.name,o=t.format()}catch(e){}break}}return xd.throwError("call revert exception"+i,N.errors.CALL_EXCEPTION,{method:e.format(),data:H(t),errorArgs:a,errorName:s,errorSignature:o,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),H(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&xd.throwError("too many arguments for "+e.format(),N.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?nl(t):"bytes"===e.type?Ie(H(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=ge.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),J(H(t),32));for(t.forEach(((t,i)=>{let a=e.inputs[i];a.indexed?null==t?r.push(null):"array"===a.baseType||"tuple"===a.baseType?xd.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,t):Array.isArray(t)?r.push(t.map((e=>n(a,e)))):r.push(n(a,t)):null!=t&&xd.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&xd.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,a)=>{const s=t[a];if(e.indexed)if("string"===e.type)r.push(nl(s));else if("bytes"===e.type)r.push(Ie(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[s]))}else n.push(e),i.push(s)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);G(r[0],32)&&r[0].toLowerCase()===t||xd.throwError("fragment/topic mismatch",N.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],a=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(xt.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(n.push(e),a.push(!1)):(i.push(e),a.push(!1))}));let s=null!=r?this._abiCoder.decode(n,q(r)):null,o=this._abiCoder.decode(i,t,!0),u=[],l=0,h=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==s)u[t]=new Cd({_isIndexed:!0,hash:null});else if(a[t])u[t]=new Cd({_isIndexed:!0,hash:s[h++]});else try{u[t]=s[h++]}catch(e){u[t]=e}else try{u[t]=o[l++]}catch(e){u[t]=e}if(e.name&&null==u[e.name]){const r=u[t];r instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:()=>{throw Rd(`property ${JSON.stringify(e.name)}`,r)}}):u[e.name]=r}}));for(let e=0;e<u.length;e++){const t=u[e];t instanceof Error&&Object.defineProperty(u,e,{enumerable:!0,get:()=>{throw Rd(`index ${e}`,t)}})}return Object.freeze(u)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Sd({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:ge.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new kd({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=H(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new Id({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var Pd=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{u(n.next(e))}catch(e){a(e)}}function o(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}u((n=n.apply(e,t||[])).next())}))};const Bd=new N("contracts/5.7.0");function Dd(e,t){return Pd(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&Bd.throwArgumentError("invalid address or ENS name","name",r);try{return Ge(r)}catch(e){}e||Bd.throwError("a provider or signer is needed to resolve ENS names",N.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&Bd.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function Ld(e,t,r){return Pd(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>Ld(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield Dd(e,t):"tuple"===r.type?yield Ld(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>Ld(e,t,r.arrayChildren)))):Promise.reject(Bd.makeError("invalid value for array",N.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function Fd(e,t,r){return Pd(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=ae(r.pop())),Bd.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=ne({override:Dd(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>Pd(this,void 0,void 0,(function*(){return Ge(e.signer)!==e.override&&Bd.throwError("Contract with a Signer cannot override from",N.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=Dd(e.provider,n.from));const i=yield ne({args:Ld(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:ne(n)||{}}),a=e.interface.encodeFunctionData(t,i.args),s={data:a,to:i.address},o=i.overrides;if(null!=o.nonce&&(s.nonce=ge.from(o.nonce).toNumber()),null!=o.gasLimit&&(s.gasLimit=ge.from(o.gasLimit)),null!=o.gasPrice&&(s.gasPrice=ge.from(o.gasPrice)),null!=o.maxFeePerGas&&(s.maxFeePerGas=ge.from(o.maxFeePerGas)),null!=o.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=ge.from(o.maxPriorityFeePerGas)),null!=o.from&&(s.from=o.from),null!=o.type&&(s.type=o.type),null!=o.accessList&&(s.accessList=Uu(o.accessList)),null==s.gasLimit&&null!=t.gas){let e=21e3;const r=j(a);for(let t=0;t<r.length;t++)e+=4,r[t]&&(e+=64);s.gasLimit=ge.from(t.gas).add(e)}if(o.value){const e=ge.from(o.value);e.isZero()||t.payable||Bd.throwError("non-payable method cannot override value",N.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),s.value=e}o.customData&&(s.customData=ae(o.customData)),o.ccipReadEnabled&&(s.ccipReadEnabled=!!o.ccipReadEnabled),delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.customData,delete n.ccipReadEnabled;const u=Object.keys(n).filter((e=>null!=n[e]));return u.length&&Bd.throwError(`cannot override ${u.map((e=>JSON.stringify(e))).join(",")}`,N.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),s}))}function Ud(e,t,r){const n=e.signer||e.provider;return function(...i){return Pd(this,void 0,void 0,(function*(){let a;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=ae(i.pop());null!=e.blockTag&&(a=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(a));const s=yield Fd(e,t,i),o=yield n.call(s,a);try{let n=e.interface.decodeFunctionResult(t,o);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===N.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=s),t}}))}}function jd(e,t,r){return t.constant?Ud(e,t,r):function(e,t){return function(...r){return Pd(this,void 0,void 0,(function*(){e.signer||Bd.throwError("sending a transaction requires a signer",N.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield Fd(e,t,r),i=yield e.signer.sendTransaction(n);return function(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=le(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}(e,i),i}))}}(e,t)}function qd(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class zd{constructor(e,t){te(this,"tag",e),te(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e&&(t=!0,1))))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class Gd extends zd{constructor(){super("error",null)}}class Kd extends zd{constructor(e,t,r,n){const i={address:e};let a=t.getEventTopic(r);n?(a!==n[0]&&Bd.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[a],super(qd(i),i),te(this,"address",e),te(this,"interface",t),te(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=function(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const a=e.slice();a.push(i);try{r(a,n[i])}catch(e){t.push({path:a,error:e})}}};return r([],e),t}(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class Hd extends zd{constructor(e,t){super("*",{address:e}),te(this,"address",e),te(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class $d{constructor(e,t,r){te(this,"interface",re(new.target,"getInterface")(t)),null==r?(te(this,"provider",null),te(this,"signer",null)):tl.isSigner(r)?(te(this,"provider",r.provider||null),te(this,"signer",r)):Sl.isProvider(r)?(te(this,"provider",r),te(this,"signer",null)):Bd.throwArgumentError("invalid signer or provider","signerOrProvider",r),te(this,"callStatic",{}),te(this,"estimateGas",{}),te(this,"functions",{}),te(this,"populateTransaction",{}),te(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];te(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)}))),e[r.name]||(e[r.name]=[]),e[r.name].push(t)})),Object.keys(e).forEach((t=>{const r=e[t];1===r.length?te(this.filters,t,this.filters[r[0]]):Bd.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(te(this,"_runningEvents",{}),te(this,"_wrappedEmits",{}),null==e&&Bd.throwArgumentError("invalid contract address or ENS name","addressOrName",e),te(this,"address",e),this.provider)te(this,"resolvedAddress",Dd(this.provider,e));else try{te(this,"resolvedAddress",Promise.resolve(Ge(e)))}catch(e){Bd.throwError("provider is required to use ENS name as contract address",N.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])Bd.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}null==this[e]&&te(this,e,jd(this,t,!0)),null==this.functions[e]&&te(this.functions,e,jd(this,t,!1)),null==this.callStatic[e]&&te(this.callStatic,e,Ud(this,t,!0)),null==this.populateTransaction[e]&&te(this.populateTransaction,e,function(e,t){return function(...r){return Fd(e,t,r)}}(this,t)),null==this.estimateGas[e]&&te(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return Pd(this,void 0,void 0,(function*(){r||Bd.throwError("estimate require a provider or signer",N.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Fd(e,t,n);return yield r.estimateGas(i)}))}}(this,t))}})),Object.keys(n).forEach((e=>{const t=n[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&te(this,e,this[r])}catch(e){}null==this.functions[e]&&te(this.functions,e,this.functions[r]),null==this.callStatic[e]&&te(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&te(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&te(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return He(e)}static getInterface(e){return Nd.isInterface(e)?e:new Nd(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&Bd.throwError("contract not deployed",N.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||Bd.throwError("sending a transactions require a signer",N.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=ae(e||{});return["from","to"].forEach((function(e){null!=t[e]&&Bd.throwError("cannot override "+e,N.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new rl(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&te(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return Cd.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new Gd);if("event"===e)return this._normalizeRunningEvent(new zd("event",null));if("*"===e)return this._normalizeRunningEvent(new Hd(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Kd(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new Kd(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new zd(qd(t),t))}return this._normalizeRunningEvent(new Hd(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=le(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||Bd.throwError("events require a provider or a signer with a provider",N.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),i=ae(n.filter);return"string"==typeof t&&G(t,32)?(null!=r&&Bd.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class Vd extends $d{}const Wd={1:{events:{"0xaa1c0a0a78cec2470f9652e5d29540752e7a64d70f926933cebf13afaeda45de":{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"message",type:"string"}],name:"CommitMessage",type:"event"},"0x3234040ce3bd4564874e44810f198910133a1b24c4e84aac87edbf6b458f5353":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes4",name:"functionId",type:"bytes4"},{indexed:!0,internalType:"address",name:"oldDelegate",type:"address"},{indexed:!0,internalType:"address",name:"newDelegate",type:"address"},{indexed:!1,internalType:"string",name:"functionSignature",type:"string"}],name:"FunctionUpdate",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"}},links:{},address:"0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f"},3:{events:{"0xaa1c0a0a78cec2470f9652e5d29540752e7a64d70f926933cebf13afaeda45de":{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"message",type:"string"}],name:"CommitMessage",type:"event"},"0x3234040ce3bd4564874e44810f198910133a1b24c4e84aac87edbf6b458f5353":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes4",name:"functionId",type:"bytes4"},{indexed:!0,internalType:"address",name:"oldDelegate",type:"address"},{indexed:!0,internalType:"address",name:"newDelegate",type:"address"},{indexed:!1,internalType:"string",name:"functionSignature",type:"string"}],name:"FunctionUpdate",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"}},links:{},address:"0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f"},4:{events:{"0xaa1c0a0a78cec2470f9652e5d29540752e7a64d70f926933cebf13afaeda45de":{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"message",type:"string"}],name:"CommitMessage",type:"event"},"0x3234040ce3bd4564874e44810f198910133a1b24c4e84aac87edbf6b458f5353":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes4",name:"functionId",type:"bytes4"},{indexed:!0,internalType:"address",name:"oldDelegate",type:"address"},{indexed:!0,internalType:"address",name:"newDelegate",type:"address"},{indexed:!1,internalType:"string",name:"functionSignature",type:"string"}],name:"FunctionUpdate",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"}},links:{},address:"0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f"},5:{events:{"0xaa1c0a0a78cec2470f9652e5d29540752e7a64d70f926933cebf13afaeda45de":{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"message",type:"string"}],name:"CommitMessage",type:"event"},"0x3234040ce3bd4564874e44810f198910133a1b24c4e84aac87edbf6b458f5353":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes4",name:"functionId",type:"bytes4"},{indexed:!0,internalType:"address",name:"oldDelegate",type:"address"},{indexed:!0,internalType:"address",name:"newDelegate",type:"address"},{indexed:!1,internalType:"string",name:"functionSignature",type:"string"}],name:"FunctionUpdate",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"}},links:{},address:"0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f"},42:{events:{"0xaa1c0a0a78cec2470f9652e5d29540752e7a64d70f926933cebf13afaeda45de":{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"message",type:"string"}],name:"CommitMessage",type:"event"},"0x3234040ce3bd4564874e44810f198910133a1b24c4e84aac87edbf6b458f5353":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes4",name:"functionId",type:"bytes4"},{indexed:!0,internalType:"address",name:"oldDelegate",type:"address"},{indexed:!0,internalType:"address",name:"newDelegate",type:"address"},{indexed:!1,internalType:"string",name:"functionSignature",type:"string"}],name:"FunctionUpdate",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"}},links:{},address:"0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f"},133:{events:{"0xaa1c0a0a78cec2470f9652e5d29540752e7a64d70f926933cebf13afaeda45de":{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"message",type:"string"}],name:"CommitMessage",type:"event"},"0x3234040ce3bd4564874e44810f198910133a1b24c4e84aac87edbf6b458f5353":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes4",name:"functionId",type:"bytes4"},{indexed:!0,internalType:"address",name:"oldDelegate",type:"address"},{indexed:!0,internalType:"address",name:"newDelegate",type:"address"},{indexed:!1,internalType:"string",name:"functionSignature",type:"string"}],name:"FunctionUpdate",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"}},links:{},address:"0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f"},134:{events:{"0xaa1c0a0a78cec2470f9652e5d29540752e7a64d70f926933cebf13afaeda45de":{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"message",type:"string"}],name:"CommitMessage",type:"event"},"0x3234040ce3bd4564874e44810f198910133a1b24c4e84aac87edbf6b458f5353":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes4",name:"functionId",type:"bytes4"},{indexed:!0,internalType:"address",name:"oldDelegate",type:"address"},{indexed:!0,internalType:"address",name:"newDelegate",type:"address"},{indexed:!1,internalType:"string",name:"functionSignature",type:"string"}],name:"FunctionUpdate",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"}},links:{},address:"0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f"}},Zd={abi:[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"worker",type:"address"},{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"}],name:"AccurateContribution",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],indexed:!1,internalType:"struct IexecLibOrders_v5.AppOrder",name:"apporder",type:"tuple"}],name:"BroadcastAppOrder",type:"event"},{anonymous:!1,inputs:[{components:[{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],indexed:!1,internalType:"struct IexecLibOrders_v5.DatasetOrder",name:"datasetorder",type:"tuple"}],name:"BroadcastDatasetOrder",type:"event"},{anonymous:!1,inputs:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appmaxprice",type:"uint256"},{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetmaxprice",type:"uint256"},{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolmaxprice",type:"uint256"},{internalType:"address",name:"requester",type:"address"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"beneficiary",type:"address"},{internalType:"address",name:"callback",type:"address"},{internalType:"string",name:"params",type:"string"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],indexed:!1,internalType:"struct IexecLibOrders_v5.RequestOrder",name:"requestorder",type:"tuple"}],name:"BroadcastRequestOrder",type:"event"},{anonymous:!1,inputs:[{components:[{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],indexed:!1,internalType:"struct IexecLibOrders_v5.WorkerpoolOrder",name:"workerpoolorder",type:"tuple"}],name:"BroadcastWorkerpoolOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"appHash",type:"bytes32"}],name:"ClosedAppOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"datasetHash",type:"bytes32"}],name:"ClosedDatasetOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"requestHash",type:"bytes32"}],name:"ClosedRequestOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"workerpoolHash",type:"bytes32"}],name:"ClosedWorkerpoolOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"catid",type:"uint256"},{indexed:!1,internalType:"string",name:"name",type:"string"},{indexed:!1,internalType:"string",name:"description",type:"string"},{indexed:!1,internalType:"uint256",name:"workClockTimeRef",type:"uint256"}],name:"CreateCategory",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"worker",type:"address"},{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"}],name:"FaultyContribution",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Lock",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"dealid",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"appHash",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"datasetHash",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"workerpoolHash",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"requestHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"volume",type:"uint256"}],name:"OrdersMatched",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes32",name:"ref",type:"bytes32"}],name:"Reward",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"workerpool",type:"address"},{indexed:!1,internalType:"bytes32",name:"dealid",type:"bytes32"}],name:"SchedulerNotice",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes32",name:"ref",type:"bytes32"}],name:"Seize",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"appHash",type:"bytes32"}],name:"SignedAppOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"datasetHash",type:"bytes32"}],name:"SignedDatasetOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"requestHash",type:"bytes32"}],name:"SignedRequestOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"workerpoolHash",type:"bytes32"}],name:"SignedWorkerpoolOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"}],name:"TaskClaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"consensus",type:"bytes32"}],name:"TaskConsensus",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"},{indexed:!0,internalType:"address",name:"worker",type:"address"},{indexed:!1,internalType:"bytes32",name:"hash",type:"bytes32"}],name:"TaskContribute",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"results",type:"bytes"}],name:"TaskFinalize",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"},{indexed:!0,internalType:"address",name:"workerpool",type:"address"}],name:"TaskInitialize",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"}],name:"TaskReopen",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"},{indexed:!0,internalType:"address",name:"worker",type:"address"},{indexed:!1,internalType:"bytes32",name:"digest",type:"bytes32"}],name:"TaskReveal",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Unlock",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[],name:"UniswapV2Router",outputs:[{internalType:"contract IUniswapV2Router02",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"appregistry",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"approveAndCall",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.AppOrder",name:"",type:"tuple"}],name:"broadcastAppOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.DatasetOrder",name:"",type:"tuple"}],name:"broadcastDatasetOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appmaxprice",type:"uint256"},{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetmaxprice",type:"uint256"},{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolmaxprice",type:"uint256"},{internalType:"address",name:"requester",type:"address"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"beneficiary",type:"address"},{internalType:"address",name:"callback",type:"address"},{internalType:"string",name:"params",type:"string"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.RequestOrder",name:"",type:"tuple"}],name:"broadcastRequestOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.WorkerpoolOrder",name:"",type:"tuple"}],name:"broadcastWorkerpoolOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"callbackgas",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"claim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32[]",name:"",type:"bytes32[]"}],name:"claimArray",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"string",name:"",type:"string"},{internalType:"string",name:"",type:"string"},{internalType:"uint8",name:"",type:"uint8"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"configure",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"address",name:"",type:"address"},{internalType:"bytes",name:"",type:"bytes"},{internalType:"bytes",name:"",type:"bytes"}],name:"contribute",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes",name:"",type:"bytes"},{internalType:"bytes",name:"",type:"bytes"},{internalType:"address",name:"",type:"address"},{internalType:"bytes",name:"",type:"bytes"},{internalType:"bytes",name:"",type:"bytes"}],name:"contributeAndFinalize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"contribution_deadline_ratio",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"countCategory",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"",type:"string"},{internalType:"string",name:"",type:"string"},{internalType:"uint256",name:"",type:"uint256"}],name:"createCategory",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"datasetregistry",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"deposit",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"depositEth",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"depositEthFor",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"address",name:"",type:"address"}],name:"depositFor",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"address[]",name:"",type:"address[]"}],name:"depositForArray",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"domain",outputs:[{components:[{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"}],internalType:"struct IexecLibOrders_v5.EIP712Domain",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712domain_separator",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"estimateDepositEthSent",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"estimateDepositTokenWanted",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"estimateWithdrawEthWanted",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"estimateWithdrawTokenSent",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"final_deadline_ratio",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes",name:"",type:"bytes"},{internalType:"bytes",name:"",type:"bytes"}],name:"finalize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"frozenOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"groupmember_purpose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"importScore",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"uint256",name:"",type:"uint256"}],name:"initialize",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32[]",name:"",type:"bytes32[]"},{internalType:"uint256[]",name:"",type:"uint256[]"}],name:"initializeAndClaimArray",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32[]",name:"",type:"bytes32[]"},{internalType:"uint256[]",name:"",type:"uint256[]"}],name:"initializeArray",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"kitty_address",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"kitty_min",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"kitty_ratio",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.AppOrder",name:"order",type:"tuple"},{internalType:"enum IexecLibOrders_v5.OrderOperationEnum",name:"operation",type:"uint8"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.AppOrderOperation",name:"",type:"tuple"}],name:"manageAppOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.DatasetOrder",name:"order",type:"tuple"},{internalType:"enum IexecLibOrders_v5.OrderOperationEnum",name:"operation",type:"uint8"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.DatasetOrderOperation",name:"",type:"tuple"}],name:"manageDatasetOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appmaxprice",type:"uint256"},{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetmaxprice",type:"uint256"},{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolmaxprice",type:"uint256"},{internalType:"address",name:"requester",type:"address"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"beneficiary",type:"address"},{internalType:"address",name:"callback",type:"address"},{internalType:"string",name:"params",type:"string"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.RequestOrder",name:"order",type:"tuple"},{internalType:"enum IexecLibOrders_v5.OrderOperationEnum",name:"operation",type:"uint8"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.RequestOrderOperation",name:"",type:"tuple"}],name:"manageRequestOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.WorkerpoolOrder",name:"order",type:"tuple"},{internalType:"enum IexecLibOrders_v5.OrderOperationEnum",name:"operation",type:"uint8"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.WorkerpoolOrderOperation",name:"",type:"tuple"}],name:"manageWorkerpoolOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.AppOrder",name:"",type:"tuple"},{components:[{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.DatasetOrder",name:"",type:"tuple"},{components:[{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.WorkerpoolOrder",name:"",type:"tuple"},{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appmaxprice",type:"uint256"},{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetmaxprice",type:"uint256"},{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolmaxprice",type:"uint256"},{internalType:"address",name:"requester",type:"address"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"beneficiary",type:"address"},{internalType:"address",name:"callback",type:"address"},{internalType:"string",name:"params",type:"string"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.RequestOrder",name:"",type:"tuple"}],name:"matchOrders",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.AppOrder",name:"",type:"tuple"},{components:[{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.DatasetOrder",name:"",type:"tuple"},{components:[{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.WorkerpoolOrder",name:"",type:"tuple"},{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appmaxprice",type:"uint256"},{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetmaxprice",type:"uint256"},{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolmaxprice",type:"uint256"},{internalType:"address",name:"requester",type:"address"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"beneficiary",type:"address"},{internalType:"address",name:"callback",type:"address"},{internalType:"string",name:"params",type:"string"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.RequestOrder",name:"",type:"tuple"}],name:"matchOrdersWithEth",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"address",name:"",type:"address"},{internalType:"bytes",name:"",type:"bytes"}],name:"receiveApproval",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"recover",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"reopen",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"requestToken",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"address",name:"",type:"address"}],name:"requestTokenFor",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"resultFor",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"}],name:"reveal",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"reveal_deadline_ratio",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"safeDepositEth",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"address",name:"",type:"address"}],name:"safeDepositEthFor",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"}],name:"safeWithdrawEth",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"address",name:"",type:"address"}],name:"safeWithdrawEthTo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"setCallbackGas",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ens",type:"address"},{internalType:"string",name:"name",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"setTeeBroker",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"teebroker",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"token",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"updateDomainSeparator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"bytes32",name:"",type:"bytes32"}],name:"verifyPresignature",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes",name:"",type:"bytes"}],name:"verifyPresignatureOrSignature",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes",name:"",type:"bytes"}],name:"verifySignature",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"viewAccount",outputs:[{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"locked",type:"uint256"}],internalType:"struct IexecLibCore_v5.Account",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"viewCategory",outputs:[{components:[{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"description",type:"string"},{internalType:"uint256",name:"workClockTimeRef",type:"uint256"}],internalType:"struct IexecLibCore_v5.Category",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"viewConsumed",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"address",name:"",type:"address"}],name:"viewContribution",outputs:[{components:[{internalType:"enum IexecLibCore_v5.ContributionStatusEnum",name:"status",type:"uint8"},{internalType:"bytes32",name:"resultHash",type:"bytes32"},{internalType:"bytes32",name:"resultSeal",type:"bytes32"},{internalType:"address",name:"enclaveChallenge",type:"address"},{internalType:"uint256",name:"weight",type:"uint256"}],internalType:"struct IexecLibCore_v5.Contribution",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"viewDeal",outputs:[{components:[{components:[{internalType:"address",name:"pointer",type:"address"},{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"price",type:"uint256"}],internalType:"struct IexecLibCore_v5.Resource",name:"app",type:"tuple"},{components:[{internalType:"address",name:"pointer",type:"address"},{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"price",type:"uint256"}],internalType:"struct IexecLibCore_v5.Resource",name:"dataset",type:"tuple"},{components:[{internalType:"address",name:"pointer",type:"address"},{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"price",type:"uint256"}],internalType:"struct IexecLibCore_v5.Resource",name:"workerpool",type:"tuple"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"requester",type:"address"},{internalType:"address",name:"beneficiary",type:"address"},{internalType:"address",name:"callback",type:"address"},{internalType:"string",name:"params",type:"string"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"botFirst",type:"uint256"},{internalType:"uint256",name:"botSize",type:"uint256"},{internalType:"uint256",name:"workerStake",type:"uint256"},{internalType:"uint256",name:"schedulerRewardRatio",type:"uint256"}],internalType:"struct IexecLibCore_v5.Deal",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"viewPresigned",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"viewScore",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"viewTask",outputs:[{components:[{internalType:"enum IexecLibCore_v5.TaskStatusEnum",name:"status",type:"uint8"},{internalType:"bytes32",name:"dealid",type:"bytes32"},{internalType:"uint256",name:"idx",type:"uint256"},{internalType:"uint256",name:"timeref",type:"uint256"},{internalType:"uint256",name:"contributionDeadline",type:"uint256"},{internalType:"uint256",name:"revealDeadline",type:"uint256"},{internalType:"uint256",name:"finalDeadline",type:"uint256"},{internalType:"bytes32",name:"consensusValue",type:"bytes32"},{internalType:"uint256",name:"revealCounter",type:"uint256"},{internalType:"uint256",name:"winnerCounter",type:"uint256"},{internalType:"address[]",name:"contributors",type:"address[]"},{internalType:"bytes32",name:"resultDigest",type:"bytes32"},{internalType:"bytes",name:"results",type:"bytes"},{internalType:"uint256",name:"resultsTimestamp",type:"uint256"},{internalType:"bytes",name:"resultsCallback",type:"bytes"}],internalType:"struct IexecLibCore_v5.Task",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"withdrawEth",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"address",name:"",type:"address"}],name:"withdrawEthTo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"address",name:"",type:"address"}],name:"withdrawTo",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"workerpool_stake_ratio",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"workerpoolregistry",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"}],networks:{}},Jd={abi:[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"worker",type:"address"},{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"}],name:"AccurateContribution",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],indexed:!1,internalType:"struct IexecLibOrders_v5.AppOrder",name:"apporder",type:"tuple"}],name:"BroadcastAppOrder",type:"event"},{anonymous:!1,inputs:[{components:[{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],indexed:!1,internalType:"struct IexecLibOrders_v5.DatasetOrder",name:"datasetorder",type:"tuple"}],name:"BroadcastDatasetOrder",type:"event"},{anonymous:!1,inputs:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appmaxprice",type:"uint256"},{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetmaxprice",type:"uint256"},{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolmaxprice",type:"uint256"},{internalType:"address",name:"requester",type:"address"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"beneficiary",type:"address"},{internalType:"address",name:"callback",type:"address"},{internalType:"string",name:"params",type:"string"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],indexed:!1,internalType:"struct IexecLibOrders_v5.RequestOrder",name:"requestorder",type:"tuple"}],name:"BroadcastRequestOrder",type:"event"},{anonymous:!1,inputs:[{components:[{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],indexed:!1,internalType:"struct IexecLibOrders_v5.WorkerpoolOrder",name:"workerpoolorder",type:"tuple"}],name:"BroadcastWorkerpoolOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"appHash",type:"bytes32"}],name:"ClosedAppOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"datasetHash",type:"bytes32"}],name:"ClosedDatasetOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"requestHash",type:"bytes32"}],name:"ClosedRequestOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"workerpoolHash",type:"bytes32"}],name:"ClosedWorkerpoolOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"catid",type:"uint256"},{indexed:!1,internalType:"string",name:"name",type:"string"},{indexed:!1,internalType:"string",name:"description",type:"string"},{indexed:!1,internalType:"uint256",name:"workClockTimeRef",type:"uint256"}],name:"CreateCategory",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"worker",type:"address"},{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"}],name:"FaultyContribution",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Lock",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"dealid",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"appHash",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"datasetHash",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"workerpoolHash",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"requestHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"volume",type:"uint256"}],name:"OrdersMatched",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes32",name:"ref",type:"bytes32"}],name:"Reward",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"workerpool",type:"address"},{indexed:!1,internalType:"bytes32",name:"dealid",type:"bytes32"}],name:"SchedulerNotice",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bytes32",name:"ref",type:"bytes32"}],name:"Seize",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"appHash",type:"bytes32"}],name:"SignedAppOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"datasetHash",type:"bytes32"}],name:"SignedDatasetOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"requestHash",type:"bytes32"}],name:"SignedRequestOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"workerpoolHash",type:"bytes32"}],name:"SignedWorkerpoolOrder",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"}],name:"TaskClaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"consensus",type:"bytes32"}],name:"TaskConsensus",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"},{indexed:!0,internalType:"address",name:"worker",type:"address"},{indexed:!1,internalType:"bytes32",name:"hash",type:"bytes32"}],name:"TaskContribute",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"results",type:"bytes"}],name:"TaskFinalize",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"},{indexed:!0,internalType:"address",name:"workerpool",type:"address"}],name:"TaskInitialize",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"}],name:"TaskReopen",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"taskid",type:"bytes32"},{indexed:!0,internalType:"address",name:"worker",type:"address"},{indexed:!1,internalType:"bytes32",name:"digest",type:"bytes32"}],name:"TaskReveal",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Unlock",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"appregistry",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"approveAndCall",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.AppOrder",name:"",type:"tuple"}],name:"broadcastAppOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.DatasetOrder",name:"",type:"tuple"}],name:"broadcastDatasetOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appmaxprice",type:"uint256"},{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetmaxprice",type:"uint256"},{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolmaxprice",type:"uint256"},{internalType:"address",name:"requester",type:"address"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"beneficiary",type:"address"},{internalType:"address",name:"callback",type:"address"},{internalType:"string",name:"params",type:"string"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.RequestOrder",name:"",type:"tuple"}],name:"broadcastRequestOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.WorkerpoolOrder",name:"",type:"tuple"}],name:"broadcastWorkerpoolOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"callbackgas",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"claim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32[]",name:"",type:"bytes32[]"}],name:"claimArray",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"string",name:"",type:"string"},{internalType:"string",name:"",type:"string"},{internalType:"uint8",name:"",type:"uint8"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"configure",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"address",name:"",type:"address"},{internalType:"bytes",name:"",type:"bytes"},{internalType:"bytes",name:"",type:"bytes"}],name:"contribute",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes",name:"",type:"bytes"},{internalType:"bytes",name:"",type:"bytes"},{internalType:"address",name:"",type:"address"},{internalType:"bytes",name:"",type:"bytes"},{internalType:"bytes",name:"",type:"bytes"}],name:"contributeAndFinalize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"contribution_deadline_ratio",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"countCategory",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"",type:"string"},{internalType:"string",name:"",type:"string"},{internalType:"uint256",name:"",type:"uint256"}],name:"createCategory",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"datasetregistry",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"deposit",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"depositFor",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"address[]",name:"",type:"address[]"}],name:"depositForArray",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[],name:"domain",outputs:[{components:[{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"}],internalType:"struct IexecLibOrders_v5.EIP712Domain",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712domain_separator",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"final_deadline_ratio",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes",name:"",type:"bytes"},{internalType:"bytes",name:"",type:"bytes"}],name:"finalize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"frozenOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"groupmember_purpose",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"importScore",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"uint256",name:"",type:"uint256"}],name:"initialize",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32[]",name:"",type:"bytes32[]"},{internalType:"uint256[]",name:"",type:"uint256[]"}],name:"initializeAndClaimArray",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32[]",name:"",type:"bytes32[]"},{internalType:"uint256[]",name:"",type:"uint256[]"}],name:"initializeArray",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"kitty_address",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"kitty_min",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"kitty_ratio",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.AppOrder",name:"order",type:"tuple"},{internalType:"enum IexecLibOrders_v5.OrderOperationEnum",name:"operation",type:"uint8"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.AppOrderOperation",name:"",type:"tuple"}],name:"manageAppOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.DatasetOrder",name:"order",type:"tuple"},{internalType:"enum IexecLibOrders_v5.OrderOperationEnum",name:"operation",type:"uint8"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.DatasetOrderOperation",name:"",type:"tuple"}],name:"manageDatasetOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appmaxprice",type:"uint256"},{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetmaxprice",type:"uint256"},{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolmaxprice",type:"uint256"},{internalType:"address",name:"requester",type:"address"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"beneficiary",type:"address"},{internalType:"address",name:"callback",type:"address"},{internalType:"string",name:"params",type:"string"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.RequestOrder",name:"order",type:"tuple"},{internalType:"enum IexecLibOrders_v5.OrderOperationEnum",name:"operation",type:"uint8"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.RequestOrderOperation",name:"",type:"tuple"}],name:"manageRequestOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.WorkerpoolOrder",name:"order",type:"tuple"},{internalType:"enum IexecLibOrders_v5.OrderOperationEnum",name:"operation",type:"uint8"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.WorkerpoolOrderOperation",name:"",type:"tuple"}],name:"manageWorkerpoolOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.AppOrder",name:"",type:"tuple"},{components:[{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"workerpoolrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.DatasetOrder",name:"",type:"tuple"},{components:[{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolprice",type:"uint256"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"apprestrict",type:"address"},{internalType:"address",name:"datasetrestrict",type:"address"},{internalType:"address",name:"requesterrestrict",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.WorkerpoolOrder",name:"",type:"tuple"},{components:[{internalType:"address",name:"app",type:"address"},{internalType:"uint256",name:"appmaxprice",type:"uint256"},{internalType:"address",name:"dataset",type:"address"},{internalType:"uint256",name:"datasetmaxprice",type:"uint256"},{internalType:"address",name:"workerpool",type:"address"},{internalType:"uint256",name:"workerpoolmaxprice",type:"uint256"},{internalType:"address",name:"requester",type:"address"},{internalType:"uint256",name:"volume",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"address",name:"beneficiary",type:"address"},{internalType:"address",name:"callback",type:"address"},{internalType:"string",name:"params",type:"string"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"bytes",name:"sign",type:"bytes"}],internalType:"struct IexecLibOrders_v5.RequestOrder",name:"",type:"tuple"}],name:"matchOrders",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"address",name:"",type:"address"},{internalType:"bytes",name:"",type:"bytes"}],name:"receiveApproval",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"recover",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"reopen",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"resultFor",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"",type:"bytes32"}],name:"reveal",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"reveal_deadline_ratio",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"setCallbackGas",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"ens",type:"address"},{internalType:"string",name:"name",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"setTeeBroker",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"teebroker",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"token",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"updateDomainSeparator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"bytes32",name:"",type:"bytes32"}],name:"verifyPresignature",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes",name:"",type:"bytes"}],name:"verifyPresignatureOrSignature",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes",name:"",type:"bytes"}],name:"verifySignature",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"viewAccount",outputs:[{components:[{internalType:"uint256",name:"stake",type:"uint256"},{internalType:"uint256",name:"locked",type:"uint256"}],internalType:"struct IexecLibCore_v5.Account",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"viewCategory",outputs:[{components:[{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"description",type:"string"},{internalType:"uint256",name:"workClockTimeRef",type:"uint256"}],internalType:"struct IexecLibCore_v5.Category",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"viewConsumed",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"address",name:"",type:"address"}],name:"viewContribution",outputs:[{components:[{internalType:"enum IexecLibCore_v5.ContributionStatusEnum",name:"status",type:"uint8"},{internalType:"bytes32",name:"resultHash",type:"bytes32"},{internalType:"bytes32",name:"resultSeal",type:"bytes32"},{internalType:"address",name:"enclaveChallenge",type:"address"},{internalType:"uint256",name:"weight",type:"uint256"}],internalType:"struct IexecLibCore_v5.Contribution",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"viewDeal",outputs:[{components:[{components:[{internalType:"address",name:"pointer",type:"address"},{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"price",type:"uint256"}],internalType:"struct IexecLibCore_v5.Resource",name:"app",type:"tuple"},{components:[{internalType:"address",name:"pointer",type:"address"},{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"price",type:"uint256"}],internalType:"struct IexecLibCore_v5.Resource",name:"dataset",type:"tuple"},{components:[{internalType:"address",name:"pointer",type:"address"},{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"price",type:"uint256"}],internalType:"struct IexecLibCore_v5.Resource",name:"workerpool",type:"tuple"},{internalType:"uint256",name:"trust",type:"uint256"},{internalType:"uint256",name:"category",type:"uint256"},{internalType:"bytes32",name:"tag",type:"bytes32"},{internalType:"address",name:"requester",type:"address"},{internalType:"address",name:"beneficiary",type:"address"},{internalType:"address",name:"callback",type:"address"},{internalType:"string",name:"params",type:"string"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"botFirst",type:"uint256"},{internalType:"uint256",name:"botSize",type:"uint256"},{internalType:"uint256",name:"workerStake",type:"uint256"},{internalType:"uint256",name:"schedulerRewardRatio",type:"uint256"}],internalType:"struct IexecLibCore_v5.Deal",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"viewPresigned",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"viewScore",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"viewTask",outputs:[{components:[{internalType:"enum IexecLibCore_v5.TaskStatusEnum",name:"status",type:"uint8"},{internalType:"bytes32",name:"dealid",type:"bytes32"},{internalType:"uint256",name:"idx",type:"uint256"},{internalType:"uint256",name:"timeref",type:"uint256"},{internalType:"uint256",name:"contributionDeadline",type:"uint256"},{internalType:"uint256",name:"revealDeadline",type:"uint256"},{internalType:"uint256",name:"finalDeadline",type:"uint256"},{internalType:"bytes32",name:"consensusValue",type:"bytes32"},{internalType:"uint256",name:"revealCounter",type:"uint256"},{internalType:"uint256",name:"winnerCounter",type:"uint256"},{internalType:"address[]",name:"contributors",type:"address[]"},{internalType:"bytes32",name:"resultDigest",type:"bytes32"},{internalType:"bytes",name:"results",type:"bytes"},{internalType:"uint256",name:"resultsTimestamp",type:"uint256"},{internalType:"bytes",name:"resultsCallback",type:"bytes"}],internalType:"struct IexecLibCore_v5.Task",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"withdraw",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"address",name:"",type:"address"}],name:"withdrawTo",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"workerpool_stake_ratio",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"workerpoolregistry",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"}],networks:{}},Yd={abi:[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"_previous",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"initialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"_entry",type:"address"}],name:"isRegistered",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"master",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"previous",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"proxyCode",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"proxyCodeHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_baseURI",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_ens",type:"address"},{internalType:"string",name:"_name",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_appOwner",type:"address"},{internalType:"string",name:"_appName",type:"string"},{internalType:"string",name:"_appType",type:"string"},{internalType:"bytes",name:"_appMultiaddr",type:"bytes"},{internalType:"bytes32",name:"_appChecksum",type:"bytes32"},{internalType:"bytes",name:"_appMREnclave",type:"bytes"}],name:"createApp",outputs:[{internalType:"contract App",name:"",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_appOwner",type:"address"},{internalType:"string",name:"_appName",type:"string"},{internalType:"string",name:"_appType",type:"string"},{internalType:"bytes",name:"_appMultiaddr",type:"bytes"},{internalType:"bytes32",name:"_appChecksum",type:"bytes32"},{internalType:"bytes",name:"_appMREnclave",type:"bytes"}],name:"predictApp",outputs:[{internalType:"contract App",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0}],networks:{1:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xB1C52075b276f87b1834919167312221d50c9D16"},3:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xB1C52075b276f87b1834919167312221d50c9D16"},4:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xB1C52075b276f87b1834919167312221d50c9D16"},5:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xB1C52075b276f87b1834919167312221d50c9D16"},42:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xB1C52075b276f87b1834919167312221d50c9D16"},133:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xB1C52075b276f87b1834919167312221d50c9D16"},134:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xB1C52075b276f87b1834919167312221d50c9D16"}}},Xd={abi:[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"_previous",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"initialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"_entry",type:"address"}],name:"isRegistered",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"master",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"previous",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"proxyCode",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"proxyCodeHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_baseURI",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_ens",type:"address"},{internalType:"string",name:"_name",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_workerpoolOwner",type:"address"},{internalType:"string",name:"_workerpoolDescription",type:"string"}],name:"createWorkerpool",outputs:[{internalType:"contract Workerpool",name:"",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_workerpoolOwner",type:"address"},{internalType:"string",name:"_workerpoolDescription",type:"string"}],name:"predictWorkerpool",outputs:[{internalType:"contract Workerpool",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0}],networks:{1:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xC76A18c78B7e530A165c5683CB1aB134E21938B4"},3:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xC76A18c78B7e530A165c5683CB1aB134E21938B4"},4:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xC76A18c78B7e530A165c5683CB1aB134E21938B4"},5:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xC76A18c78B7e530A165c5683CB1aB134E21938B4"},42:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xC76A18c78B7e530A165c5683CB1aB134E21938B4"},133:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xC76A18c78B7e530A165c5683CB1aB134E21938B4"},134:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xC76A18c78B7e530A165c5683CB1aB134E21938B4"}}},Qd={abi:[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"_previous",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"initialized",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"_entry",type:"address"}],name:"isRegistered",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"master",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"previous",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"proxyCode",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"proxyCodeHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_baseURI",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_ens",type:"address"},{internalType:"string",name:"_name",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function",constant:!0},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function",constant:!0},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_datasetOwner",type:"address"},{internalType:"string",name:"_datasetName",type:"string"},{internalType:"bytes",name:"_datasetMultiaddr",type:"bytes"},{internalType:"bytes32",name:"_datasetChecksum",type:"bytes32"}],name:"createDataset",outputs:[{internalType:"contract Dataset",name:"",type:"address"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_datasetOwner",type:"address"},{internalType:"string",name:"_datasetName",type:"string"},{internalType:"bytes",name:"_datasetMultiaddr",type:"bytes"},{internalType:"bytes32",name:"_datasetChecksum",type:"bytes32"}],name:"predictDataset",outputs:[{internalType:"contract Dataset",name:"",type:"address"}],stateMutability:"view",type:"function",constant:!0}],networks:{1:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0x799DAa22654128d0C64d5b79eac9283008158730"},3:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0x799DAa22654128d0C64d5b79eac9283008158730"},4:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0x799DAa22654128d0C64d5b79eac9283008158730"},5:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0x799DAa22654128d0C64d5b79eac9283008158730"},42:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0x799DAa22654128d0C64d5b79eac9283008158730"},133:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0x799DAa22654128d0C64d5b79eac9283008158730"},134:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0x799DAa22654128d0C64d5b79eac9283008158730"}}},ef={abi:[{inputs:[],name:"m_appChecksum",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"m_appMREnclave",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"m_appMultiaddr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"m_appName",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"m_appType",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"registry",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_ens",type:"address"},{internalType:"string",name:"_name",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_appName",type:"string"},{internalType:"string",name:"_appType",type:"string"},{internalType:"bytes",name:"_appMultiaddr",type:"bytes"},{internalType:"bytes32",name:"_appChecksum",type:"bytes32"},{internalType:"bytes",name:"_appMREnclave",type:"bytes"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"}],networks:{}},tf={abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"oldWorkerStakeRatioPolicy",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newWorkerStakeRatioPolicy",type:"uint256"},{indexed:!1,internalType:"uint256",name:"oldSchedulerRewardRatioPolicy",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newSchedulerRewardRatioPolicy",type:"uint256"}],name:"PolicyUpdate",type:"event"},{inputs:[],name:"m_schedulerRewardRatioPolicy",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"m_workerStakeRatioPolicy",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"m_workerpoolDescription",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"registry",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_ens",type:"address"},{internalType:"string",name:"_name",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_workerpoolDescription",type:"string"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_newWorkerStakeRatioPolicy",type:"uint256"},{internalType:"uint256",name:"_newSchedulerRewardRatioPolicy",type:"uint256"}],name:"changePolicy",outputs:[],stateMutability:"nonpayable",type:"function"}],networks:{}},rf={abi:[{inputs:[],name:"m_datasetChecksum",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"m_datasetMultiaddr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"m_datasetName",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"registry",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_ens",type:"address"},{internalType:"string",name:"_name",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_datasetName",type:"string"},{internalType:"bytes",name:"_datasetMultiaddr",type:"bytes"},{internalType:"bytes32",name:"_datasetChecksum",type:"bytes32"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"}],networks:{}},nf={abi:[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"initialSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"version",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"owner",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"locked",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{inputs:[],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"refill",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_giver",type:"address"},{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"forceApprove",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_toburn",type:"address"},{name:"_value",type:"uint256"}],name:"forceBurn",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_value",type:"uint256"}],name:"burn",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"},{name:"_extraData",type:"bytes"}],name:"approveAndCall",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"remaining",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}],networks:{1:{address:"0x607F4C5BB672230e8672085532f7e901544a7375",links:{}},3:{events:{"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"}},links:{},address:"0x7314dc4d7794b5e7894212ca1556ae8e3de58621",updated_at:1507185226658},4:{events:{"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"}},links:{},address:"0xf1e6ad3a7ef0c86c915f0fedf80ed851809bea90",updated_at:1507153008876},5:{events:{"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"}},links:{},address:"0xe0d00540a3729B4fdB96f92534dA97DC7973Af8b",updated_at:1561724003e3},31:{events:{"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"}},links:{},address:"0x88b37ff3c0df0692f982a28099a9999c4a422293",updated_at:1521045503088},42:{events:{"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"}},links:{},address:"0xc57538846ec405ea25deb00e0f9b29a432d53507",updated_at:1507187064558}}},af={abi:[{inputs:[{internalType:"address",name:"underlyingtoken",type:"address"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"},{internalType:"uint256",name:"softcap",type:"uint256"},{internalType:"address[]",name:"admins",type:"address[]"},{internalType:"address[]",name:"kycadmins",type:"address[]"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"id",type:"uint256"}],name:"Snapshot",type:"event"},{anonymous:!1,inputs:[],name:"SoftCapReached",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"KYC_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"KYC_MEMBER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"extraData",type:"bytes"}],name:"approveAndCall",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"snapshotId",type:"uint256"}],name:"balanceOfAt",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"detectTransferRestriction",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"}],name:"grantKYC",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"isKYC",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint8",name:"restrictionCode",type:"uint8"}],name:"messageForTransferRestriction",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"}],name:"revokeKYC",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"snapshot",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"softCap",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"softCapReached",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"snapshotId",type:"uint256"}],name:"totalSupplyAt",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"transferAndCall",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"underlyingToken",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"deposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"recover",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"to",type:"address"}],name:"claim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address",name:"token",type:"address"},{internalType:"bytes",name:"",type:"bytes"}],name:"receiveApproval",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onTokenTransfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],networks:{1:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},"0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},"0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},"0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},"0x8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67":{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"id",type:"uint256"}],name:"Snapshot",type:"event"},"0x629c1b672a634075c61f1cbfbec5f3e47b94c3f90f065486f615ecfa18713d34":{anonymous:!1,inputs:[],name:"SoftCapReached",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xA3B26327482312f70E077aAba62336f7643e41E1",transactionHash:"0x978c7b48dbf5830976c095929e8cfd65e9d657d46f526aea580981bf0de20a17"},5:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},"0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},"0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},"0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},"0x8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67":{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"id",type:"uint256"}],name:"Snapshot",type:"event"},"0x629c1b672a634075c61f1cbfbec5f3e47b94c3f90f065486f615ecfa18713d34":{anonymous:!1,inputs:[],name:"SoftCapReached",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0xe8D9DB06F99536612c6B193E4C7347866B84C9d5",transactionHash:"0x2dc477812cbeed9ed49b1943952492d4c3684f699e81d4ddc5b43e677c103274"},1607418933360:{events:{"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},"0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},"0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},"0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b":{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},"0x8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67":{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"id",type:"uint256"}],name:"Snapshot",type:"event"},"0x629c1b672a634075c61f1cbfbec5f3e47b94c3f90f065486f615ecfa18713d34":{anonymous:!1,inputs:[],name:"SoftCapReached",type:"event"},"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef":{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"}},links:{},address:"0x63e0E0F3e1628318572ECD2f5d5B91FDfdf10bd2",transactionHash:"0xa74d2f6b211c9cedc38a2b4501dcd5081852bf39f83a26f7b1205c060e313353"}}},sf=v("iexec:IExecContractsClient"),of={1:"0x0bf375A6238359CE14987C2285B8B099eE8e8709",5:"0x0bf375A6238359CE14987C2285B8B099eE8e8709"},uf={standard:["134"],enterprise:[]},lf={134:"0x0"},hf=(e,t)=>{if(!e)return"enterprise"===t?af:nf};class cf{constructor({provider:e,signer:t,chainId:r,hubAddress:n,useGas:i=!0,isNative:a,flavour:s="standard",confirms:o=1}={}){const u=`${r}`;if(!e)throw Error("missing provider key");if(!u)throw Error("missing chainId key");if(!Number.isInteger(o)||o<=0)throw Error("invalid confirms");if("standard"!==s&&"enterprise"!==s)throw Error("invalid flavour");this._args={provider:e,signer:t,chainId:u,hubAddress:n,useGas:i,isNative:a,flavour:s};const l=void 0!==a?!!a:((e,t)=>uf[t].includes(e))(u,s),h=!1===i?"0x0":(e=>lf[e])(u),c=(({ethSigner:e,ethProvider:t,chainId:r,globalHubAddress:n,isNative:i,flavour:a})=>{const s={},o=((e,t)=>({hub:{contractDesc:e?Jd:Zd},token:{contractDesc:hf(e,t),hubPropName:"token"},app:{contractDesc:ef,registryName:"appRegistry"},appRegistry:{contractDesc:Yd,hubPropName:"appregistry"},dataset:{contractDesc:rf,registryName:"datasetRegistry"},datasetRegistry:{contractDesc:Qd,hubPropName:"datasetregistry"},workerpool:{contractDesc:tf,registryName:"workerpoolRegistry"},workerpoolRegistry:{contractDesc:Xd,hubPropName:"workerpoolregistry"}}))(i,a),u=n||((e,t)=>{if("enterprise"===t){if(of[e])return of[e];throw Error(`Missing iExec enterprise contract default address for chain ${e}`)}if(Wd&&Wd[e]&&Wd[e].address)return Wd[e].address;throw Error(`Missing iExec contract default address for chain ${e}`)})(r,a),l=(r,n)=>{try{const{contractDesc:i}=o[r];if(!n)throw Error("no contract address provided");return new Vd(n,i.abi,e||t)}catch(e){throw sf("getContract()",e),e}},h=()=>l("hub",u),c=async e=>{try{const{registryName:t}=o[e];if(s[t])return s[t];const r=h(),n=await r[o[t].hubPropName]();return s[t]=n,n}catch(e){throw sf("fetchRegistryAddress()",e),e}},d=async()=>{try{if(s.token)return s.token;const e=h(),t=await e.token();return s.token=t,t}catch(e){throw sf("fetchTokenAddress()",e),e}};return{pocoVersion:"5.3.0",isNative:i,flavour:a,hubAddress:u,getContract:l,getIExecContract:h,fetchRegistryContract:async e=>{try{const t=await c(e);return l(o[e].registryName,t)}catch(e){throw sf("fetchRegistryContract()",e),e}},...!i&&{fetchTokenContract:async()=>{try{const e=await d();return l("token",e)}catch(e){throw sf("fetchTokenContract()",e),e}}},...!i&&{fetchTokenAddress:d},fetchRegistryAddress:c}})({ethSigner:t,ethProvider:e,chainId:u,globalHubAddress:n,isNative:l,flavour:s});this.setSigner=e=>{const t=e.connect(this.provider);Object.assign(this,new cf({...this._args,signer:t}))},Object.assign(this,{provider:e,signer:t,chainId:u,txOptions:{gasPrice:h},confirms:o,...c})}}const df=cf,ff="processing response error",pf=e=>{if("string"==typeof e)return e;if(e.reason){if(e.reason===ff){if(e.error&&e.error.message)return`${ff}: ${e.error.message}`;if(e.body&&e.body.error&&e.body.error.message)return`${ff}: ${e.body.error.message}`}return e.reason}return e.message},yf=async e=>{try{return await e}catch(e){throw new Ls(pf(e),e)}},mf=yf,bf=async e=>{try{return await e}catch(e){throw new Fs(pf(e),e)}},gf=async e=>{try{return await e}catch(e){throw new Us(pf(e),e)}},vf=gf,wf=gf,{getAddress:_f,namehash:Mf,isAddress:Tf}=e,Ef=v("validators"),Af=/^\d+$/,xf=/^[1-9]\d*$/,kf=Object.values(eo),Sf=ys,If=()=>ys().transform((e=>e.toLowerCase())).oneOf(kf,"${path} is not a valid TEE framework"),Cf=({message:e}={})=>ys().transform((e=>{const t=e.replace(/^0+/,"");return t.length>0?t:"0"})).matches(Af,e||"${originalValue} is not a valid number"),Of=()=>bs().integer(),Rf=()=>Of().min(0).max(Number.MAX_SAFE_INTEGER-1),Nf=()=>Of().min(1).max(Number.MAX_SAFE_INTEGER-1),Pf=()=>Cf({message:"${originalValue} is not a valid uint256"}),Bf=({originalValue:e})=>`${Array.isArray(e)?e.join(" "):e} is not a valid amount`,Df=({defaultUnit:e="nRLC"}={})=>ys().transform(((e,t)=>{if(Array.isArray(t)){if(t.length>2)throw new za(Bf({originalValue:t}));return 2===t.length&&t[1]?`${t[0]} ${t[1]}`:`${t[0]}`}return e})).transform((e=>{const[t,r]=e.split(" "),n=t.replace(/^0+/,""),i=n.length>0?n:"0";return void 0!==r?[i,r].join(" "):i})).transform(((t,r)=>{try{return((e,t="RLC")=>{const[r,n]=bo(e).split(" "),i=void 0!==n?n:t;if(!["nRLC","RLC"].includes(i))throw Error("Invalid token unit");const a="RLC"===i?9:0;try{return mo(ho(r,a))}catch(e){throw fo("parseRLC()",e),Error("Invalid token amount")}})(t,e).toString()}catch(e){throw new za(Bf({originalValue:r}))}})).matches(/^[0-9]*$/,Bf),Lf=()=>Cf({message:"${originalValue} is not a valid chainId"}),Ff=e=>t=>{try{if("string"==typeof t){if(t.match(/^.*\.eth$/)){if(e&&e.resolveName&&"function"==typeof e.resolveName)return Ef("resolving ENS",t),yf(e.resolveName(t)).then((e=>(Ef("resolved ENS",e),e))).catch((e=>(Ef("ENS resolution error",e),null)));Ef("no ethProvider ENS can't be resolved")}return _f(t.toLowerCase())}}catch(e){Ef("Error",e)}return t},Uf=async e=>{if(void 0===e)return!0;if("string"==typeof e)return!e.match(/^.*\.eth$/);try{const t=await e;return!!t&&(_f(t),!0)}catch(e){return Ef("resolve-ens",e),!1}},jf=async e=>{const t="string"==typeof e?e:await e;return Tf(t)},qf=({ethProvider:e}={})=>ss().transform((t=>Ff(e)(t))).test("resolve-ens","Unable to resolve ENS ${originalValue}",(e=>Uf(e))).test("is-address","${originalValue} is not a valid ethereum address",(e=>jf(e))),zf=({ethProvider:e}={})=>ss().transform((t=>t===ao?t:Ff(e)(t))).test("resolve-ens","Unable to resolve ENS ${originalValue}",(e=>e===ao||Uf(e))).test("is-address","${originalValue} is not a valid ethereum address",(e=>e===ao||jf(e))),Gf=()=>ys().lowercase().matches(po,"${originalValue} is not a bytes32 hexstring"),Kf=()=>({salt:Gf().required()}),Hf=()=>({sign:ys().matches(/^(0x)([0-9a-f]{2})*/,"${originalValue} is not a valid signature").required()}),$f=()=>Pf(),Vf=()=>Is({iexec_args:ys(),iexec_input_files:Os().transform(((e,t)=>Array.isArray(t)?t:"string"==typeof t?t.split(","):e)).of(ys().url('${path} "${value}" is not a valid URL').required('${path} "${value}" is not a valid URL')),[no]:us(),[io]:ys().when("$isCallback",(([e],t)=>!0===e?t.notRequired():t.default(to.IPFS).when("$isTee",(([e],t)=>!0===e?t.oneOf(Object.values(to),'${path} "${value}" is not a valid storage provider, use one of the supported providers (${values})'):t.oneOf([to.IPFS],'${path} "${value}" is not supported for non TEE tasks use supported storage provider ${values}'))).required())),[ro]:ss().when("$isTee",(([e])=>!0===e?Is().test("keys-are-int","${path} mapping keys must be strictly positive integers",(e=>!(null!=e&&Object.keys(e).find((e=>!xf.test(e)))))).test("values-are-string","${path} mapping names must be strings",(e=>!(null!=e&&Object.values(e).find((e=>"string"!=typeof e||0===e.length))))).nonNullable():ss().test("is-not-defined","${path} is not supported for non TEE tasks",(e=>void 0===e)))),iexec_result_storage_proxy:ys().when(`${io}`,(([e],t)=>e===to.IPFS?t.when("$resultProxyURL",(([e],t)=>t.default(e))).required(`\${path} is required field with "${to.IPFS}" storage`):t.notRequired())),iexec_developer_logger:us().notRequired()}).json().noUnknown(!0,'Unknown key "${unknown}" in params'),Wf=()=>ss().transform((e=>{if(Array.isArray(e))try{return Co(e)}catch(e){return e}if("string"==typeof e){const t=e.toLowerCase();if("0x"===t.substring(0,2))return t;try{return Co(e.split(","))}catch(e){return e}}return Error("Invalid tag")})).test("no-transform-error",(({originalValue:e,value:t})=>`${e} is not a valid tag. ${t.message}`),(e=>!(e instanceof Error))).test("is-bytes32","${originalValue} is not a valid bytes32 hexstring",(async e=>{if(e instanceof Error)return!0;try{return await Gf().validate(e),!0}catch(e){return!1}})).test("is-valid-tee-tag","${originalValue} has a invalid tee combination",((e,{createError:t})=>{if(e instanceof Error)return!0;const r=Ro(e,Io.tee),n=Object.values(eo).filter((t=>Ro(e,Io[t])));try{if(r){if(n.length<1)throw Error(`'tee' tag must be used with a tee framework (${Object.values(eo).map((e=>`'${e}'`)).join("|")})`);if(n.length>1)throw Error(`tee framework tags are exclusive (${Object.values(eo).map((e=>`'${e}'`)).join("|")})`)}else if(n.length>0)throw Error(`'${n[0]}' tag must be used with 'tee' tag`)}catch(e){return t({message:e.message})}return!0})),Zf=e=>Is({app:qf(e).required(),appprice:Df().required(),volume:Pf().required(),tag:Wf().required(),datasetrestrict:qf(e).required(),workerpoolrestrict:qf(e).required(),requesterrestrict:qf(e).required()}),Jf=e=>Zf(e).shape(Kf(),"${originalValue} is not a valid salted apporder"),Yf=e=>Jf(e).shape(Hf(),"${originalValue} is not a valid signed apporder"),Xf=e=>Is({dataset:qf(e).required(),datasetprice:Df().required(),volume:Pf().required(),tag:Wf().required(),apprestrict:qf(e).required(),workerpoolrestrict:qf(e).required(),requesterrestrict:qf(e).required()}),Qf=e=>Xf(e).shape(Kf(),"${originalValue} is not a valid salted datasetorder"),ep=e=>Qf(e).shape(Hf(),"${originalValue} is not a valid signed datasetorder"),tp=e=>Is({workerpool:qf(e).required(),workerpoolprice:Df().required(),volume:Pf().required(),tag:Wf().required(),category:$f().required(),trust:Pf().required(),apprestrict:qf(e).required(),datasetrestrict:qf(e).required(),requesterrestrict:qf(e).required()}),rp=e=>tp(e).shape(Kf(),"${originalValue} is not a valid salted workerpoolorder"),np=e=>rp(e).shape(Hf(),"${originalValue} is not a valid signed workerpoolorder"),ip=e=>Is({app:qf(e).required(),appmaxprice:Df().required(),dataset:qf(e).required(),datasetmaxprice:Df().required(),workerpool:qf(e).required(),workerpoolmaxprice:Df().required(),requester:qf(e).required(),volume:Pf().required(),tag:Wf().required(),category:$f().required(),trust:Pf().required(),beneficiary:qf(e).required(),callback:qf(e).required(),params:ys().transform(((e,t)=>"object"==typeof t?JSON.stringify(t):e)).test("is-json","${originalValue} is not a valid params, must be a json",(e=>{if(void 0===e)return!0;try{return JSON.parse(e),!0}catch(e){return!1}}))}),ap=e=>ip(e).shape(Kf(),"${originalValue} is not a valid salted requestorder"),sp=e=>ap(e).shape(Hf(),"${originalValue} is not a valid signed requestorder"),op=()=>ss().transform((e=>{if(e instanceof Uint8Array)return e;if("string"==typeof e)return((e,{strict:t=!0}={})=>{let r;try{r=w.Buffer.from(Sa(e).bytes)}catch(n){if(t)throw n;r=To(e)}return r})(e,{strict:!1});throw new za("${originalValue} is not a valid multiaddr")})),up=()=>Is({framework:If().required(),version:ys().required(),fingerprint:ys().required(),entrypoint:ss().when("framework",(([e],t)=>e&&e.toLowerCase()===eo.SCONE?ys().required():t.is([void 0],'Unknown key "${path}" in mrenclave'))),heapSize:ss().when("framework",(([e],t)=>e&&e.toLowerCase()===eo.SCONE?Rf().required():t.is([void 0],'Unknown key "${path}" in mrenclave')))}).json().noUnknown(!0,'Unknown key "${unknown}" in mrenclave'),lp=e=>Is({owner:qf(e).required(),name:ys().required(),type:ys().oneOf(["DOCKER"],"${originalValue} is not a valid type").required(),multiaddr:op().required(),checksum:Gf().required(),mrenclave:ss().transform((e=>e instanceof Uint8Array?e:To("string"==typeof e?e:"object"==typeof e?JSON.stringify(e):""))).test("is-valid-mrenclave","${path} is not a valid mrenclave",(async(e,{originalValue:t,createError:r})=>{let n,i;if(t instanceof Uint8Array)try{n=w.Buffer.from(t).toString()}catch(e){return!1}else if("string"==typeof t)n=t;else if(t&&"object"==typeof t)i=t;else if(void 0!==t)return!1;try{return void 0!==n&&""!==n&&(i=JSON.parse(n)),i&&await up().validate(i,{stripUnknown:!1}),!0}catch(e){return e instanceof za&&r({message:e.message})}})).default((()=>To(""))).required()}),hp=e=>Is({owner:qf(e).required(),name:ys().required(),multiaddr:op().required(),checksum:Gf().required()}),cp=e=>Is({owner:qf(e).required(),description:ys().required()}),dp=()=>ss().transform((e=>{try{if("string"==typeof e)throw Error("unsupported string");return w.Buffer.from(e)}catch(e){throw new za("Invalid file buffer, must be ArrayBuffer or Buffer")}})),fp=()=>ys().test("no-empty-label","${originalValue} is not a valid ENS domain (domain cannot have empty labels)",(async e=>{try{if(e.split(".").filter((e=>e.length<1)).length>0)throw new Error("Domain cannot have empty labels");return!0}catch(e){return Ef("ensDomainSchema no-empty-label",e),!1}})).test("valid-namehash","${originalValue} is not a valid ENS domain (domain cannot contain unsupported characters)",(e=>{try{return Mf(e),!0}catch(e){return Ef("ensDomainSchema valid-namehash",e),!1}})).test("no-uppercase","${originalValue} is not a valid ENS domain (domain cannot contain uppercase characters)",(e=>{try{if(e!==e.toLowerCase())throw Error("Domain cannot have uppercase characters");return!0}catch(e){return Ef("ensDomainSchema no-uppercase",e),!1}})),pp=()=>ys().required().strict(!0),yp=()=>ys().url().default(""),mp=()=>ys().matches(/^http[s]?:\/\//,"${path} is not a valid url"),bp=()=>{throw new za("Missing parameter")},gp=v("iexec:IExecConfig");class vp{constructor({ethProvider:e,flavour:t="standard"}={},{hubAddress:r,ensRegistryAddress:n,ensPublicResolverAddress:i,isNative:a,useGas:s=!0,confirms:o,bridgeAddress:u,bridgedNetworkConf:l={},enterpriseSwapConf:h={},smsURL:c,resultProxyURL:d,ipfsGatewayURL:f,iexecGatewayURL:p,defaultTeeFramework:y,providerOptions:m}={}){if(null==e||""===e)throw new Bs("Missing ethProvider");const b="string"==typeof e||"number"==typeof e,g=e instanceof Ed;let v,w,_;try{if(g)v=e.provider;else if(b)v=Md(e,{providers:m});else try{v=new yc(e)}catch(e){throw gp("Web3Provider",e),Error("Unsupported provider")}}catch(e){throw new Bs(`Invalid ethProvider: ${e.message}`)}try{w=new Ns((e=>"object"==typeof e&&null!==e?Is(kf.reduce(((e,t)=>({...e,[t]:mp()})),{})).noUnknown(!0).nonNullable().strict(!0):mp())).validateSync(c)}catch(e){throw new Bs(`Invalid smsURL: ${e.message}`)}try{_=If().validateSync(y)}catch(e){throw new Bs(`Invalid defaultTeeFramework: ${e.message}`)}const M=(async()=>{const{chainId:e,name:t,ensAddress:r}=await v.getNetwork().catch((e=>{throw Error(`Failed to detect network: ${e.message}`)}));return{chainId:e,name:t,ensAddress:r}})();M.catch((e=>{gp("networkPromise",e)}));const T=(async()=>{const{chainId:e}=await M;return _d({id:e,flavour:t})})();T.catch((e=>{gp("chainConfDefaultsPromise",e)}));const E=(async()=>{let t,r;const i={...await M,...(await T).network,...n&&{ensAddress:n}};return g?(e.provider&&e.provider.connection&&e.provider.connection.url?r=e.connect(new yh(e.provider.connection.url,i)):(n&&console.warn("IExec: ensRegistryAddress option is not supported when using a default provider"),r=e),t=r.provider):b?t=Md(e,{providers:m,network:i}):(r=new Ad(e,i),t=r.provider),{provider:t,signer:r}})();E.catch((e=>{gp("providerAndSignerPromise",e)}));const A=(async()=>{const{chainId:e}=await M,{provider:n,signer:i}=await E;try{return new df({chainId:e,provider:n,signer:i,hubAddress:r,useGas:s,confirms:o,isNative:a,flavour:t})}catch(e){throw new Bs(`Failed to create contracts client: ${e.message}`)}})();A.catch((e=>{gp("contractsPromise",e)}));const x=(async()=>{const{chainId:e}=await M,{provider:r,signer:n}=await E,i=h.hubAddress||(e=>!!bd[e])(e);if(!i)throw new Bs(`enterpriseSwapConf option not set and no default value for your chain ${e}`);const a="enterprise"===t?"standard":"enterprise",s={..._d({id:e,flavour:a}),...h};try{return new df({chainId:e,provider:r,signer:n,hubAddress:s.hubAddress,confirms:o,isNative:s.isNative,flavour:a})}catch(e){throw new Bs(`Failed to create enterprise swap contracts client: ${e.message}`)}})();x.catch((e=>{gp("enterpriseSwapContractsPromise",e)}));const k=(async()=>{const{chainId:e}=await M,r=await T;if(!(Object.getOwnPropertyNames(l).length>0||r.bridge))throw new Bs(`bridgedNetworkConf option not set and no default value for your chain ${e}`);const n=void 0!==l.chainId?l.chainId:r.bridge&&r.bridge.bridgedChainId;if(!n)throw new Bs(`Missing chainId in bridgedNetworkConf and no default value for your chain ${e}`);const i=_d({id:n,flavour:t}),a=void 0!==l.rpcURL?l.rpcURL:i.host;if(!a)throw new Bs(`Missing rpcURL in bridgedNetworkConf and no default value for bridged chain ${n}`);const s=void 0!==l.bridgeAddress?l.bridgeAddress:i.bridge&&i.bridge.contract;if(!s)throw new Bs(`Missing bridgeAddress in bridgedNetworkConf and no default value for bridged chain ${n}`);const o=await A;return{chainId:n,rpcURL:a,isNative:"standard"===t?!o.isNative:o.isNative,hubAddress:l.hubAddress,bridgeAddress:s,network:i.network}})();k.catch((e=>{gp("bridgedConfPromise",e)}));const S=(async()=>{const e=await k;try{return new df({chainId:e.chainId,provider:Md(e.rpcURL,{providers:m,network:e.network}),hubAddress:e.hubAddress,confirms:o,isNative:e.isNative,flavour:t})}catch(e){throw new Bs(`Failed to create bridged contracts client: ${e.message}`)}})();S.catch((e=>{gp("bridgedContractsPromise",e)})),this.resolveChainId=async()=>(await M).chainId,this.resolveContractsClient=async()=>A,this.resolveBridgedContractsClient=async()=>S,this.resolveStandardContractsClient=async()=>{const e=await A;return"standard"===e.flavour?e:x},this.resolveEnterpriseContractsClient=async()=>{const e=await A;return"enterprise"===e.flavour?e:x},this.resolveSmsURL=async({teeFramework:e=_||eo.SCONE}={})=>{const{chainId:t}=await M,r=await T,n=await If().label("teeFramework").validate(e),i="string"==typeof w&&w||"object"==typeof w&&w[n]||r.sms&&r.sms[n];if(void 0!==i)return i;throw new Bs(`smsURL option not set and no default value for your chain ${t}`)},this.resolveResultProxyURL=async()=>{const{chainId:e}=await M,t=await T,r=d||t.resultProxy;if(void 0!==r)return r;throw new Bs(`resultProxyURL option not set and no default value for your chain ${e}`)},this.resolveIexecGatewayURL=async()=>{const{chainId:e}=await M,t=await T,r=p||t.iexecGateway;if(void 0!==r)return r;throw new Bs(`iexecGatewayURL option not set and no default value for your chain ${e}`)},this.resolveIpfsGatewayURL=async()=>{const{chainId:e}=await M,t=await T,r=f||t.ipfsGateway;if(void 0!==r)return r;throw new Bs(`ipfsGatewayURL option not set and no default value for your chain ${e}`)},this.resolveBridgeAddress=async()=>{const{chainId:e}=await M,t=await T,r=u||t.bridge&&t.bridge.contract;if(void 0!==r)return r;throw new Bs(`bridgeAddress option not set and no default value for your chain ${e}`)},this.resolveBridgeBackAddress=async()=>(await k).bridgeAddress,this.resolveEnsPublicResolverAddress=async()=>{const{chainId:e}=await M,t=await T,r=i||t.ensPublicResolver;if(void 0!==r)return r;throw new Bs(`ensPublicResolverAddress option not set and no default value for your chain ${e}`)}}}class wp{constructor(...e){if(!e[0])throw Error(`${this.constructor.name} requires at least one argument`);e[0]instanceof vp?[this.config]=e:this.config=new vp(...e)}static fromConfig(e){if(!(e instanceof vp))throw Error("fromConfig requires an instance of IExecConfig");return new this.prototype.constructor(e)}}const _p=v("iexec:account:balance"),Mp=async(e=bp(),t=bp())=>{try{const r=await qf({ethProvider:e.provider}).validate(t),n=e.getIExecContract(),{stake:i,locked:a}=await yf(n.viewAccount(r));return{stake:mo(i),locked:mo(a)}}catch(e){throw _p("checkBalance()",e),e}},Tp=async(e=bp())=>{if(!e.signer)throw new Bs("Missing Signer");const t=await yf(e.signer.getAddress());return Mo(t)},Ep=v("iexec:wallet:balance"),Ap=async(e=bp(),t=bp())=>{const r=await qf({ethProvider:e.provider}).validate(t),{isNative:n}=e;if(n){const t=await e.provider.getBalance(r);return vo(mo(t))}const i=await yf(e.fetchTokenContract()),a=await yf(i.balanceOf(r));return mo(a)},xp=async(e=bp(),t=bp())=>{const r=await qf({ethProvider:e.provider}).validate(t),n=await e.provider.getBalance(r);return mo(n)},kp=async(e=bp(),t=bp())=>{try{const r=await qf({ethProvider:e.provider}).validate(t),[n,i]=await Promise.all([xp(e,r),Ap(e,r)]),a={wei:n,nRLC:i};return Ep("balances",a),a}catch(e){throw Ep("checkBalances()",e),e}},Sp=v("iexec:wallet:enterprise"),Ip=async(e=bp(),t=bp(),{strict:r=!0}={})=>{if("enterprise"!==e.flavour)throw Error("Cannot check authorized eRLC holders on current chain");const n=await qf({ethProvider:e.provider}).validate(t);try{const t=await yf(e.fetchTokenContract()),i=await yf(t.isKYC(n));if(!i&&r)throw Error(`${n} is not authorized to interact with eRLC`);return i}catch(e){throw Sp("isInWhitelist()",e),e}},Cp=v("iexec:account:fund");class Op extends wp{constructor(...e){super(...e),this.checkBalance=async e=>Mp(await this.config.resolveContractsClient(),e),this.checkBridgedBalance=async e=>Mp(await this.config.resolveBridgedContractsClient(),e),this.deposit=async e=>(async(e=bp(),t=bp())=>{try{No(e);const r=await Df().validate(t);if(new _(r).lte(new _(0)))throw Error("Deposit amount must be greater than 0");let n;"enterprise"===e.flavour&&await Ip(e,await Tp(e),{strict:!0});const{nRLC:i}=await kp(e,await Tp(e));if(i.lt(new _(r)))throw Error("Deposit amount exceed wallet balance");const a=e.getIExecContract();if(e.isNative){const t=yo(wo(new _(r))).toHexString(),i=await bf(a.deposit({value:t,gasPrice:e.txOptions&&e.txOptions.gasPrice||void 0})),s=await mf(i.wait(e.confirms));if(!ko("Transfer",s.events))throw Error("Deposit not confirmed");n=i.hash}else{const t=await yf(e.fetchTokenContract()),i=await bf(t.approveAndCall(e.hubAddress,r,Zs,e.txOptions)),a=await mf(i.wait(e.confirms));if(!ko("Approval",a.events))throw Error("Approval not confirmed");if(!ko("Transfer",a.events))throw Error("Transfer not confirmed");n=i.hash}return{amount:r,txHash:n}}catch(e){throw Cp("deposit()",e),e}})(await this.config.resolveContractsClient(),e),this.withdraw=async e=>(async(e=bp(),t=bp())=>{try{No(e);const r=await Df().validate(t);if(new _(r).lte(new _(0)))throw Error("Withdraw amount must be greater than 0");"enterprise"===e.flavour&&await Ip(e,await Tp(e),{strict:!0});const n=e.getIExecContract(),{stake:i}=await Mp(e,await Tp(e));if(i.lt(new _(r)))throw Error("Withdraw amount exceed account balance");const a=await bf(n.withdraw(r,e.txOptions)),s=await mf(a.wait(e.confirms));if(!ko("Transfer",s.events))throw Error("Withdraw not confirmed");return{amount:r,txHash:a.hash}}catch(e){throw Cp("withdraw()",e),e}})(await this.config.resolveContractsClient(),e)}}const Rp=v("iexec:protocol:registries"),Np=e=>{const t=e.toHexString().substring(2),r=Js.substring(0,42-t.length).concat(t);return Mo(r)},Pp=(e=bp())=>async(t=bp(),r=bp())=>{try{const n=await yf(t.fetchRegistryContract(e));return await yf(n.isRegistered(r))}catch(e){throw Rp("checkDeployedObj()",e),e}},Bp=async(e=bp(),t=bp())=>Pp(zs)(e,await qf({ethProvider:e.provider}).validate(t)),Dp=async(e=bp(),t=bp())=>Pp(Gs)(e,await qf({ethProvider:e.provider}).validate(t)),Lp=async(e=bp(),t=bp())=>Pp(Ks)(e,await qf({ethProvider:e.provider}).validate(t)),Fp=e=>"".concat(e[0].toUpperCase(),e.substr(1)),Up={[zs]:["owner","name","type","multiaddr","checksum","mrenclave"],[Gs]:["owner","name","multiaddr","checksum"],[Ks]:["owner","description"]},jp=(e=bp())=>async(t=bp(),r=bp())=>{try{const n=await yf(t.fetchRegistryContract(e)),i=Up[e].map((e=>r[e])),a="predict".concat(Fp(e));return await yf(n[a](...i))}catch(e){throw Rp("predictObjAddress()",e),e}},qp=(e=bp())=>async(t=bp(),r=bp())=>{try{No(t);const n=await yf(t.fetchRegistryContract(e)),i=await jp(e)(t,r);if(await Pp(e)(t,i))throw Error(`${Fp(e)} already deployed at address ${i}`);const a=Up[e].map((e=>r[e])),s="create".concat(Fp(e)),o=await bf(n[s](...a,t.txOptions)),u=await mf(o.wait(t.confirms)),l=So("Transfer",u.events,{strict:!0}),{tokenId:h}=l.args;return{address:Np(h),txHash:u.transactionHash}}catch(e){throw Rp("deployObj()",e),e}},zp=(e=bp())=>async(t=bp(),r=bp())=>{try{const n=t.getContract(e,r);return Mo(await yf(n.owner()))}catch(e){throw Rp("getObjOwner()",e),e}},Gp=async(e=bp(),t=bp())=>zp(zs)(e,await qf({ethProvider:e.provider}).validate(t)),Kp=async(e=bp(),t=bp())=>zp(Gs)(e,await qf({ethProvider:e.provider}).validate(t)),Hp=async(e=bp(),t=bp())=>zp(Ks)(e,await qf({ethProvider:e.provider}).validate(t)),$p=(e=bp())=>async(t=bp(),r=bp())=>{try{const n=await qf({ethProvider:t.provider}).validate(r);if(!await Pp(e)(t,r))throw new js(e,r,t.chainId);const i=t.getContract(e,n),a=Object.values(i.interface.functions).filter((e=>e.constant)).map((e=>e.name)),s=(await Promise.all(a.map((e=>yf(i[e]()))))).reduce(((e,t,r)=>({...e,[a[r]]:t})),{});return{obj:_o(s),objAddress:n}}catch(e){throw Rp("showObjByAddress()",e),e}},Vp=(e=bp())=>async(t=bp(),r=bp())=>{try{const n=await qf({ethProvider:t.provider}).validate(r),i=await yf(t.fetchRegistryContract(e)),a=await yf(i.balanceOf(n));return mo(a)}catch(e){throw Rp("countObj()",e),e}},Wp=(e=bp())=>async(t=bp(),r=bp(),n=bp())=>{try{const i=await Pf().validate(r),a=await qf({ethProvider:t.provider}).validate(n),s=await Vp(e)(t,n);if(new so(i).gte(s))throw Error(`${e} not deployed`);const o=await yf(t.fetchRegistryContract(e)),u=await yf(o.tokenOfOwnerByIndex(a,i)),l=Np(u);return $p(e)(t,l)}catch(e){throw Rp("showObjByIndex()",e),e}},Zp=e=>Object.entries(e).reduce(((e,t)=>{const r="m_"===t[0].substr(0,2)?t[0].split("m_")[1]:t[0];return Object.assign(e,{[r]:t[1]})}),{}),Jp=e=>Object.assign(Zp(e),e.m_appMultiaddr&&{appMultiaddr:Ao(e.m_appMultiaddr)},e.m_appMREnclave&&{appMREnclave:Eo(e.m_appMREnclave).toString()}),Yp=async(e=bp(),t=bp())=>{const{obj:r,objAddress:n}=await $p(zs)(e,await qf({ethProvider:e.provider}).validate(t));return{objAddress:n,app:Jp(r)}},Xp=async(e,{strict:t=!0}={})=>{if(e.appMREnclave)try{return(await up().validate(e.appMREnclave)).framework}catch(e){if(Rp("resolveTeeFrameworkFromApp()",e),t)throw Error("Failed to resolve TEE framework from app")}};var Qp=i(4098),ey=i.t(Qp,2);const ty="%[a-f0-9]{2}",ry=new RegExp("("+ty+")|([^%]+?)","gi"),ny=new RegExp("("+ty+")+","gi");function iy(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(1===e.length)return e;t=t||1;const r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],iy(r),iy(n))}function ay(e){try{return decodeURIComponent(e)}catch{let t=e.match(ry)||[];for(let r=1;r<t.length;r++)t=(e=iy(t,r).join("")).match(ry)||[];return e}}function sy(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===e||""===t)return[];const r=e.indexOf(t);return-1===r?[]:[e.slice(0,r),e.slice(r+t.length)]}function oy(e,t){const r={};if(Array.isArray(t))for(const n of t){const t=Object.getOwnPropertyDescriptor(e,n);t?.enumerable&&Object.defineProperty(r,n,t)}else for(const n of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,n);i.enumerable&&t(n,e[n],e)&&Object.defineProperty(r,n,i)}return r}const uy=e=>null==e,ly=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),hy=Symbol("encodeFragmentIdentifier");function cy(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function dy(e,t){return t.encode?t.strict?ly(e):encodeURIComponent(e):e}function fy(e,t){return t.decode?function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return function(e){const t={"%FE%FF":"��","%FF%FE":"��"};let r=ny.exec(e);for(;r;){try{t[r[0]]=decodeURIComponent(r[0])}catch{const e=ay(r[0]);e!==r[0]&&(t[r[0]]=e)}r=ny.exec(e)}t["%C2"]="�";const n=Object.keys(t);for(const r of n)e=e.replace(new RegExp(r,"g"),t[r]);return e}(e)}}(e):e}function py(e){return Array.isArray(e)?e.sort():"object"==typeof e?py(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function yy(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function my(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function by(e){const t=(e=yy(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function gy(e,t){cy((t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t}).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[])$/.exec(e),e=e.replace(/\[]$/,""),t?void 0!==n[e]?n[e]=[...n[e],r]:n[e]=[r]:n[e]=r};case"colon-list-separator":return(e,r,n)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==n[e]?n[e]=[...n[e],r]:n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const i="string"==typeof r&&r.includes(e.arrayFormatSeparator),a="string"==typeof r&&!i&&fy(r,e).includes(e.arrayFormatSeparator);r=a?fy(r,e):r;const s=i||a?r.split(e.arrayFormatSeparator).map((t=>fy(t,e))):null===r?r:fy(r,e);n[t]=s};case"bracket-separator":return(t,r,n)=>{const i=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!i)return void(n[t]=r?fy(r,e):r);const a=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>fy(t,e)));void 0!==n[t]?n[t]=[...n[t],...a]:n[t]=a};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[...[r[e]].flat(),t]:r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const i of e.split("&")){if(""===i)continue;const e=t.decode?i.replace(/\+/g," "):i;let[a,s]=sy(e,"=");void 0===a&&(a=e),s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:fy(s,t),r(fy(a,t),s,n)}for(const[e,r]of Object.entries(n))if("object"==typeof r&&null!==r)for(const[e,n]of Object.entries(r))r[e]=my(n,t);else n[e]=my(r,t);return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce(((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=py(r):e[t]=r,e}),Object.create(null))}function vy(e,t){if(!e)return"";cy((t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t}).arrayFormatSeparator);const r=r=>t.skipNull&&uy(e[r])||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[dy(t,e),"[",i,"]"].join("")]:[...r,[dy(t,e),"[",dy(i,e),"]=",dy(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[dy(t,e),"[]"].join("")]:[...r,[dy(t,e),"[]=",dy(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[dy(t,e),":list="].join("")]:[...r,[dy(t,e),":list=",dy(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length?[[dy(r,e),t,dy(i,e)].join("")]:[[n,dy(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,dy(t,e)]:[...r,[dy(t,e),"=",dy(n,e)].join("")]}}(t),i={};for(const[t,n]of Object.entries(e))r(t)||(i[t]=n);const a=Object.keys(i);return!1!==t.sort&&a.sort(t.sort),a.map((r=>{const i=e[r];return void 0===i?"":null===i?dy(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?dy(r,t)+"[]":i.reduce(n(r),[]).join("&"):dy(r,t)+"="+dy(i,t)})).filter((e=>e.length>0)).join("&")}function wy(e,t){t={decode:!0,...t};let[r,n]=sy(e,"#");return void 0===r&&(r=e),{url:r?.split("?")?.[0]??"",query:gy(by(e),t),...t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:fy(n,t)}:{}}}function _y(e,t){t={encode:!0,strict:!0,[hy]:!0,...t};const r=yy(e.url).split("?")[0]||"";let n=vy({...gy(by(e.url),{sort:!1}),...e.query},t);n&&(n=`?${n}`);let i=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);if(e.fragmentIdentifier){const n=new URL(r);n.hash=e.fragmentIdentifier,i=t[hy]?n.hash:`#${e.fragmentIdentifier}`}return`${r}${n}${i}`}function My(e,t,r){r={parseFragmentIdentifier:!0,[hy]:!1,...r};const{url:n,query:i,fragmentIdentifier:a}=wy(e,r);return _y({url:n,query:oy(i,t),fragmentIdentifier:a},r)}function Ty(e,t,r){const n=Array.isArray(t)?e=>!t.includes(e):(e,r)=>!t(e,r);return My(e,n,r)}const Ey=g,Ay=v("iexec:sig-utils"),xy=e=>{try{const{domain:t,message:r}=e,{EIP712Domain:n,...i}=e.types;return gl.hash(t,i,r)}catch(e){throw Ay("hashEIP712()",e),e}},ky=v("iexec:api-utils"),Sy=(e,t)=>"POST"===e||"PUT"===e?"object"==typeof t?{body:JSON.stringify(t)}:{body:t}:{},Iy=(e,t,r)=>{const n={};return"POST"!==e&&"PUT"!==e||(n["Content-Type"]="object"==typeof r?"application/json":"text/plain"),{headers:{...n,...t}}},Cy=e=>async({api:t,endpoint:r="",query:n={},body:i={},headers:a={}})=>{ky("httpRequest()","\nmethod",e,"\napi",t,"\nendpoint",r,"\nquery",n,"\nbody",i,"\nheaders",a);const s=new URL(r,t).href,o=(u=n,0!==Object.keys(u).length?"?".concat(Ey.stringify(u)):"");var u;const l=s.concat(o);return Qp(l,{method:e,...Iy(e,a,i),...Sy(e,i)}).catch((e=>{throw ky("httpRequest() fetch:",e),Error(`Connection to ${s} failed with a network error`)}))},Oy=e=>{if(!e.ok)throw Error(`API call error: ${e.status} ${e.statusText?e.statusText:""}`);return e},Ry=async e=>{const t=e.headers.get("Content-Type");if(t&&-1!==t.indexOf("application/json")){if(e.ok)return e.json();const t=await e.json().then((e=>e&&e.error)).catch((()=>{}));if(t)throw new Error(`API error: ${t}`);throw Error(`API error: ${e.status} ${e.statusText?e.statusText:""}`)}if(!e.ok)throw Error(`API error: ${e.status} ${e.statusText?e.statusText:""}`);throw new Error("The http response is not of JSON type")},Ny=e=>async t=>e(t).then((({nextPage:r,...n})=>({...n,...r&&{more:()=>Ny(e)({...t,query:{...t.query,page:r}})}}))),Py=e=>Cy("GET")({...e,headers:{Accept:"application/json",...e.headers}}).then(Ry),By=(e,t="/challenge")=>async(r,n,i)=>{try{const a=await Py({api:e,endpoint:t,query:{chainId:r,address:n}}),s=a.data||a,{domain:o,message:u}=s||{},{EIP712Domain:l,...h}=s.types||{};if(!o||!h||!u)throw Error("Unexpected challenge format");const c=await vf(i._signTypedData&&"function"==typeof i._signTypedData?i._signTypedData(o,h,u):i.signTypedData(o,h,u)),d=xy(s),f="_";return d.concat(f).concat(c).concat(f).concat(n)}catch(e){throw ky("getAuthorization()",e),Error(`Failed to get authorization: ${e}`)}},Dy=v("iexec:sms:check"),Ly=async(e=bp(),t=bp(),r=bp())=>{try{const n=await qf({ethProvider:e.provider}).validate(r),i=await Cy("HEAD")({api:t,endpoint:"/secrets/web3",query:{secretAddress:n}}).catch((e=>{throw Dy(e),Error(`SMS at ${t} didn't answered`)}));if(i.ok)return!0;if(404===i.status)return!1;throw Error(`SMS answered with unexpected status: ${i.status} ${i.statusText}`)}catch(e){throw Dy("checkWeb3SecretExists()",e),e}},Fy=async(e=bp(),t=bp(),r=bp(),n=bp())=>{try{const i=await qf({ethProvider:e.provider}).validate(r),a=await Cy("HEAD")({api:t,endpoint:"/secrets/web2",query:{ownerAddress:i,secretName:n}}).catch((e=>{throw Dy(e),Error(`SMS at ${t} didn't answered`)}));if(a.ok)return!0;if(404===a.status)return!1;throw Error(`SMS answered with unexpected status: ${a.status} ${a.statusText}`)}catch(e){throw Dy("checkWeb2SecretExists()",e),e}},Uy=async(e=bp(),t=bp(),r=bp(),n=bp())=>{try{const i=await qf({ethProvider:e.provider}).validate(r),a=await Cy("HEAD")({api:t,endpoint:`/requesters/${i}/secrets/${n}`}).catch((e=>{throw Dy(e),Error(`SMS at ${t} didn't answered`)}));if(a.ok)return!0;if(404===a.status)return!1;throw Error(`SMS answered with unexpected status: ${a.status} ${a.statusText}`)}catch(e){throw Dy("checkRequesterSecretExists()",e),e}},{keccak256:jy,arrayify:qy}=e,zy=v("iexec:sms"),Gy="IEXEC_SMS_DOMAIN",Ky=(...e)=>{const t=w.Buffer.concat(e.map((e=>w.Buffer.from(qy(e)))));return jy(t)},Hy=(e,t,r)=>Ky(jy(w.Buffer.from(Gy,"utf8")),e,jy(w.Buffer.from(t,"utf8")),jy(w.Buffer.from(r,"utf8"))),$y=({response:e,signerAddress:t,targetAddress:r})=>{if(e.ok)return!0;if(409===e.status)throw Error(`Secret already exists for ${r} and can't be updated`);if(401===e.status)throw Error(`Wallet ${t} is not allowed to set secret for ${r}`);throw Error(`SMS answered with unexpected status: ${e.status} ${e.statusText}`)},Vy=async(e=bp(),t=bp(),r=bp(),n=bp(),{forceUpdate:i=!1}={})=>{try{No(e);const a=await Tp(e);await Sf().validate(r,{strict:!0}),await Sf().validate(n,{strict:!0});const s=await Fy(e,t,a,r);if(s&&!i)throw Error(`Secret "${r}" already exists for ${a}`);const o=!!s,u=Hy(a,r,n),l=qy(u),h=await wf(e.signer.signMessage(l)),c=await Cy(o?"PUT":"POST")({api:t,endpoint:"/secrets/web2",query:{ownerAddress:a,secretName:r},body:n,headers:{Authorization:h}}).catch((e=>{throw zy(e),Error(`SMS at ${t} didn't answered`)}));if(c.ok)return{isPushed:!0,isUpdated:o};throw Error(`SMS answered with unexpected status: ${c.status} ${c.statusText}`)}catch(e){throw zy("pushWeb2Secret()",e),e}};class Wy extends wp{constructor(...e){super(...e),this.deployApp=async e=>(async(e,t)=>qp(zs)(e,await lp({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),e),this.showApp=async e=>Yp(await this.config.resolveContractsClient(),e),this.showUserApp=async(e,t)=>(async(e=bp(),t=bp(),r=bp())=>{const{obj:n,objAddress:i}=await Wp(zs)(e,await Pf().validate(t),await qf({ethProvider:e.provider}).validate(r));return{objAddress:i,app:Jp(n)}})(await this.config.resolveContractsClient(),e,t),this.countUserApps=async e=>(async(e=bp(),t=bp())=>Vp(zs)(e,await qf({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),e),this.checkAppSecretExists=async(e,{teeFramework:t}={})=>{let r=t;if(void 0===r){const{app:t}=await Yp(await this.config.resolveContractsClient(),e);r=await Xp(t)}return(async(e=bp(),t=bp(),r=bp(),n=1)=>{try{const i=await qf({ethProvider:e.provider}).validate(r),a=await Rf().validate(n),s=await Cy("HEAD")({api:t,endpoint:`/apps/${i}/secrets/${a}`}).catch((e=>{throw Dy(e),Error(`SMS at ${t} didn't answered`)}));if(s.ok)return!0;if(404===s.status)return!1;throw Error(`SMS answered with unexpected status: ${s.status} ${s.statusText}`)}catch(e){throw Dy("checkRequesterSecretExists()",e),e}})(await this.config.resolveContractsClient(),await this.config.resolveSmsURL({teeFramework:r}),e)},this.pushAppSecret=async(e,t,{teeFramework:r}={})=>{let n=r;if(void 0===n){const{app:t}=await Yp(await this.config.resolveContractsClient(),e);n=await Xp(t)}return(async(e=bp(),t=bp(),r=bp(),n=bp(),i=1)=>{try{No(e);const a=await Tp(e),s=await qf({ethProvider:e.provider}).validate(r),o=await Rf().validate(i);await Sf().validate(n,{strict:!0});const u=Hy(s,o.toString(),n),l=qy(u),h=await wf(e.signer.signMessage(l)),c=await Cy("POST")({api:t,endpoint:`/apps/${s}/secrets/${o}`,body:n,headers:{Authorization:h}}).catch((e=>{throw zy(e),Error(`SMS at ${t} didn't answered`)}));return $y({response:c,signerAddress:a,targetAddress:s})}catch(e){throw zy("pushAppSecret()",e),e}})(await this.config.resolveContractsClient(),await this.config.resolveSmsURL({teeFramework:n}),e,t)},this.predictAppAddress=async e=>(async(e,t)=>jp(zs)(e,await lp({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),e),this.checkDeployedApp=async e=>Bp(await this.config.resolveContractsClient(),e)}}const{randomBytes:Zy,sha256:Jy}=e;class Yy extends wp{constructor(...e){super(...e),this.generateEncryptionKey=()=>w.Buffer.from(Zy(32)).toString("base64"),this.encrypt=(e,t)=>(async(e=bp(),t=bp())=>{const r=w.Buffer.from(await ys().test("is-base64-256bits-key","${originalValue} is not a valid encryption key (must be base64 encoded 256 bits key)",(async e=>{try{if(32!==w.Buffer.from(e,"base64").length)throw Error("Invalid key length");return!0}catch(e){return Ef("is-base64-256bits-key",e),!1}})).validate(t),"base64"),n=await dp().validate(e),i=w.Buffer.from(Zy(16)),a=new T.ModeOfOperation.cbc(r,i),s=16-n.length%16,o=w.Buffer.alloc(s,s),u=w.Buffer.concat([n,o]),l=w.Buffer.from(a.encrypt(u));return w.Buffer.concat([i,l])})(e,t),this.computeEncryptedFileChecksum=e=>(async(e=bp())=>{const t=await dp().validate(e);return Jy(t)})(e),this.deployDataset=async e=>(async(e,t)=>qp(Gs)(e,await hp({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),e),this.showDataset=async e=>(async(e=bp(),t=bp())=>{const{obj:r,objAddress:n}=await $p(Gs)(e,await qf({ethProvider:e.provider}).validate(t));return{objAddress:n,dataset:Object.assign(Zp(r),r.m_datasetMultiaddr&&{datasetMultiaddr:Ao(r.m_datasetMultiaddr)})}})(await this.config.resolveContractsClient(),e),this.showUserDataset=async(e,t)=>(async(e=bp(),t=bp(),r=bp())=>{const{obj:n,objAddress:i}=await Wp(Gs)(e,await Pf().validate(t),await qf({ethProvider:e.provider}).validate(r));return{objAddress:i,dataset:Object.assign(Zp(n),n.m_datasetMultiaddr&&{datasetMultiaddr:Ao(n.m_datasetMultiaddr)})}})(await this.config.resolveContractsClient(),e,t),this.countUserDatasets=async e=>(async(e=bp(),t=bp())=>Vp(Gs)(e,await qf({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),e),this.checkDatasetSecretExists=async(e,{teeFramework:t}={})=>Ly(await this.config.resolveContractsClient(),await this.config.resolveSmsURL({teeFramework:t}),e),this.pushDatasetSecret=async(e,t,{teeFramework:r}={})=>(async(e=bp(),t=bp(),r=bp(),n=bp())=>{try{No(e);const i=await qf({ethProvider:e.provider}).validate(r),a=await Tp(e);await Sf().validate(n,{strict:!0});const s=((e,t)=>Ky(jy(w.Buffer.from(Gy,"utf8")),e,jy(w.Buffer.from(t,"utf8"))))(i,n),o=qy(s),u=await wf(e.signer.signMessage(o)),l=await Cy("POST")({api:t,endpoint:"/secrets/web3",query:{secretAddress:i},body:n,headers:{Authorization:u}}).catch((e=>{throw zy(e),Error(`SMS at ${t} didn't answered`)}));return $y({response:l,signerAddress:a,targetAddress:i})}catch(e){throw zy("pushWeb3Secret()",e),e}})(await this.config.resolveContractsClient(),await this.config.resolveSmsURL({teeFramework:r}),e,t),this.predictDatasetAddress=async e=>(async(e,t)=>jp(Gs)(e,await hp({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),e),this.checkDeployedDataset=async e=>Dp(await this.config.resolveContractsClient(),e)}}const Xy=v("iexec:protocol:category"),Qy=async(e=bp(),t=bp())=>{try{const r=await Pf().validate(t),n=e.getIExecContract(),i=await yf(n.viewCategory(r)),a=["name","description","workClockTimeRef"],s=i.reduce(((e,t,r)=>Object.assign(e,{[a[r]]:t})),{});return _o(s)}catch(e){throw Xy("showCategory()",e),e}},em=v("iexec:protocol:configuration"),tm=async(e=bp())=>{try{return mo(await yf(e.getIExecContract().final_deadline_ratio()))}catch(e){throw em("getTimeoutRatio()",e),e}},rm=v("iexec:execution:common"),nm=async(e=bp(),t=bp())=>{try{const r=await Gf().validate(t),{chainId:n}=e,i=e.getIExecContract(),a=_o(xo(await yf(i.viewDeal(r))));if(!(a&&a.app&&a.app.pointer&&a.app.pointer!==Js))throw new js("deal",t,n);return a}catch(e){throw rm("viewDeal()",e),e}},im=async(e=bp(),t=bp(),{strict:r=!0}={})=>{try{const n=await Gf().validate(t),{chainId:i}=e,a=e.getIExecContract(),s=_o(xo(await yf(a.viewTask(n))));if(s.dealid===Ys&&r)throw new js("task",n,i);return s}catch(e){throw rm("viewTask()",e),e}};class am{constructor(e){this.destination=e}next(e){if(!this.isUnsubscribed&&this.destination.next)try{this.destination.next(e)}catch(e){throw this.unsubscribe(),e}}error(e){if(!this.isUnsubscribed&&this.destination.error){try{this.destination.error(e)}catch(e){throw this.unsubscribe(),e}this.unsubscribe()}}complete(){if(!this.isUnsubscribed&&this.destination.complete){try{this.destination.complete()}catch(e){throw this.unsubscribe(),e}this.unsubscribe()}}unsubscribe(){this.isUnsubscribed=!0,this.unsub&&this.unsub()}}class sm{constructor(e){this._subscribe=e}subscribe(e){const t=new am(e);return this._subscribe(t)}}const om=v("iexec:execution:task"),um={0:"UNSET",1:"ACTIVE",2:"REVEALING",3:"COMPLETED",4:"FAILED",timeout:"TIMEOUT"},lm=async(e=bp(),t=bp())=>{try{const r=await Gf().validate(t),n=await im(e,r),i=Math.floor(Date.now()/1e3),a=parseInt(n.finalDeadline,10),s=3!==n.status&&i>=a,o=(e=>{try{if(e!==Zs)return JSON.parse(w.Buffer.from(e.substr(2),"hex").toString("utf8"))}catch(e){}return{storage:"none"}})(n.results);return{taskid:r,...n,statusName:n.status<3&&s?um.timeout:um[n.status],taskTimedOut:s,results:o}}catch(e){throw om("show()",e),e}},hm=(e=bp(),t=bp(),{dealid:r}={})=>new sm((n=>{const i=new am(n);let a,s,o=!1;const u=async n=>{const i=await Gf().validate(r);if(n instanceof js&&i){const r=await Gf().validate(t),n=await nm(e,i),[{workClockTimeRef:a},s]=await Promise.all([Qy(e,n.category),tm(e)]),o=n.startTime.add(s.mul(a)),u=Math.floor(Date.now()/1e3)>=o.toNumber();return{taskid:r,dealid:i,status:0,statusName:u?um.timeout:um[0],taskTimedOut:u}}throw n},l=async()=>{try{const r=await Gf().validate(t),n=await lm(e,r).catch(u);if(!a||n.status!==a.status||n.taskTimedOut){if(a=n,3===a.status)return i.next({message:"TASK_COMPLETED",task:a}),void i.complete();if(4===a.status)return i.next({message:"TASK_FAILED",task:a}),void i.complete();if(a.taskTimedOut)return i.next({message:"TASK_TIMEDOUT",task:a}),void i.complete();i.next({message:"TASK_UPDATED",task:a})}}catch(e){i.error(e)}};return l().then((()=>{o||(({status:e,taskTimedOut:t}={})=>t||3===e||4===e)(a)||(s=setInterval(l,5e3))})),i.unsub=()=>{o=!0,s&&clearInterval(s)},i.unsubscribe.bind(i)})),{defaultAbiCoder:cm,keccak256:dm}=e,fm=v("iexec:execution:deal"),pm=async(e=bp(),t=bp())=>{try{const r=["bytes32","uint256"],n=[await Gf().validate(e),await Pf().validate(t)],i=cm.encode(r,n);return dm(i)}catch(e){throw fm("computeTaskId()",e),e}},ym=async(e=bp(),t=bp())=>{try{const r=await Gf().validate(t),n=await nm(e,t),[{workClockTimeRef:i},a]=await Promise.all([Qy(e,n.category),tm(e)]),s=n.startTime.add(a.mul(i)),o=Math.floor(Date.now()/1e3)>=s.toNumber(),u=await(async(e=bp(),t=bp(),r=bp())=>{const n=await Gf().validate(e),i=await Rf().validate(t),a=await Nf().validate(r),s=[...Array(a).keys()].map((e=>e+i));return Promise.all(s.map((e=>pm(n,e))))})(t,n.botFirst.toString(),n.botSize.toString());return{dealid:r,...n,finalTime:s,deadlineReached:o,tasks:u}}catch(e){throw fm("show()",e),e}},mm=e=>(t,r)=>parseInt(t[e],10)>parseInt(r[e],10)?1:-1,bm={[Hs]:"apporderHash",[$s]:"datasetorderHash",[Vs]:"workerpoolorderHash",[Ws]:"requestorderHash"},gm=async(e=bp(),t=bp(),r=bp(),n=bp())=>{try{const i=await Lf().validate(r),a=await Gf().validate(n),s={chainId:i,[bm[t]]:a},o=await Py({api:e,endpoint:"/deals",query:s});if(o.ok&&o.deals)return{count:o.count,deals:o.deals};throw Error("An error occurred while getting deals")}catch(e){throw fm("fetchDealsByOrderHash()",e),e}};class vm extends wp{constructor(...e){super(...e),this.show=async e=>ym(await this.config.resolveContractsClient(),e),this.obsDeal=async e=>((e=bp(),t=bp())=>new sm((r=>{const n=new am(r);let i=[];return n.unsub=()=>{i.forEach((e=>e()))},(async()=>{try{const r=await ym(e,t),a=Object.entries(r.tasks).reduce(((e,[t,r])=>(e[t]={idx:t,taskid:r},e)),{}),s=()=>{const e={...a},t=Object.values(e);if(!t.find((({status:e})=>void 0===e))){let i=!1;const a=t.length,s=t.filter((e=>3===e.status)).length,o=t.filter((e=>!0===e.taskTimedOut)).length;let u;s===a?(u="DEAL_COMPLETED",i=!0):s+o===a?(u="DEAL_TIMEDOUT",i=!0):u="DEAL_UPDATED",n.next({message:u,tasksCount:a,completedTasksCount:s,failedTasksCount:o,deal:{...r},tasks:e}),i&&n.complete()}};i=Object.entries(a).map((([r,{taskid:o}])=>hm(e,o,{dealid:t}).subscribe({next:({task:e})=>{a[r]={...a[r],...e},s()},error:e=>{n.error(e),i.forEach((e=>e()))}})))}catch(e){n.error(e)}})(),n.unsubscribe.bind(n)})))(await this.config.resolveContractsClient(),e),this.computeTaskId=(e,t)=>pm(e,t),this.fetchRequesterDeals=async(e,{appAddress:t,datasetAddress:r,workerpoolAddress:n}={})=>(async(e=bp(),t=bp(),r=bp(),{appAddress:n,datasetAddress:i,workerpoolAddress:a}={})=>{try{const s=await qf({ethProvider:e.provider}).validate(r),o=await Lf().validate(e.chainId);let u,l,h;n&&(u=await qf({ethProvider:e.provider}).validate(n)),i&&(l=await qf({ethProvider:e.provider}).validate(i)),a&&(h=await qf({ethProvider:e.provider}).validate(a));const c={chainId:o,requester:s,...n&&{app:u},...i&&{dataset:l},...a&&{workerpool:h}},d=await Ny(Py)({api:t,endpoint:"/deals",query:c});if(d.ok&&d.deals)return d;throw Error("An error occured while getting deals")}catch(e){throw fm("fetchRequesterDeals()",e),e}})(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e,{appAddress:t,datasetAddress:r,workerpoolAddress:n}),this.claim=async e=>(async(e=bp(),t=bp())=>{const r=[],n={};try{No(e);const i=await Gf().validate(t),a=await ym(e,i);if(!a.deadlineReached)throw Error(`Cannot claim a deal before reaching the final time: ${new Date(1e3*a.finalTime)}`);const{tasks:s}=a,o=[],u=[];if(await Promise.all(Object.entries(s).map((async([t,r])=>{const n=await im(e,r,{strict:!1}),i=new so(n.status).toNumber();0===i?u.push({idx:t,taskid:r}):i<3&&o.push({idx:t,taskid:r})}))),0===o.length&&0===u.length)throw Error("Nothing to claim");o.sort(mm("idx")),u.sort(mm("idx"));const l=await yf(e.provider.getBlock("latest")),h=mo(l.gasLimit);fm("blockGasLimit",h.toString());const c=e.getIExecContract();if(o.length>0){const t=new so(55e3),i=h.div(t),a=async()=>{if(!o.length)return;const t=o.splice(0,i.toNumber()),s=t.map((({taskid:e})=>e)),u=await bf(c.claimArray(s,e.txOptions));fm(`claimArray ${u.hash} (${t.length} tasks)`),await mf(u.wait(e.confirms)),r.push({txHash:u.hash,type:"claimArray"}),Object.assign(n,...t.map((e=>({[e.idx]:e.taskid})))),await a()};await a()}if(u.length>0){const t=new so(25e4),a=h.div(t),s=async()=>{if(!u.length)return;const t=u.splice(0,a.toNumber()),o=t.map((({idx:e})=>e)),l=new Array(o.length).fill(i),h=await bf(c.initializeAndClaimArray(l,o,e.txOptions));fm(`initializeAndClaimArray ${h.hash} (${t.length} tasks)`),await mf(h.wait(e.confirms)),r.push({txHash:h.hash,type:"initializeAndClaimArray"}),Object.assign(n,...t.map((e=>({[e.idx]:e.taskid})))),await s()};await s()}return{transactions:r,claimed:n}}catch(e){throw fm("claim()",e),e}})(await this.config.resolveContractsClient(),e),this.fetchDealsByApporder=async e=>gm(await this.config.resolveIexecGatewayURL(),Hs,await this.config.resolveChainId(),e),this.fetchDealsByDatasetorder=async e=>gm(await this.config.resolveIexecGatewayURL(),$s,await this.config.resolveChainId(),e),this.fetchDealsByWorkerpoolorder=async e=>gm(await this.config.resolveIexecGatewayURL(),Vs,await this.config.resolveChainId(),e),this.fetchDealsByRequestorder=async e=>gm(await this.config.resolveIexecGatewayURL(),Ws,await this.config.resolveChainId(),e)}}const wm=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"label",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"NewOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"resolver",type:"address"}],name:"NewResolver",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint64",name:"ttl",type:"uint64"}],name:"NewTTL",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"recordExists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"resolver",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"owner",type:"address"}],name:"setOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setRecord",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"resolver",type:"address"}],name:"setResolver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"label",type:"bytes32"},{internalType:"address",name:"owner",type:"address"}],name:"setSubnodeOwner",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"label",type:"bytes32"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setSubnodeRecord",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setTTL",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"ttl",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"}],_m=v("iexec:ens:registry"),Mm=async(e=bp())=>{try{const{ensAddress:t}=await yf(e.provider.getNetwork());if(!t)throw new Bs("Network does not support ENS");return t}catch(e){throw _m("getEnsRegistryAddress()",e),e}},Tm=async(e=bp())=>{try{await Mm(e)}catch(e){throw _m("checkEns()",e),e}},Em=v("iexec:ens:resolution"),Am=async(e=bp(),t=bp())=>{try{const r=br(await fp().validate(t)),n=await Mm(e),i=new Vd(n,wm,e.provider);return await yf(i.owner(r))}catch(e){throw Em("getOwner()",e),e}},xm=async(e=bp(),t=bp())=>{try{const r=await qf({ethProvider:e.provider}).validate(t);return await Tm(e),await yf(e.provider.lookupAddress(r))}catch(e){throw Em("lookupAddress()",e),e}},km=[{inputs:[],name:"registry",outputs:[{internalType:"contract IRegistry",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_ens",type:"address"},{internalType:"string",name:"_name",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"}],Sm=[{inputs:[{internalType:"contract ENS",name:"ensAddr",type:"address"},{internalType:"bytes32",name:"node",type:"bytes32"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"bytes32",name:"label",type:"bytes32"},{internalType:"address",name:"owner",type:"address"}],name:"register",outputs:[],stateMutability:"nonpayable",type:"function"}],Im=[{inputs:[{internalType:"contract ENS",name:"ensAddr",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"controller",type:"address"},{indexed:!1,internalType:"bool",name:"enabled",type:"bool"}],name:"ControllerChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"contract NameResolver",name:"resolver",type:"address"}],name:"DefaultResolverChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"addr",type:"address"},{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"}],name:"ReverseClaimed",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"claim",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"}],name:"claimForAddr",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"}],name:"claimWithResolver",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"controllers",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"defaultResolver",outputs:[{internalType:"contract NameResolver",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"ens",outputs:[{internalType:"contract ENS",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"node",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"controller",type:"address"},{internalType:"bool",name:"enabled",type:"bool"}],name:"setController",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"resolver",type:"address"}],name:"setDefaultResolver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"name",type:"string"}],name:"setName",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"string",name:"name",type:"string"}],name:"setNameForAddr",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],Cm=[{inputs:[{internalType:"contract ENS",name:"_ens",type:"address"},{internalType:"contract INameWrapper",name:"wrapperAddress",type:"address"},{internalType:"address",name:"_trustedETHController",type:"address"},{internalType:"address",name:"_trustedReverseRegistrar",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"uint256",name:"contentType",type:"uint256"}],name:"ABIChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"address",name:"delegate",type:"address"},{indexed:!0,internalType:"bool",name:"approved",type:"bool"}],name:"Approved",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"},{indexed:!1,internalType:"bytes",name:"record",type:"bytes"}],name:"DNSRecordChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"}],name:"DNSRecordDeleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"lastzonehash",type:"bytes"},{indexed:!1,internalType:"bytes",name:"zonehash",type:"bytes"}],name:"DNSZonehashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"},{indexed:!1,internalType:"string",name:"value",type:"string"}],name:"TextChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint64",name:"newVersion",type:"uint64"}],name:"VersionChanged",type:"event"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address payable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"delegate",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"clearRecords",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint16",name:"resource",type:"uint16"}],name:"dnsRecord",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],name:"hasDNSRecords",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"delegate",type:"address"}],name:"isApprovedFor",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicall",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"nodehash",type:"bytes32"},{internalType:"bytes[]",name:"data",type:"bytes[]"}],name:"multicallWithNodeCheck",outputs:[{internalType:"bytes[]",name:"results",type:"bytes[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"recordVersions",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentType",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setABI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"},{internalType:"bytes",name:"a",type:"bytes"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"hash",type:"bytes"}],name:"setContenthash",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"data",type:"bytes"}],name:"setDNSRecords",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"},{internalType:"address",name:"implementer",type:"address"}],name:"setInterface",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"newName",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],name:"setPubkey",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"},{internalType:"string",name:"value",type:"string"}],name:"setText",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes",name:"hash",type:"bytes"}],name:"setZonehash",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"zonehash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"}],Om=v("iexec:ens:registration"),Rm={[zs]:"apps.iexec.eth",[Gs]:"datasets.iexec.eth",[Ks]:"pools.iexec.eth",default:"users.iexec.eth"},Nm="SET_RESOLVER_TX_SENT",Pm="SET_ADDR_TX_SENT",Bm="SET_NAME_TX_REQUEST",Dm="SET_NAME_TX_SENT",Lm=(e=bp(),t=bp(),r=bp(),n)=>new sm((i=>{const a=new am(i);let s=!1;return(async()=>{try{No(e);const i=void 0!==n?await qf({ethProvider:e.provider}).validate(n):await Tp(e),o=await fp().validate(r),u=br(o),l=await Tp(e),h=await Mm(e),c="addr.reverse";let d=!1;if(i!==l){if("0x"===await yf(e.provider.getCode(i)))throw Error(`Target address ${i} is not a contract and don't match current wallet address ${l}, impossible to setup ENS resolution`);d=!0}if((await Am(e,o)).toLowerCase()!==l.toLowerCase())throw Error(`The current address ${l} is not owner of ${o}`);if(d){const t=new Vd(i,km,e.signer),r=await yf(t.owner());if(!r||r.toLowerCase()!==l.toLowerCase())throw Error(`${l} is not the owner of ${i}, impossible to setup ENS resolution`)}if(s)return;if(a.next({message:"DESCRIBE_WORKFLOW",addessType:d?"CONTRACT":"EAO",steps:["SET_RESOLVER","SET_ADDR","SET_NAME"]}),"0x"===await yf(e.provider.getCode(t)))throw Error(`The resolver ${t} is not a contract`);const f=await yf(e.provider.getResolver(o));if(!f||!f.address||f.address.toLowerCase()!==t.toLowerCase()){const r=new Vd(h,wm,e.signer);if(a.next({message:"SET_RESOLVER_TX_REQUEST",name:o,resolverAddress:t}),s)return;const n=await bf(r.setResolver(u,t,e.txOptions));if(a.next({message:Nm,txHash:n.hash}),s)return;await mf(n.wait(e.confirms))}a.next({message:"SET_RESOLVER_SUCCESS",name:o,resolverAddress:t});const p=new Vd(t,Cm,e.signer),y=await yf(p.functions["addr(bytes32)"](u));if(!y||!y[0]||y[0].toLowerCase()!==i.toLowerCase()){if(a.next({message:"SET_ADDR_TX_REQUEST",name:o,address:i}),s)return;const t=await bf(p.functions["setAddr(bytes32,address)"](u,i,e.txOptions));if(a.next({message:Pm,txHash:t.hash}),s)return;await mf(t.wait(e.confirms))}if(a.next({message:"SET_ADDR_SUCCESS",name:o,address:i}),await xm(e,i)!==o)if(d){const t=new Vd(i,km,e.signer);if(a.next({message:Bm,name:o,address:i}),s)return;const r=await bf(t.setName(h,o,e.txOptions));if(a.next({message:Dm,txHash:r.hash}),s)return;await mf(r.wait(e.confirms))}else{const t=await Am(e,c),r=new Vd(t,Im,e.signer);if(a.next({message:Bm,name:o,address:i}),s)return;const n=await bf(r.setName(o,e.txOptions));if(a.next({message:Dm,txHash:n.hash}),s)return;await mf(n.wait(e.confirms))}a.next({message:"SET_NAME_SUCCESS",name:o,address:i}),a.complete()}catch(e){Om("obsConfigureResolution()",e),a.error(e)}})(),a.unsub=()=>{s=!0},a.unsubscribe.bind(a)})),Fm=v("iexec:ens:text-record"),Um=async(e=bp(),t,r)=>{try{const n=await fp().validate(t),i=await pp().validate(r),a=br(n),s=await yf(e.provider.getResolver(n));if(!s||!s.address||s.address===Js)throw Error(`No resolver is configured for ${n}`);const o=new Vd(s.address,Cm,e.provider);return await yf(o.text(a,i))}catch(e){throw Fm("readText()",e),e}},jm=async(e=bp(),t,r,n="")=>{try{const i=await fp().validate(t),a=await pp().validate(r),s=await ys().default("").strict(!0).validate(n),o=br(i),u=await yf(e.provider.getResolver(i));if(!u||!u.address||u.address===Js)throw Error(`No resolver is configured for ${i}`);const l=await Am(e,i),h=await Tp(e);if(l!==h)throw Error(`${h} is not authorised to set a text record for ${i}`);const c=new Vd(u.address,Cm,e.signer),d=await bf(c.setText(o,a,s));return await mf(d.wait(e.confirms)),d.hash}catch(e){throw Fm("setTextRecord()",e),e}};class qm extends wp{constructor(...e){super(...e),this.getOwner=async e=>Am(await this.config.resolveContractsClient(),e),this.resolveName=async e=>(async(e=bp(),t=bp())=>{try{const r=await fp().validate(t);return await Tm(e),await yf(e.provider.resolveName(r))}catch(e){throw Em("resolveName()",e),e}})(await this.config.resolveContractsClient(),e),this.lookupAddress=async e=>xm(await this.config.resolveContractsClient(),e),this.getDefaultDomain=async e=>(async(e=bp(),t=bp())=>{try{const r=await qf({ethProvider:e.provider}).validate(t),[n,i,a]=await Promise.all([Pp(zs)(e,r),Pp(Gs)(e,r),Pp(Ks)(e,r)]);return n?Rm[zs]:i?Rm[Gs]:a?Rm[Ks]:Rm.default}catch(e){throw Om("getDefaultDomain()",e),e}})(await this.config.resolveContractsClient(),e),this.claimName=async(e,t)=>(async(e=bp(),t=bp(),r=Rm.default)=>{try{No(e);const n=await fp().validate(r),i=await ys().test("no-dot","${originalValue} is not a valid ENS label (label cannot have `.`)",(async e=>{try{if(-1!==e.indexOf("."))throw new Error("Label cannot have `.`");return!0}catch(e){return Ef("ensLabelSchema no-dot",e),!1}})).test("valid-namehash","${originalValue} is not a valid ENS label (label cannot contain unsupported characters)",(e=>{try{return Mf(e),!0}catch(e){return Ef("ensLabelSchema valid-namehash",e),!1}})).test("no-uppercase","${originalValue} is not a valid ENS label (label cannot contain uppercase characters)",(e=>{try{if(e!==e.toLowerCase())throw Error("Label cannot have uppercase characters");return!0}catch(e){return Ef("ensLabelSchema no-uppercase",e),!1}})).validate(t);let a;const s=`${i}.${n}`,o=nl(i),u=await Tp(e),l=await Am(e,s);if(l===Js){const t=await Am(e,n);if("0x"===await yf(e.provider.getCode(t)))throw Error(`The base domain ${n} owner ${t} is not a contract`);const r=new Vd(t,Sm,e.signer),i=await bf(r.register(o,u,e.txOptions));await mf(i.wait(e.confirms)),a=i.hash}else{if(l.toLowerCase()!==u.toLowerCase())throw Error(`${s} is already owned by ${l}`);Om(`${s} is already owned by current wallet ${l}`)}return{registerTxHash:a,name:s}}catch(e){throw Om("registerFifsEns()",e),e}})(await this.config.resolveContractsClient(),e,t),this.obsConfigureResolution=async(e,t)=>Lm(await this.config.resolveContractsClient(),await this.config.resolveEnsPublicResolverAddress(),e,t),this.configureResolution=async(e,t)=>(async(e=bp(),t=bp(),r=bp(),n)=>{try{No(e);const i=void 0!==n?await qf({ethProvider:e.provider}).validate(n):await Tp(e),a=await fp().validate(r),s=await Lm(e,t,r,n);return new Promise(((e,t)=>{const r={name:a,address:i};s.subscribe({error:e=>t(e),next:({message:e,...t})=>{switch(e){case Nm:r.setResolverTxHash=t.txHash;break;case Pm:r.setAddrTxHash=t.txHash;break;case Dm:r.setNameTxHash=t.txHash}},complete:()=>{e(r)}})}))}catch(e){throw Om("configureResolution()",e),e}})(await this.config.resolveContractsClient(),await this.config.resolveEnsPublicResolverAddress(),e,t),this.setTextRecord=async(e,t,r)=>jm(await this.config.resolveContractsClient(),e,t,r),this.readTextRecord=async(e,t)=>Um(await this.config.resolveContractsClient(),e,t)}}class zm extends wp{constructor(...e){super(...e),this.createCategory=async e=>(async(e=bp(),t=bp())=>{try{No(e);const r=await Is({name:ys().required(),description:ys().required(),workClockTimeRef:Pf().required()}).validate(t),n=e.getIExecContract(),i=await yf(n.owner());if(i!==await e.signer.getAddress())throw Error(`only category owner ${i} can create new categories`);const a=[r.name,r.description,r.workClockTimeRef],s=await bf(n.createCategory(...a,e.txOptions)),o=await mf(s.wait(e.confirms)),{catid:u}=So("CreateCategory",o.events,{strict:!0}).args;return{catid:u,txHash:o.transactionHash}}catch(e){throw Xy("createCategory()",e),e}})(await this.config.resolveContractsClient(),e),this.showCategory=async e=>Qy(await this.config.resolveContractsClient(),e),this.countCategory=async()=>(async(e=bp())=>{try{return mo(await yf(e.getIExecContract().countCategory()))}catch(e){throw Xy("countCategory()",e),e}})(await this.config.resolveContractsClient()),this.getTimeoutRatio=async()=>tm(await this.config.resolveContractsClient())}}class Gm extends wp{constructor(...e){super(...e),this.getNetwork=async()=>{const e=await this.config.resolveContractsClient();return{chainId:e.chainId,isNative:e.isNative}}}}const Km="iexec-result-encryption-public-key",Hm=e=>{switch(e){case void 0:case"default":case to.IPFS:return"iexec-result-iexec-ipfs-token";case to.DROPBOX:return"iexec-result-dropbox-token";default:throw Error(`"${e}" not supported`)}},$m=()=>Km,Vm=async e=>{const t=await Wf().validate(e);return Ro(t,Io[eo.SCONE])?eo.SCONE:Ro(t,Io[eo.GRAMINE])?eo.GRAMINE:void 0},Wm=async({params:e={},tag:t=Ys,callback:r=Js,noCast:n=!1,resultProxyURL:i}={})=>{let a;if("string"==typeof e)try{a=JSON.parse(e)}catch(t){a={iexec_args:e}}else a=e;const s=Ro(t,Io.tee),o=r!==Js;return Vf().validate(a,{strict:n,context:{isTee:s,isCallback:o,resultProxyURL:i}})},Zm=async({contracts:e=bp(),smsURL:t=bp()}=bp(),r=bp())=>{const n=await ip().validate(r),{tag:i,dataset:a,callback:s,params:o,requester:u,beneficiary:l}=n,h=await Wm({params:o,tag:i,callback:s,noCast:!0}),c=Ro(i,Io.tee);if(!0===h[no]&&!await Fy(e,t,l,Km))throw Error("Beneficiary result encryption key is not set in the SMS. Result encryption will fail.");if((h[io]===to.IPFS||h[io]===to.DROPBOX)&&!await Fy(e,t,u,Hm(h[io])))throw Error(`Requester storage token is not set for selected provider "${h[io]}". Result archive upload will fail.`);if(a&&a!==Js&&c&&!await Ly(e,t,a))throw Error(`Dataset encryption key is not set for dataset ${a} in the SMS. Dataset decryption will fail.`);h[ro]&&await Promise.all(Object.values(h[ro]).map((async r=>{if(!await Uy(e,t,u,r))throw Error(`Requester secret "${r}" is not set for requester ${u} in the SMS. Requester secret provisioning will fail.`)})))},Jm=async({contracts:e=bp(),smsURL:t=bp()}=bp(),r=bp(),{tagOverride:n}={})=>{const i=await Xf().validate(r),{tag:a,dataset:s}=i,o=Ro(n?await Wf().validate(n):a,Io.tee);if(s&&s!==Js&&o&&!await Ly(e,t,s))throw Error(`Dataset encryption key is not set for dataset ${s} in the SMS. Dataset decryption will fail.`)},Ym=async({contracts:e=bp()}=bp(),t=bp(),{tagOverride:r}={})=>{const n=await Zf().validate(t),{tag:i,app:a}=n,s=await Vm(r?await Wf().validate(r):i);if(await Yp(e,a).then((e=>Xp(e.app,{strict:!1})))!==s)throw Error("Tag mismatch the TEE framework specified by app")},Xm=v("iexec:market:order"),Qm={EIP712Domain:{primaryType:"EIP712Domain",structMembers:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}]},[Hs]:{primaryType:"AppOrder",structMembers:[{name:"app",type:"address"},{name:"appprice",type:"uint256"},{name:"volume",type:"uint256"},{name:"tag",type:"bytes32"},{name:"datasetrestrict",type:"address"},{name:"workerpoolrestrict",type:"address"},{name:"requesterrestrict",type:"address"},{name:"salt",type:"bytes32"}],contractPropName:"app",ownerMethod:Gp,cancelMethod:"manageAppOrder",cancelEvent:"ClosedAppOrder",addressField:"app"},[$s]:{primaryType:"DatasetOrder",structMembers:[{name:"dataset",type:"address"},{name:"datasetprice",type:"uint256"},{name:"volume",type:"uint256"},{name:"tag",type:"bytes32"},{name:"apprestrict",type:"address"},{name:"workerpoolrestrict",type:"address"},{name:"requesterrestrict",type:"address"},{name:"salt",type:"bytes32"}],contractPropName:"dataset",ownerMethod:Kp,cancelMethod:"manageDatasetOrder",cancelEvent:"ClosedDatasetOrder",addressField:"dataset"},[Vs]:{primaryType:"WorkerpoolOrder",structMembers:[{name:"workerpool",type:"address"},{name:"workerpoolprice",type:"uint256"},{name:"volume",type:"uint256"},{name:"tag",type:"bytes32"},{name:"category",type:"uint256"},{name:"trust",type:"uint256"},{name:"apprestrict",type:"address"},{name:"datasetrestrict",type:"address"},{name:"requesterrestrict",type:"address"},{name:"salt",type:"bytes32"}],contractPropName:"workerpool",ownerMethod:Hp,cancelMethod:"manageWorkerpoolOrder",cancelEvent:"ClosedWorkerpoolOrder",addressField:"workerpool"},[Ws]:{primaryType:"RequestOrder",structMembers:[{name:"app",type:"address"},{name:"appmaxprice",type:"uint256"},{name:"dataset",type:"address"},{name:"datasetmaxprice",type:"uint256"},{name:"workerpool",type:"address"},{name:"workerpoolmaxprice",type:"uint256"},{name:"requester",type:"address"},{name:"volume",type:"uint256"},{name:"tag",type:"bytes32"},{name:"category",type:"uint256"},{name:"trust",type:"uint256"},{name:"beneficiary",type:"address"},{name:"callback",type:"address"},{name:"params",type:"string"},{name:"salt",type:"bytes32"}],cancelMethod:"manageRequestOrder",cancelEvent:"ClosedRequestOrder",addressField:"requester"}},eb=(e,t)=>{var r;return(r=t,Qm[e].structMembers.reduce(((e,t)=>e.concat([r[t.name]])),[])).concat([t.sign])},tb=async e=>{const t=await e.getIExecContract(),{name:r,version:n,chainId:i,verifyingContract:a}=await yf(t.domain());return{name:r,version:n,chainId:i.toString(),verifyingContract:a}},rb=async(e=bp(),t=bp(),r=bp())=>{try{let n;switch(t){case Hs:n=await Jf({ethProvider:e.provider}).validate(r);break;case $s:n=await Qf({ethProvider:e.provider}).validate(r);break;case Vs:n=await rp({ethProvider:e.provider}).validate(r);break;case Ws:n=await ap({ethProvider:e.provider}).validate(r)}const i=await tb(e),a={types:{EIP712Domain:Qm.EIP712Domain.structMembers,[Qm[t].primaryType]:Qm[t].structMembers},domain:i,primaryType:Qm[t].primaryType,message:n};return xy(a)}catch(e){throw Xm("computeOrderHash()",e),e}},nb=async(e=bp(),t=bp())=>rb(e,Hs,await Jf({ethProvider:e.provider}).validate(t)),ib=async(e=bp(),t=bp())=>rb(e,$s,await Qf({ethProvider:e.provider}).validate(t)),ab=async(e=bp(),t=bp())=>rb(e,Vs,await rp({ethProvider:e.provider}).validate(t)),sb=async(e=bp(),t=bp())=>rb(e,Ws,await ap({ethProvider:e.provider}).validate(t)),ob=async(e=bp(),t=bp(),r=bp())=>{try{const n=new _(r.volume);if(n.isZero())return n;const i=await rb(e,t,r),a=e.getIExecContract(),s=await yf(a.viewConsumed(i)),o=mo(s);return n.sub(o)}catch(e){throw Xm("getRemainingVolume()",e),e}},ub=async(e=bp(),t=bp(),r=bp())=>{No(e);const n=t===Ws?r.requester:await(async(e=bp(),t=bp(),r=bp())=>{const n=r[Qm[t].contractPropName];return Qm[t].ownerMethod(e,n)})(e,t,r);if(n!==await Tp(e))throw Error("Invalid order signer, must be the "+(t===Ws?"requester":"resource owner"));const i=co(uo(32)),a={...r,salt:i},s=await tb(e),o={[Qm[t].primaryType]:Qm[t].structMembers},{signer:u}=e,l=await vf(u._signTypedData&&"function"==typeof u._signTypedData?u._signTypedData(s,o,a):u.signTypedData(s,o,a));return{...a,sign:l}},lb=async(e=bp(),t=bp(),r=bp())=>{try{No(e);const n=eb(t,r);if((await ob(e,t,r)).isZero())throw Error(`${t} already canceled`);const i=e.getIExecContract(),a=await bf(i[Qm[t].cancelMethod]([n,1,Zs],e.txOptions)),s=await mf(a.wait(e.confirms));if(!ko(Qm[t].cancelEvent,s.events))throw Error(`${Qm[t].cancelEvent} not confirmed`);return{order:r,txHash:a.hash}}catch(e){throw Xm("cancelOrder()",e),e}},hb=async(e=bp(),t=bp(),r=bp(),n=bp())=>{const i=e.getIExecContract();return!!await yf(i.verifySignature(t,r,n))},cb=async(e=bp(),t=bp(),r=Xs,n=bp(),i=bp())=>{try{No(e);const[a,s,o,u]=await Promise.all([Yf().validate(t),ep().validate(r),np().validate(n),sp().validate(i)]);await Wf().validate(Oo([a.tag,s.tag,u.tag])).catch((e=>{throw new Error(`Matching order would produce an invalid deal tag. ${e.message}`)}));const l=await(async(e=bp(),t=bp(),r=Xs,n=bp(),i=bp())=>{try{const[a,s,o,u]=await Promise.all([Yf().validate(t),ep().validate(r),np().validate(n),sp().validate(i)]),l=async()=>{if(!await Bp(e,a.app))throw new Error(`No app deployed at address ${a.app}`)},h=async()=>{if(s.dataset!==Js&&!await Dp(e,s.dataset))throw new Error(`No dataset deployed at address ${s.dataset}`)},c=async()=>{if(!await Lp(e,o.workerpool))throw new Error(`No workerpool deployed at address ${o.workerpool}`)};await Promise.all([l(),h(),c()]);const d=async()=>{if(!await hb(e,await Gp(e,a.app),await nb(e,a),a.sign))throw new Error("apporder invalid sign")},f=async()=>{if(s.dataset!==Js&&!await hb(e,await Kp(e,s.dataset),await ib(e,s),s.sign))throw new Error("datasetorder invalid sign")},p=async()=>{if(!await hb(e,await Hp(e,o.workerpool),await ab(e,o),o.sign))throw new Error("workerpoolorder invalid sign")},y=async()=>{if(!await hb(e,u.requester,await sb(e,u),u.sign))throw new Error("requestorder invalid sign")};if(await Promise.all([d(),f(),p(),y()]),"enterprise"===e.flavour){Xm("check enterprise");const t=async()=>{const t=await Ip(e,u.requester,{strict:!1});if(Xm("requester in whitelist",t),!t)throw new Error(`requester ${u.requester} is not authorized to interact with eRLC`)},r=async()=>{const t=await Gp(e,a.app),r=await Ip(e,t,{strict:!1});if(Xm("app owner in whitelist",r),!r)throw new Error(`app owner ${t} is not authorized to interact with eRLC`)},n=async()=>{if(s.dataset===Js)return;const t=await Kp(e,s.dataset),r=await Ip(e,t,{strict:!1});if(Xm("dataset owner in whitelist",r),!r)throw new Error(`dataset owner ${t} is not authorized to interact with eRLC`)},i=async()=>{const t=await Hp(e,o.workerpool),r=await Ip(e,t,{strict:!1});if(Xm("workerpool owner in whitelist",r),!r)throw new Error(`workerpool owner ${t} is not authorized to interact with eRLC`)};await Promise.all([t(),r(),n(),i()])}if(u.app!==a.app)throw new Error(`app address mismatch between requestorder (${u.app}) and apporder (${a.app})`);if(u.dataset!==Js&&u.dataset!==s.dataset)throw new Error(`dataset address mismatch between requestorder (${u.dataset}) and datasetorder (${s.dataset})`);if(u.workerpool!==Js&&u.workerpool!==o.workerpool)throw new Error(`workerpool address mismatch between requestorder (${u.workerpool}) and workerpoolorder (${o.workerpool})`);const m=new _(u.category),b=new _(o.category);if(!b.eq(m))throw new Error(`category mismatch between requestorder (${m}) and workerpoolorder (${b})`);const g=new _(u.trust),v=new _(o.trust);if(v.lt(g))throw new Error(`workerpoolorder trust is too low (expected ${g}, got ${v})`);const w=((e,t)=>{if("string"!=typeof e||!po.test(e))throw new za("tag must be bytes32 hex string");if("string"!=typeof t||!po.test(t))throw new za("requiredTag must be bytes32 hex string");const r=new so(e.substring(2),"hex").toString(2),n=new so(t.substring(2),"hex").toString(2),i=[];for(let e=0;e<n.length;e+=1)"1"===n.charAt(n.length-e-1)&&"1"!==r.charAt(r.length-e-1)&&i.push(e);return i})(o.tag,Oo([u.tag,a.tag,s.tag]));if(w.length>0)throw Error(`Missing tags [${w.map((e=>(e=>{if("number"!=typeof e||e<0||e>255)throw new za("Invalid bit tag");return Io[e]||e})(e)))}] in workerpoolorder`);if(Ro(Oo([u.tag,s.tag]),1)&&!Ro(a.tag,Io.tee))throw Error("Missing tag [tee] in apporder");const M=new _(o.workerpoolprice),T=new _(u.workerpoolmaxprice),E=new _(a.appprice),A=new _(u.appmaxprice),x=new _(s.datasetprice),k=new _(u.datasetmaxprice);if(A.lt(E))throw new Error(`appmaxprice too low (expected ${E}, got ${A})`);if(T.lt(M))throw new Error(`workerpoolmaxprice too low (expected ${M}, got ${T})`);if(k.lt(x))throw new Error(`datasetmaxprice too low (expected ${x}, got ${k})`);const S=await Hp(e,o.workerpool),{stake:I}=await Mp(e,S),C=M.mul(new _(30)).div(new _(100)),O=C.isZero()?new _(n.volume):I.div(C);if(O.isZero())throw Error(`workerpool required stake (${C}) is greater than workerpool owner's account stake (${I}). Orders can't be matched. If you are the workerpool owner, you should deposit to top up your account`);return(await Promise.all(u.dataset!==Js?[ob(e,Hs,a).then((e=>{if(e.lte(new _(0)))throw new Error("apporder is fully consumed");return e})),ob(e,$s,s).then((e=>{if(e.lte(new _(0)))throw new Error("datasetorder is fully consumed");return e})),ob(e,Vs,o).then((e=>{if(e.lte(new _(0)))throw new Error("workerpoolorder is fully consumed");return e})),ob(e,Ws,u).then((e=>{if(e.lte(new _(0)))throw new Error("requestorder is fully consumed");return e}))]:[ob(e,Hs,a).then((e=>{if(e.lte(new _(0)))throw new Error("apporder is fully consumed");return e})),ob(e,Vs,o).then((e=>{if(e.lte(new _(0)))throw new Error("workerpoolorder is fully consumed");return e})),ob(e,Ws,u).then((e=>{if(e.lte(new _(0)))throw new Error("requestorder is fully consumed");return e}))])).reduce(((e,t)=>t.lt(e)?t:e),O)}catch(e){throw Xm("getMatchableVolume()",e),e}})(e,a,s,o,u),h=new _(o.workerpoolprice),c=new _(a.appprice),d=new _(s.datasetprice),f=async()=>{const t=c.add(d).add(h),r=t.mul(l),{stake:n}=await Mp(e,u.requester);if(n.lt(t))throw new Error(`Cost per task (${t}) is greater than requester account stake (${n}). Orders can't be matched. If you are the requester, you should deposit to top up your account`);if(n.lt(r))throw new Error(`Total cost for ${l} tasks (${r}) is greater than requester account stake (${n}). Orders can't be matched. If you are the requester, you should deposit to top up your account or reduce your requestorder volume`)};await f();const p=eb(Hs,a),y=eb($s,s),m=eb(Vs,o),b=eb(Ws,u),g=e.getIExecContract(),v=await bf(g.matchOrders(p,y,m,b,e.txOptions)),w=await mf(v.wait(e.confirms)),M="OrdersMatched";if(!ko(M,w.events))throw Error(`${M} not confirmed`);const{dealid:T,volume:E}=So(M,w.events).args;return{dealid:T,volume:mo(E),txHash:v.hash}}catch(e){throw Xm("matchOrders() error",e),e}},db=v("iexec:market:marketplace"),fb={[Hs]:"/apporders",[$s]:"/datasetorders",[Vs]:"/workerpoolorders",[Ws]:"/requestorders"},pb={[Hs]:"app",[$s]:"dataset",[Vs]:"workerpool",[Ws]:"requester"},yb=async(e=bp(),t=bp(),r=bp(),n=bp(),i=bp())=>{try{No(e);const s=await Tp(e),o={order:i},u=await By(t,"/challenge")(n,s,e.signer),l=await(a={api:t,endpoint:fb[r],query:{chainId:n},body:o,headers:{authorization:u}},Cy("POST")({...a,headers:{Accept:"application/json",...a.headers}}).then(Ry));if(l.ok&&l.published&&l.published.orderHash)return l.published.orderHash;throw Error("An error occurred while publishing order")}catch(e){throw db("publishOrder()",e),e}var a},mb="unpublish_orderHash",bb="unpublish_all",gb="unpublish_last",vb=async(e=bp(),t=bp(),r=bp(),n=bp(),{target:i=mb,orderHash:a,address:s}={})=>{try{No(e);const u={target:i};i===mb?(a||bp(),u.orderHash=a):i!==gb&&i!==bb||(s||bp(),u[pb[r]]=s);const l=await Tp(e),h=await By(t,"/challenge")(e.chainId,l,e.signer),c=await(o={api:t,endpoint:fb[r],query:{chainId:n},body:u,headers:{authorization:h}},Cy("PUT")({...o,headers:{Accept:"application/json",...o.headers}}).then(Ry));if(c.ok&&c.unpublished)return c.unpublished;throw new Error("An error occurred while unpublishing order")}catch(e){throw db("unpublishOrder()",e),e}var o},wb=async(e=bp(),t=bp(),r=bp(),n=bp())=>{try{const i=await Lf().validate(r),a=await Gf().validate(n);if(!fb[t])throw Error(`Unsupported orderName ${t}`);const s={chainId:i},{ok:o,...u}=await Py({api:e,endpoint:`${fb[t]}/${a}`,query:s});return u}catch(e){throw db("fetchPublishedOrderByHash()",e),e}};class _b extends wp{constructor(...e){super(...e),this.createApporder=async e=>(async(e=bp(),{app:t=bp(),appprice:r="0",volume:n="1",tag:i=Ys,datasetrestrict:a=Js,workerpoolrestrict:s=Js,requesterrestrict:o=Js}={})=>({app:await qf({ethProvider:e.provider}).validate(t),appprice:await Df().validate(r),volume:await Pf().validate(n),tag:await Wf().validate(i),datasetrestrict:await qf({ethProvider:e.provider}).validate(a),workerpoolrestrict:await qf({ethProvider:e.provider}).validate(s),requesterrestrict:await qf({ethProvider:e.provider}).validate(o)}))(await this.config.resolveContractsClient(),e),this.createDatasetorder=async e=>(async(e=bp(),{dataset:t=bp(),datasetprice:r="0",volume:n="1",tag:i=Ys,apprestrict:a=Js,workerpoolrestrict:s=Js,requesterrestrict:o=Js}={})=>({dataset:await qf({ethProvider:e.provider}).validate(t),datasetprice:await Df().validate(r),volume:await Pf().validate(n),tag:await Wf().validate(i),apprestrict:await qf({ethProvider:e.provider}).validate(a),workerpoolrestrict:await qf({ethProvider:e.provider}).validate(s),requesterrestrict:await qf({ethProvider:e.provider}).validate(o)}))(await this.config.resolveContractsClient(),e),this.createWorkerpoolorder=async e=>(async(e=bp(),{workerpool:t=bp(),category:r=bp(),workerpoolprice:n="0",volume:i="1",trust:a="0",tag:s=Ys,apprestrict:o=Js,datasetrestrict:u=Js,requesterrestrict:l=Js}={})=>({workerpool:await qf({ethProvider:e.provider}).validate(t),workerpoolprice:await Df().validate(n),volume:await Pf().validate(i),category:await Pf().validate(r),trust:await Pf().validate(a),tag:await Wf().validate(s),apprestrict:await qf({ethProvider:e.provider}).validate(o),datasetrestrict:await qf({ethProvider:e.provider}).validate(u),requesterrestrict:await qf({ethProvider:e.provider}).validate(l)}))(await this.config.resolveContractsClient(),e),this.createRequestorder=async e=>(async({contracts:e=bp(),resultProxyURL:t=bp()}={},{app:r=bp(),category:n=bp(),dataset:i=Js,workerpool:a=Js,appmaxprice:s="0",datasetmaxprice:o="0",workerpoolmaxprice:u="0",volume:l="1",requester:h,beneficiary:c,params:d={},callback:f=Js,trust:p="0",tag:y=Ys}={})=>{const m=h||await Tp(e);return{app:await qf({ethProvider:e.provider}).validate(r),appmaxprice:await Df().validate(s),dataset:await qf({ethProvider:e.provider}).validate(i),datasetmaxprice:await Df().validate(o),workerpool:await qf({ethProvider:e.provider}).validate(a),workerpoolmaxprice:await Df().validate(u),requester:await qf({ethProvider:e.provider}).validate(m),beneficiary:await qf({ethProvider:e.provider}).validate(c||m),volume:await Pf().validate(l),params:await Wm({params:d,tag:await Wf().validate(y),callback:await qf({ethProvider:e.provider}).validate(f),resultProxyURL:t}),callback:await qf({ethProvider:e.provider}).validate(f),category:await Pf().validate(n),trust:await Pf().validate(p),tag:await Wf().validate(y)}})({contracts:await this.config.resolveContractsClient(),resultProxyURL:await this.config.resolveResultProxyURL()},e),this.hashApporder=async e=>nb(await this.config.resolveContractsClient(),e),this.hashDatasetorder=async e=>ib(await this.config.resolveContractsClient(),e),this.hashWorkerpoolorder=async e=>ab(await this.config.resolveContractsClient(),e),this.hashRequestorder=async e=>sb(await this.config.resolveContractsClient(),e),this.signApporder=async(e,{preflightCheck:t=!0}={})=>(async(e=bp(),t=bp())=>ub(e,Hs,await Zf({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),!0===t?await Ym({contracts:await this.config.resolveContractsClient()},e).then((()=>e)):e),this.signDatasetorder=async(e,{preflightCheck:t=!0}={})=>(async(e=bp(),t=bp())=>ub(e,$s,await Xf({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),!0===t?await Jm({contracts:await this.config.resolveContractsClient(),smsURL:await this.config.resolveSmsURL({teeFramework:await Vm((await Xf().validate(e)).tag)})},e).then((()=>e)):e),this.signWorkerpoolorder=async e=>(async(e=bp(),t=bp())=>ub(e,Vs,await tp({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),e),this.signRequestorder=async(e,{preflightCheck:t=!0}={})=>(async(e=bp(),t=bp())=>ub(e,Ws,await ip({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),!0===t?await Zm({contracts:await this.config.resolveContractsClient(),smsURL:await this.config.resolveSmsURL({teeFramework:await Vm((await ip().validate(e)).tag)})},e).then((()=>e)):e),this.cancelApporder=async e=>(async(e=bp(),t=bp())=>lb(e,Hs,await Yf().validate(t)))(await this.config.resolveContractsClient(),e),this.cancelDatasetorder=async e=>(async(e=bp(),t=bp())=>lb(e,$s,await ep().validate(t)))(await this.config.resolveContractsClient(),e),this.cancelWorkerpoolorder=async e=>(async(e=bp(),t=bp())=>lb(e,Vs,await np().validate(t)))(await this.config.resolveContractsClient(),e),this.cancelRequestorder=async e=>(async(e=bp(),t=bp())=>lb(e,Ws,await sp().validate(t)))(await this.config.resolveContractsClient(),e),this.publishApporder=async(e,{preflightCheck:t=!0}={})=>(async(e=bp(),t=bp(),r=bp())=>yb(e,t,Hs,await Lf().validate(e.chainId),await Yf().validate(r)))(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),!0===t?await Ym({contracts:await this.config.resolveContractsClient()},e).then((()=>e)):e),this.publishDatasetorder=async(e,{preflightCheck:t=!0}={})=>(async(e=bp(),t=bp(),r=bp())=>yb(e,t,$s,await Lf().validate(e.chainId),await ep().validate(r)))(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),!0===t?await Jm({contracts:await this.config.resolveContractsClient(),smsURL:await this.config.resolveSmsURL({teeFramework:await Vm((await Xf().validate(e)).tag)})},e).then((()=>e)):e),this.publishWorkerpoolorder=async e=>(async(e=bp(),t=bp(),r=bp())=>yb(e,t,Vs,await Lf().validate(e.chainId),await np().validate(r)))(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e),this.publishRequestorder=async(e,{preflightCheck:t=!0}={})=>(async(e=bp(),t=bp(),r=bp())=>yb(e,t,Ws,await Lf().validate(e.chainId),await sp().validate(r)))(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),!0===t?await await Zm({contracts:await this.config.resolveContractsClient(),smsURL:await this.config.resolveSmsURL({teeFramework:await Vm((await ip().validate(e)).tag)})},e).then((()=>e)):e),this.unpublishApporder=async e=>(async(e=bp(),t=bp(),r=bp())=>(await vb(e,t,Hs,await Lf().validate(e.chainId),{orderHash:await Gf().validate(r)}))[0])(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e),this.unpublishDatasetorder=async e=>(async(e=bp(),t=bp(),r=bp())=>(await vb(e,t,$s,await Lf().validate(e.chainId),{orderHash:await Gf().validate(r)}))[0])(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e),this.unpublishWorkerpoolorder=async e=>(async(e=bp(),t=bp(),r=bp())=>(await vb(e,t,Vs,await Lf().validate(e.chainId),{orderHash:await Gf().validate(r)}))[0])(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e),this.unpublishRequestorder=async e=>(async(e=bp(),t=bp(),r=bp())=>(await vb(e,t,Ws,await Lf().validate(e.chainId),{orderHash:await Gf().validate(r)}))[0])(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e),this.unpublishLastApporder=async e=>(async(e=bp(),t=bp(),r=bp())=>(await vb(e,t,Hs,await Lf().validate(e.chainId),{target:gb,address:await qf({ethProvider:e.provider}).validate(r)}))[0])(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e),this.unpublishLastDatasetorder=async e=>(async(e=bp(),t=bp(),r=bp())=>(await vb(e,t,$s,await Lf().validate(e.chainId),{target:gb,address:await qf({ethProvider:e.provider}).validate(r)}))[0])(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e),this.unpublishLastWorkerpoolorder=async e=>(async(e=bp(),t=bp(),r=bp())=>(await vb(e,t,Vs,await Lf().validate(e.chainId),{target:gb,address:await qf({ethProvider:e.provider}).validate(r)}))[0])(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e),this.unpublishLastRequestorder=async()=>(async(e=bp(),t=bp())=>(await vb(e,t,Ws,await Lf().validate(e.chainId),{target:gb,address:await Tp(e)}))[0])(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL()),this.unpublishAllApporders=async e=>(async(e=bp(),t=bp(),r=bp())=>vb(e,t,Hs,await Lf().validate(e.chainId),{target:bb,address:await qf({ethProvider:e.provider}).validate(r)}))(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e),this.unpublishAllDatasetorders=async e=>(async(e=bp(),t=bp(),r=bp())=>vb(e,t,$s,await Lf().validate(e.chainId),{target:bb,address:await qf({ethProvider:e.provider}).validate(r)}))(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e),this.unpublishAllWorkerpoolorders=async e=>(async(e=bp(),t=bp(),r=bp())=>vb(e,t,Vs,await Lf().validate(e.chainId),{target:bb,address:await qf({ethProvider:e.provider}).validate(r)}))(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e),this.unpublishAllRequestorders=async()=>(async(e=bp(),t=bp())=>vb(e,t,Ws,await Lf().validate(e.chainId),{target:bb,address:await Tp(e)}))(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL()),this.matchOrders=async({apporder:e,datasetorder:t=Xs,workerpoolorder:r,requestorder:n},{preflightCheck:i=!0}={})=>{if(!0===i){const i=Oo([(await ip().label("requestorder").validate(n)).tag,(await Zf().label("apporder").validate(e)).tag,(await Xf().label("datasetorder").validate(t)).tag]);return cb(await this.config.resolveContractsClient(),await Ym({contracts:await this.config.resolveContractsClient()},e,{tagOverride:i}).then((()=>e)),await Jm({contracts:await this.config.resolveContractsClient(),smsURL:await this.config.resolveSmsURL({teeFramework:await Vm(i)})},t,{tagOverride:i}).then((()=>t)),r,await Zm({contracts:await this.config.resolveContractsClient(),smsURL:await this.config.resolveSmsURL({teeFramework:await Vm(i)})},n).then((()=>n)))}return cb(await this.config.resolveContractsClient(),e,t,r,n)}}}const Mb=v("iexec:market:orderbook"),Tb="An error occurred while getting orderbook";class Eb extends wp{constructor(...e){super(...e),this.fetchApporder=async e=>wb(await this.config.resolveIexecGatewayURL(),Hs,await this.config.resolveChainId(),e),this.fetchDatasetorder=async e=>wb(await this.config.resolveIexecGatewayURL(),$s,await this.config.resolveChainId(),e),this.fetchWorkerpoolorder=async e=>wb(await this.config.resolveIexecGatewayURL(),Vs,await this.config.resolveChainId(),e),this.fetchRequestorder=async e=>wb(await this.config.resolveIexecGatewayURL(),Ws,await this.config.resolveChainId(),e),this.fetchAppOrderbook=async(e,t={})=>(async(e=bp(),t=bp(),r=bp(),{dataset:n,workerpool:i,requester:a,minTag:s,maxTag:o,minVolume:u}={})=>{try{const l={chainId:await Lf().validate(e.chainId),app:await zf({ethProvider:e.provider}).validate(r),...n&&{dataset:await zf({ethProvider:e.provider}).validate(n)},...i&&{workerpool:await zf({ethProvider:e.provider}).validate(i)},...a&&{requester:await zf({ethProvider:e.provider}).validate(a)},...u&&{minVolume:await Nf().validate(u)},...void 0!==s&&{minTag:await Wf().validate(s)},...void 0!==o&&{maxTag:await Wf().validate(o)}},{ok:h,...c}=await Ny(Py)({api:t,endpoint:"/apporders",query:l});if(h)return c;throw Error(Tb)}catch(e){throw Mb("fetchAppOrderbook()",e),e}})(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e,t),this.fetchDatasetOrderbook=async(e,t={})=>(async(e=bp(),t=bp(),r=bp(),{app:n,workerpool:i,requester:a,minTag:s,maxTag:o,minVolume:u}={})=>{try{const l={chainId:await Lf().validate(e.chainId),dataset:await zf({ethProvider:e.provider}).validate(r),...n&&{app:await zf({ethProvider:e.provider}).validate(n)},...i&&{workerpool:await zf({ethProvider:e.provider}).validate(i)},...a&&{requester:await zf({ethProvider:e.provider}).validate(a)},...u&&{minVolume:await Nf().validate(u)},...void 0!==s&&{minTag:await Wf().validate(s)},...void 0!==o&&{maxTag:await Wf().validate(o)}},{ok:h,...c}=await Ny(Py)({api:t,endpoint:"/datasetorders",query:l});if(h)return c;throw Error(Tb)}catch(e){throw Mb("fetchDatasetOrderbook()",e),e}})(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e,t),this.fetchWorkerpoolOrderbook=async e=>(async(e=bp(),t=bp(),{category:r,workerpool:n,minTag:i,maxTag:a,workerpoolOwner:s,minTrust:o,minVolume:u,app:l,dataset:h,requester:c}={})=>{try{const d={chainId:await Lf().validate(e.chainId),category:await Pf().validate(r),...n&&{workerpool:await zf({ethProvider:e.provider}).validate(n)},...l&&{app:await zf({ethProvider:e.provider}).validate(l)},...h&&{dataset:await zf({ethProvider:e.provider}).validate(h)},...c&&{requester:await zf({ethProvider:e.provider}).validate(c)},...i&&{minTag:await Wf().validate(i)},...a&&{maxTag:await Wf().validate(a)},...s&&{workerpoolOwner:await qf({ethProvider:e.provider}).validate(s)},...o&&{minTrust:await Rf().validate(o)},...u&&{minVolume:await Nf().validate(u)}},{ok:f,...p}=await Ny(Py)({api:t,endpoint:"/workerpoolorders",query:d});if(f)return p;throw Error(Tb)}catch(e){throw Mb("fetchWorkerpoolOrderbook()",e),e}})(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e),this.fetchRequestOrderbook=async e=>(async(e=bp(),t=bp(),{category:r,requester:n,beneficiary:i,app:a,dataset:s,workerpool:o,minTag:u,maxTag:l,maxTrust:h,minVolume:c}={})=>{try{const d={chainId:await Lf().validate(e.chainId),category:await Pf().validate(r),...n&&{requester:await zf({ethProvider:e.provider}).validate(n)},...i&&{beneficiary:await zf({ethProvider:e.provider}).validate(i)},...a&&{app:await zf({ethProvider:e.provider}).validate(a)},...s&&{dataset:await zf({ethProvider:e.provider}).validate(s)},...o&&{workerpool:await zf({ethProvider:e.provider}).validate(o)},...void 0!==u&&{minTag:await Wf().validate(u)},...void 0!==l&&{maxTag:await Wf().validate(l)},...void 0!==h&&{maxTrust:await Rf().validate(h)},...c&&{minVolume:await Nf().validate(c)}},{ok:f,...p}=await Ny(Py)({api:t,endpoint:"/requestorders",query:d});if(f)return p;throw Error(Tb)}catch(e){throw Mb("fetchRequestOrderbook()",e),e}})(await this.config.resolveContractsClient(),await this.config.resolveIexecGatewayURL(),e)}}class Ab extends wp{constructor(...e){super(...e),this.checkResultEncryptionKeyExists=async(e,{teeFramework:t}={})=>Fy(await this.config.resolveContractsClient(),await this.config.resolveSmsURL({teeFramework:t}),e,$m()),this.pushResultEncryptionKey=async(e,{forceUpdate:t=!1,teeFramework:r}={})=>Vy(await this.config.resolveContractsClient(),await this.config.resolveSmsURL({teeFramework:r}),$m(),e,{forceUpdate:t})}}class xb extends wp{constructor(...e){super(...e),this.checkRequesterSecretExists=async(e,t,{teeFramework:r}={})=>Uy(await this.config.resolveContractsClient(),await this.config.resolveSmsURL({teeFramework:r}),e,t),this.pushRequesterSecret=async(e,t,{teeFramework:r}={})=>(async(e=bp(),t=bp(),r=bp(),n=bp())=>{try{No(e);const i=await Tp(e);if(await Sf().validate(r,{strict:!0}),await Sf().validate(n,{strict:!0}),await Uy(e,t,i,r))throw Error(`Secret "${r}" already exists for ${i}`);const a=Hy(i,r,n),s=qy(a),o=await wf(e.signer.signMessage(s)),u=await Cy("POST")({api:t,endpoint:`/requesters/${i}/secrets/${r}`,body:n,headers:{Authorization:o}}).catch((e=>{throw zy(e),Error(`SMS at ${t} didn't answered`)}));if(u.ok)return{isPushed:!0};throw Error(`SMS answered with unexpected status: ${u.status} ${u.statusText}`)}catch(e){throw zy("pushRequesterSecret()",e),e}})(await this.config.resolveContractsClient(),await this.config.resolveSmsURL({teeFramework:r}),e,t)}}const kb=v("iexec:storage:result-proxy");class Sb extends wp{constructor(...e){super(...e),this.defaultStorageLogin=async()=>(async(e=bp(),t=bp())=>{try{No(e);const r=await Tp(e),n=await By(t,"/results/challenge")(e.chainId,r,e.signer),i=await Cy("POST")({api:t,endpoint:"/results/login",query:{chainId:e.chainId},body:n}).catch((e=>{throw kb(e),Error(`Result Proxy at ${t} didn't answered`)}));if(i.ok)return await i.text();throw Error(`Result Proxy login failed: ${i.status} ${i.statusText}`)}catch(e){throw kb("login()",e),e}})(await this.config.resolveContractsClient(),await this.config.resolveResultProxyURL()),this.checkStorageTokenExists=async(e,{provider:t,teeFramework:r}={})=>Fy(await this.config.resolveContractsClient(),await this.config.resolveSmsURL({teeFramework:r}),e,Hm(t)),this.pushStorageToken=async(e,{provider:t,teeFramework:r,forceUpdate:n=!1}={})=>Vy(await this.config.resolveContractsClient(),await this.config.resolveSmsURL({teeFramework:r}),Hm(t),e,{forceUpdate:n})}}const Ib=v("iexec:execution:result"),Cb=async(e=bp(),t=bp(),{ipfsGatewayURL:r}={})=>{try{const n=await Gf().validate(t),i=await lm(e,n);if(3!==i.status)throw Error("Task is not completed");const{storage:a,location:s}=i.results;if("none"===a)throw Error("No result uploaded for this task");if("ipfs"!==a)throw Error(`Task result stored on ${a}, download not supported`);if(!s)throw Error("Missing location key in task results, download not supported");return await(async(e,{ipfsGatewayURL:t="https://gateway.ipfs.io"}={})=>{try{return await(r={api:t,endpoint:e},Cy("GET")({...r,headers:{Accept:"application/zip",...r.headers}}).then(Oy))}catch(e){throw Error(`Failed to download from ${t}: ${e.message}`)}var r})(s,{ipfsGatewayURL:r})}catch(e){throw Ib("fetchResults()",e),e}};class Ob extends wp{constructor(...e){super(...e),this.show=async e=>lm(await this.config.resolveContractsClient(),e),this.obsTask=async(e,{dealid:t}={})=>hm(await this.config.resolveContractsClient(),e,{dealid:t}),this.claim=async e=>(async(e=bp(),t=bp())=>{try{No(e);const r=await Gf().validate(t),n=await lm(e,r),i=n.status;if([3,4].includes(i))throw Error(`Cannot claim a task having status ${um[i.toString()]}`);if(!n.taskTimedOut)throw Error(`Cannot claim a task before reaching the consensus deadline date: ${new Date(1e3*parseInt(n.finalDeadline,10))}`);const a=e.getIExecContract(),s=await bf(a.claim(t,e.txOptions)),o=await mf(s.wait(e.confirms));if(!ko("TaskClaimed",o.events))throw Error("TaskClaimed not confirmed");return s.hash}catch(e){throw om("claim()",e),e}})(await this.config.resolveContractsClient(),e),this.fetchResults=async e=>Cb(await this.config.resolveContractsClient(),e,{ipfsGatewayURL:await this.config.resolveIpfsGatewayURL()})}}const Rb=v("iexec:wallet:send"),Nb=async(e=bp(),t=bp(),r=bp(),{defaultGasPrice:n}={})=>{try{No(e);const i=await qf({ethProvider:e.provider}).validate(r),a=await Pf().validate(t),s=ge.from(a).toHexString();if(!e.signer)throw Error("Missing Signer");const o=await bf(e.signer.sendTransaction({data:"0x",to:i,value:s,gasPrice:e.txOptions&&e.txOptions.gasPrice||n||void 0}));return await mf(o.wait(e.confirms)),o.hash}catch(e){throw Rb("sendNativeToken()",e),e}},Pb=async(e=bp(),t=bp(),r=bp())=>{No(e);const n=await qf({ethProvider:e.provider}).validate(r),i=await Df().validate(t);try{const t=await yf(e.fetchTokenContract()),r=await bf(t.transfer(n,i,e.txOptions));return await mf(r.wait(e.confirms)),r.hash}catch(e){throw Rb("sendERC20()",e),e}},Bb=async(e=bp(),t=bp(),r=bp())=>{try{No(e);const n=await qf({ethProvider:e.provider}).validate(r);"enterprise"===e.flavour&&(await Ip(e,await Tp(e),{strict:!0}),await Ip(e,r,{strict:!0}));const i=await Df().validate(t);if((await Ap(e,await Tp(e))).lt(new _(i)))throw Error("Amount to send exceed wallet balance");if(e.isNative){Rb("send native token");const t=wo(new _(i)).toString();return await Nb(e,t,n)}return Rb("send ERC20 token"),await Pb(e,i,n)}catch(e){throw Rb("sendRLC()",e),e}},Db=[{constant:!0,inputs:[{name:"_txHash",type:"bytes32"}],name:"relayedMessages",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"vs",type:"uint8[]"},{name:"rs",type:"bytes32[]"},{name:"ss",type:"bytes32[]"},{name:"message",type:"bytes"}],name:"executeSignatures",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_day",type:"uint256"}],name:"totalSpentPerDay",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"isInitialized",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_dailyLimit",type:"uint256"}],name:"setExecutionDailyLimit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getCurrentDay",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"requiredBlockConfirmations",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"executionDailyLimit",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_day",type:"uint256"}],name:"totalExecutedPerDay",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"dailyLimit",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_amount",type:"uint256"}],name:"withinExecutionLimit",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"executionMaxPerTx",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"requiredSignatures",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"owner",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"validatorContract",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"deployedAtBlock",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getBridgeInterfacesVersion",outputs:[{name:"major",type:"uint64"},{name:"minor",type:"uint64"},{name:"patch",type:"uint64"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!1,inputs:[{name:"_minPerTx",type:"uint256"}],name:"setMinPerTx",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_blockConfirmations",type:"uint256"}],name:"setRequiredBlockConfirmations",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_dailyLimit",type:"uint256"}],name:"setDailyLimit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_gasPrice",type:"uint256"}],name:"setGasPrice",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_maxPerTx",type:"uint256"}],name:"setMaxPerTx",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"upgradeabilityAdmin",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"minPerTx",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_amount",type:"uint256"}],name:"withinLimit",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_maxPerTx",type:"uint256"}],name:"setExecutionMaxPerTx",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"maxPerTx",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"gasPrice",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{anonymous:!1,inputs:[{indexed:!1,name:"recipient",type:"address"},{indexed:!1,name:"value",type:"uint256"},{indexed:!1,name:"transactionHash",type:"bytes32"}],name:"RelayedMessage",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"gasPrice",type:"uint256"}],name:"GasPriceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"requiredBlockConfirmations",type:"uint256"}],name:"RequiredBlockConfirmationChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"newLimit",type:"uint256"}],name:"DailyLimitChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"newLimit",type:"uint256"}],name:"ExecutionDailyLimitChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"previousOwner",type:"address"},{indexed:!1,name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{constant:!1,inputs:[{name:"_validatorContract",type:"address"},{name:"_erc20token",type:"address"},{name:"_requiredBlockConfirmations",type:"uint256"},{name:"_gasPrice",type:"uint256"},{name:"_maxPerTx",type:"uint256"},{name:"_homeDailyLimit",type:"uint256"},{name:"_homeMaxPerTx",type:"uint256"},{name:"_owner",type:"address"}],name:"initialize",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getBridgeMode",outputs:[{name:"_data",type:"bytes4"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!1,inputs:[{name:"_token",type:"address"},{name:"_to",type:"address"}],name:"claimTokens",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"erc20token",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"}],Lb=[{constant:!0,inputs:[{name:"_message",type:"bytes32"}],name:"numMessagesSigned",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_hash",type:"bytes32"},{name:"_index",type:"uint256"}],name:"signature",outputs:[{name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_fee",type:"uint256"}],name:"setForeignFee",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_txHash",type:"bytes32"}],name:"fixedAssets",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_day",type:"uint256"}],name:"totalSpentPerDay",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_fee",type:"uint256"}],name:"setHomeFee",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"isInitialized",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_dailyLimit",type:"uint256"}],name:"setExecutionDailyLimit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getCurrentDay",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"requiredBlockConfirmations",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"requiredMessageLength",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!0,inputs:[],name:"executionDailyLimit",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_hash",type:"bytes32"}],name:"message",outputs:[{name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_day",type:"uint256"}],name:"totalExecutedPerDay",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_feeManager",type:"address"}],name:"setFeeManagerContract",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"signature",type:"bytes"},{name:"message",type:"bytes"}],name:"submitSignature",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"txHash",type:"bytes32"},{name:"unlockOnForeign",type:"bool"}],name:"fixAssetsAboveLimits",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"dailyLimit",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_token",type:"address"},{name:"_to",type:"address"}],name:"claimTokens",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_withdrawal",type:"bytes32"}],name:"numAffirmationsSigned",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_withdrawal",type:"bytes32"}],name:"affirmationsSigned",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_amount",type:"uint256"}],name:"withinExecutionLimit",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"executionMaxPerTx",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"requiredSignatures",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"owner",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_message",type:"bytes32"}],name:"messagesSigned",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_value",type:"uint256"}],name:"getAmountToBurn",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getHomeFee",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"validatorContract",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"recipient",type:"address"},{name:"value",type:"uint256"},{name:"transactionHash",type:"bytes32"}],name:"executeAffirmation",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"deployedAtBlock",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getBridgeInterfacesVersion",outputs:[{name:"major",type:"uint64"},{name:"minor",type:"uint64"},{name:"patch",type:"uint64"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!0,inputs:[],name:"outOfLimitAmount",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_minPerTx",type:"uint256"}],name:"setMinPerTx",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_blockConfirmations",type:"uint256"}],name:"setRequiredBlockConfirmations",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_dailyLimit",type:"uint256"}],name:"setDailyLimit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_gasPrice",type:"uint256"}],name:"setGasPrice",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_maxPerTx",type:"uint256"}],name:"setMaxPerTx",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"feeManagerContract",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"upgradeabilityAdmin",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"minPerTx",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_amount",type:"uint256"}],name:"withinLimit",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_maxPerTx",type:"uint256"}],name:"setExecutionMaxPerTx",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getFeeManagerMode",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"maxPerTx",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"gasPrice",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_number",type:"uint256"}],name:"isAlreadyProcessed",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!0,inputs:[],name:"getForeignFee",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!1,name:"recipient",type:"address"},{indexed:!1,name:"value",type:"uint256"},{indexed:!1,name:"transactionHash",type:"bytes32"}],name:"AmountLimitExceeded",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"feeAmount",type:"uint256"},{indexed:!0,name:"transactionHash",type:"bytes32"}],name:"FeeDistributedFromAffirmation",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"feeAmount",type:"uint256"},{indexed:!0,name:"transactionHash",type:"bytes32"}],name:"FeeDistributedFromSignatures",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"recipient",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"UserRequestForSignature",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"recipient",type:"address"},{indexed:!1,name:"value",type:"uint256"},{indexed:!1,name:"transactionHash",type:"bytes32"}],name:"AffirmationCompleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"signer",type:"address"},{indexed:!1,name:"messageHash",type:"bytes32"}],name:"SignedForUserRequest",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"signer",type:"address"},{indexed:!1,name:"transactionHash",type:"bytes32"}],name:"SignedForAffirmation",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"authorityResponsibleForRelay",type:"address"},{indexed:!1,name:"messageHash",type:"bytes32"},{indexed:!1,name:"NumberOfCollectedSignatures",type:"uint256"}],name:"CollectedSignatures",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"gasPrice",type:"uint256"}],name:"GasPriceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"requiredBlockConfirmations",type:"uint256"}],name:"RequiredBlockConfirmationChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"newLimit",type:"uint256"}],name:"DailyLimitChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"newLimit",type:"uint256"}],name:"ExecutionDailyLimitChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"previousOwner",type:"address"},{indexed:!1,name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{constant:!1,inputs:[{name:"_validatorContract",type:"address"},{name:"_dailyLimit",type:"uint256"},{name:"_maxPerTx",type:"uint256"},{name:"_minPerTx",type:"uint256"},{name:"_homeGasPrice",type:"uint256"},{name:"_requiredBlockConfirmations",type:"uint256"},{name:"_blockReward",type:"address"},{name:"_foreignDailyLimit",type:"uint256"},{name:"_foreignMaxPerTx",type:"uint256"},{name:"_owner",type:"address"}],name:"initialize",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_validatorContract",type:"address"},{name:"_dailyLimit",type:"uint256"},{name:"_maxPerTx",type:"uint256"},{name:"_minPerTx",type:"uint256"},{name:"_homeGasPrice",type:"uint256"},{name:"_requiredBlockConfirmations",type:"uint256"},{name:"_blockReward",type:"address"},{name:"_foreignDailyLimit",type:"uint256"},{name:"_foreignMaxPerTx",type:"uint256"},{name:"_owner",type:"address"},{name:"_feeManager",type:"address"},{name:"_homeFee",type:"uint256"},{name:"_foreignFee",type:"uint256"}],name:"rewardableInitialize",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getBridgeMode",outputs:[{name:"_data",type:"bytes4"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!0,inputs:[],name:"blockRewardContract",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalBurntCoins",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_blockReward",type:"address"}],name:"setBlockRewardContract",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],Fb=v("iexec:wallet:bridge"),Ub="CHECK_BRIDGE_POLICY",jb="BRIDGE_POLICY_CHECKED",qb="CHECK_BRIDGE_LIMIT",zb="BRIDGE_LIMIT_CHECKED",Gb="SEND_TO_BRIDGE_TX_REQUEST",Kb="SEND_TO_BRIDGE_TX_SUCCESS",Hb="WAIT_RECEIVE_TX",$b="RECEIVE_TX_SUCCESS",Vb=async(e,t,{step:r=100,refBlock:n}={})=>{const i=n||await yf(e.getBlock()),a=Math.max(i.number-r,0),s=await yf(e.getBlock(a)),o=s.timestamp,u=o-t;if(u>0){const n=Math.max(i.timestamp-o,100),a=Math.min(Math.ceil(u/n*r)+5,1e3);return Vb(e,t,{refBlock:s,step:a})}return s.number},Wb=(e=bp(),t=bp(),r=bp(),{sidechainBridgeAddress:n,bridgedContracts:i}={})=>new sm((a=>{const s=new am(a);let o,u;return(async()=>{try{No(e);const a=await qf({ethProvider:e.provider}).validate(t),l=n?await qf({ethProvider:e.provider}).validate(n):void 0,h=await Df().validate(r);if(e.isNative)throw Error("Current chain is a sidechain");if((await Ap(e,await Tp(e))).lt(new _(h)))throw Error("Amount to bridge exceed wallet balance");if(s.next({message:Ub}),o)return;const c=new Vd(a,Db,e.provider),[d,f,p]=await Promise.all([yf(c.minPerTx()),yf(c.maxPerTx()),yf(c.dailyLimit())]);if(o)return;if(s.next({message:jb,minPerTx:mo(d),maxPerTx:mo(f),dailyLimit:mo(p)}),new _(h).lt(mo(d)))throw Error(`Minimum amount allowed to bridge is ${go(d.toString())} RLC`);if(new _(h).gt(mo(f)))throw Error(`Maximum amount allowed to bridge is ${go(f.toString())} RLC`);if(o)return;s.next({message:qb});const y=86400*(await yf(c.getCurrentDay())).toNumber(),m=await Vb(e.provider,y);if(o)return;const b=await yf(e.fetchTokenContract()),g=await e.provider.getLogs({fromBlock:m,toBlock:"latest",address:b.address,topics:["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}),v=b.interface;let w=new _(0);const M=async(t,r=!0)=>{if(0===t.length)return;let n=r;if(r&&(n=(await yf(e.provider.getBlock(t[0].blockNumber))).timestamp<y),!n){const e=v.parseLog(t[0]);e.args.to===a&&(w=w.add(mo(e.args.value)))}t.shift(),o||await M(t,n)};if(o)return;if(await M(g),o)return;const T=w.lt(mo(p));if(o)return;if(s.next({message:zb,totalSpentPerDay:w}),!T)throw Error(`Amount to bridge would exceed bridge daily limit. ${go(w)}/${go(p)} RLC already bridged today.`);const E=l&&i,A=E?await i.provider.getBlockNumber():0;if(o)return;s.next({message:Gb,bridgeAddress:a});const x=await Bb(e,h,a);if(o)return;if(s.next({message:Kb,bridgeAddress:a,txHash:x}),E){s.next({message:Hb,bridgeAddress:l});const e=e=>new Promise(((t,r)=>{const n=new Vd(l,Lb,i.provider),a=()=>n.removeAllListeners("AffirmationCompleted");u=()=>{a(),r(Error("aborted"))};try{n.on(n.filters.AffirmationCompleted(),((r,n,i,s)=>{i===e&&(a(),t(s))})),i.provider.resetEventsBlock(A),Fb(`watching AffirmationCompleted events from block ${A}`)}catch(e){throw a(),e}}));if(o)return;const t=(await e(x)).transactionHash;s.next({message:$b,txHash:t})}s.complete()}catch(e){Fb("obsBridgeToSidechain()",e),s.error(e)}})(),s.unsub=()=>{o=!0,u&&u()},s.unsubscribe.bind(s)})),Zb=(e=bp(),t=bp(),r=bp(),{mainchainBridgeAddress:n,bridgedContracts:i}={})=>new sm((a=>{const s=new am(a);let o,u;return(async()=>{try{No(e);const a=await qf({ethProvider:e.provider}).validate(t),l=n?await qf({ethProvider:e.provider}).validate(n):void 0,h=await Df().validate(r);if(!e.isNative)throw Error("Current chain is a mainchain");if((await Ap(e,await Tp(e))).lt(new _(h)))throw Error("Amount to bridge exceed wallet balance");const c=new Vd(a,Lb,e.provider),d=wo(new _(h)),f=d.toString();if(s.next({message:Ub}),o)return;const[p,y,m]=await Promise.all([yf(c.minPerTx()),yf(c.maxPerTx()),yf(c.dailyLimit())]);if(o)return;if(s.next({message:jb,minPerTx:mo(p),maxPerTx:mo(y),dailyLimit:mo(m)}),d.lt(mo(p)))throw Error(`Minimum amount allowed to bridge is ${go(vo(mo(p)))} RLC`);if(d.gt(mo(y)))throw Error(`Maximum amount allowed to bridge is ${go(vo(mo(y)))} RLC`);if(o)return;s.next({message:qb});const[b,g]=await Promise.all([yf(c.withinLimit(f)),yf(c.getCurrentDay().then((e=>c.totalSpentPerDay(e))))]);if(o)return;if(s.next({message:zb,totalSpentPerDay:mo(g)}),!b)throw Error(`Amount to bridge would exceed bridge daily limit. ${go(vo(mo(g)))}/${go(vo(mo(m)))} RLC already bridged today`);const v=l&&i,w=v?await yf(i.provider.getBlockNumber()):0;if(o)return;s.next({message:Gb,bridgeAddress:a});const M=await Bb(e,h,a);if(o)return;if(s.next({message:Kb,bridgeAddress:a,txHash:M}),v){s.next({message:Hb,bridgeAddress:l});const e=e=>new Promise(((t,r)=>{const n=new Vd(l,Db,i.provider),a=()=>n.removeAllListeners("RelayedMessage");u=()=>{a(),r(Error("aborted"))};try{n.on(n.filters.RelayedMessage(),((r,n,i,s)=>{i===e&&(a(),t(s))})),i.provider.resetEventsBlock(w),Fb(`watching RelayedMessage events from block ${w}`)}catch(e){throw a(),e}}));if(o)return;const t=(await e(M)).transactionHash;s.next({message:$b,txHash:t})}s.complete()}catch(e){Fb("obsBridgeToMainchain()",e),s.error(e)}})(),s.unsub=()=>{o=!0,u&&u()},s.unsubscribe.bind(s)}));class Jb extends wp{constructor(...e){super(...e),this.getAddress=async()=>Tp(await this.config.resolveContractsClient()),this.checkBalances=async e=>kp(await this.config.resolveContractsClient(),e),this.checkBridgedBalances=async e=>kp(await this.config.resolveBridgedContractsClient(),e),this.sendETH=async(e,t)=>(async(e=bp(),t=bp(),r=bp())=>{try{No(e);const n=await qf({ethProvider:e.provider}).validate(r),i=await(({defaultUnit:e="wei"}={})=>ys().transform(((e,t)=>{if(Array.isArray(t)){if(t.length>2)throw new za(Bf({originalValue:t}));return 2===t.length&&t[1]?`${t[0]} ${t[1]}`:`${t[0]}`}return e})).transform((e=>{const[t,r]=e.split(" "),n=t.replace(/^0+/,""),i=n.length>0?n:"0";return void 0!==r?[i,r].join(" "):i})).transform(((t,r)=>{try{return((e,t="ether")=>{const[r,n]=bo(e).split(" "),i=void 0!==n?n:t;if(!["wei","kwei","mwei","gwei","szabo","finney","ether","eth"].includes(i))throw Error("Invalid ether unit");try{return mo(ho(r,"eth"===i?"ether":i))}catch(e){throw fo("formatEth()",e),Error("Invalid ether amount")}})(t,e).toString()}catch(e){throw new za(Bf({originalValue:r}))}})).matches(/^[0-9]*$/,Bf))().validate(t);if(e.isNative)throw Error("sendETH() is disabled on sidechain, use sendRLC()");if((await xp(e,await Tp(e))).lt(new _(i)))throw Error("Amount to send exceed wallet balance");return await Nb(e,i,n)}catch(e){throw Rb("sendETH()",e),e}})(await this.config.resolveContractsClient(),e,t),this.sendRLC=async(e,t)=>Bb(await this.config.resolveContractsClient(),e,t),this.sweep=async e=>(async(e=bp(),t=bp())=>{try{No(e);const r=await qf({ethProvider:e.provider}).validate(t),n=await Tp(e);if("0x"!==await e.provider.getCode(r))throw new Error("Cannot sweep to a contract");"enterprise"===e.flavour&&(await Ip(e,await Tp(e),{strict:!0}),await Ip(e,t,{strict:!0}));let i=await kp(e,n);const a={},s=[];if(!e.isNative&&i.nRLC.gt(new _(0))){try{const t=await Pb(e,yo(i.nRLC),r);Object.assign(a,{sendERC20TxHash:t})}catch(e){throw Rb("error",e),s.push(`Failed to transfer ERC20': ${e.message}`),Error(`Failed to sweep ERC20, sweep aborted. errors: ${s}`)}i=await kp(e,n)}const o=e.txOptions&&e.txOptions.gasPrice?mo(ge.from(e.txOptions.gasPrice)):mo(await e.provider.getGasPrice()),u=new _(21e3),l=o.mul(u),h=i.wei.sub(l);if(i.wei.gt(new _(l)))try{const t=await Nb(e,yo(h),r,{defaultGasPrice:o.toString()});Object.assign(a,{sendNativeTxHash:t})}catch(e){Rb(e),s.push(`Failed to transfer native token': ${e.message}`)}else{const e="Tx fees are greater than wallet balance";Rb(e),s.push(`Failed to transfer native token': ${e}`)}return s.length>0&&Object.assign(a,{errors:s}),a}catch(e){throw Rb("sweep()",e),e}})(await this.config.resolveContractsClient(),e),this.bridgeToSidechain=async e=>(async(e=bp(),t=bp(),r=bp(),{sidechainBridgeAddress:n,bridgedContracts:i}={})=>{let a,s;No(e);try{return await new Promise(((o,u)=>{Wb(e,t,r,{sidechainBridgeAddress:n,bridgedContracts:i}).subscribe({next:({message:e,...t})=>{e===Kb&&(a=t.txHash),e===$b&&(s=t.txHash),Fb(e,t)},error:u,complete:o})})),{sendTxHash:a,receiveTxHash:s}}catch(e){if(Fb("bridgeToSidechain()",e),a)throw new qs(e,a);throw e}})(await this.config.resolveContractsClient(),await this.config.resolveBridgeAddress(),e,{bridgedContracts:await this.config.resolveBridgedContractsClient(),sidechainBridgeAddress:await this.config.resolveBridgeBackAddress()}),this.bridgeToMainchain=async e=>(async(e=bp(),t=bp(),r=bp(),{mainchainBridgeAddress:n,bridgedContracts:i}={})=>{let a,s;No(e);try{return await new Promise(((o,u)=>{Zb(e,t,r,{mainchainBridgeAddress:n,bridgedContracts:i}).subscribe({next:({message:e,...t})=>{e===Kb&&(a=t.txHash),e===$b&&(s=t.txHash),Fb(e,t)},error:u,complete:o})})),{sendTxHash:a,receiveTxHash:s}}catch(e){if(Fb("bridgeToMainchain()",e),a)throw new qs(e,a);throw e}})(await this.config.resolveContractsClient(),await this.config.resolveBridgeAddress(),e,{bridgedContracts:await this.config.resolveBridgedContractsClient(),mainchainBridgeAddress:await this.config.resolveBridgeBackAddress()}),this.obsBridgeToSidechain=async e=>Wb(await this.config.resolveContractsClient(),await this.config.resolveBridgeAddress(),e,{bridgedContracts:await this.config.resolveBridgedContractsClient(),sidechainBridgeAddress:await this.config.resolveBridgeBackAddress()}),this.obsBridgeToMainchain=async e=>Zb(await this.config.resolveContractsClient(),await this.config.resolveBridgeAddress(),e,{bridgedContracts:await this.config.resolveBridgedContractsClient(),mainchainBridgeAddress:await this.config.resolveBridgeBackAddress()}),this.wrapEnterpriseRLC=async e=>(async(e=bp(),t,r=bp())=>{if(No(e),"standard"!==e.flavour||e.isNative)throw Error("Unable to wrap RLC into eRLC on current chain");if(!t)throw Error("Unable to find eRLC on current chain");const n=await Df().validate(r);if(await Ip(t,await Tp(e),{strict:!0}),(await Ap(e,await Tp(e))).lt(new _(n)))throw Error("Amount to wrap exceed wallet balance");try{const r=await yf(t.fetchTokenAddress()),i=await yf(e.fetchTokenContract()),a=await bf(i.approveAndCall(r,n,Zs,e.txOptions));return await mf(a.wait(e.confirms)),a.hash}catch(e){throw Sp("wrapEnterpriseRLC()",e),e}})(await this.config.resolveStandardContractsClient(),await this.config.resolveEnterpriseContractsClient(),e),this.unwrapEnterpriseRLC=async e=>(async(e=bp(),t=bp())=>{if(No(e),"enterprise"!==e.flavour||e.isNative)throw Error("Unable to unwrap eRLC into RLC on current chain");const r=await Df().validate(t);if(await Ip(e,await Tp(e),{strict:!0}),(await Ap(e,await Tp(e))).lt(new _(r)))throw Error("Amount to unwrap exceed wallet balance");try{const t=await yf(e.fetchTokenContract()),n=await bf(t.withdraw(r));return await mf(n.wait(e.confirms)),n.hash}catch(e){throw Sp("unwrapEnterpriseRLC()",e),e}})(await this.config.resolveEnterpriseContractsClient(),e)}}const Yb=v("iexec:execution:workerpool"),Xb=v("iexec:execution:debug");class Qb extends wp{constructor(...e){super(...e),this.deployWorkerpool=async e=>(async(e,t)=>qp(Ks)(e,await cp({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),e),this.showWorkerpool=async e=>(async(e=bp(),t=bp())=>{const{obj:r,objAddress:n}=await $p(Ks)(e,await qf({ethProvider:e.provider}).validate(t));return{objAddress:n,workerpool:Zp(r)}})(await this.config.resolveContractsClient(),e),this.showUserWorkerpool=async(e,t)=>(async(e=bp(),t=bp(),r=bp())=>{const{obj:n,objAddress:i}=await Wp(Ks)(e,await Pf().validate(t),await qf({ethProvider:e.provider}).validate(r));return{objAddress:i,workerpool:Zp(n)}})(await this.config.resolveContractsClient(),e,t),this.countUserWorkerpools=async e=>(async(e=bp(),t=bp())=>Vp(Ks)(e,await qf({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),e),this.setWorkerpoolApiUrl=async(e,t)=>(async(e=bp(),t,r)=>{try{const n=await qf({ethProvider:e.provider}).validate(t),i=await yp().label("workerpool API url").validate(r),a=await xm(e,n);if(!a)throw Error(`No ENS name reverse resolution configured for ${n}`);return await jm(e,a,Qs,i)}catch(e){throw Yb("setWorkerpoolApiUrl()",e),e}})(await this.config.resolveContractsClient(),e,t),this.getWorkerpoolApiUrl=async e=>(async(e=bp(),t)=>{try{const r=await qf({ethProvider:e.provider}).label("workerpool address").validate(t),n=await xm(e,r).catch((()=>{}));if(!n)return;const i=await Um(e,n,Qs);return await yp().required().validate(i).catch((()=>{}))}catch(e){throw Xb("getWorkerpoolApiUrl()",e),e}})(await this.config.resolveContractsClient(),e),this.predictWorkerpoolAddress=async e=>(async(e,t)=>jp(Ks)(e,await cp({ethProvider:e.provider}).validate(t)))(await this.config.resolveContractsClient(),e),this.checkDeployedWorkerpool=async e=>Lp(await this.config.resolveContractsClient(),e)}}class eg extends wp{constructor(...e){super(...e),this.wallet=Jb.fromConfig(this.config),this.account=Op.fromConfig(this.config),this.app=Wy.fromConfig(this.config),this.dataset=Yy.fromConfig(this.config),this.workerpool=Qb.fromConfig(this.config),this.hub=zm.fromConfig(this.config),this.deal=vm.fromConfig(this.config),this.order=_b.fromConfig(this.config),this.orderbook=Eb.fromConfig(this.config),this.task=Ob.fromConfig(this.config),this.result=Ab.fromConfig(this.config),this.secrets=xb.fromConfig(this.config),this.storage=Sb.fromConfig(this.config),this.ens=qm.fromConfig(this.config),this.network=Gm.fromConfig(this.config)}}const tg="web3mail.apps.iexec.eth",rg="prod-v8-bellecour.main.pools.iexec.eth";class ng extends Error{constructor(e,t){super(e),this.name=this.constructor.name,this.originalError=t}}const ig=({request:e},{orders:t=[]}={})=>{return r=void 0,n=void 0,a=function*(){const r=yield e,n=r.count;return r.orders.length>0&&(t.push(...r.orders),r.more&&"function"==typeof r.more)?ig({request:r.more()},{orders:t}):{orders:t,count:n}},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{u(a.next(e))}catch(e){t(e)}}function o(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(s,o)}u((a=a.apply(r,n||[])).next())}));var r,n,i,a},ag=JSON;function sg(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}const og=/\r\n|[\n\r]/g;function ug(e,t){let r=0,n=1;for(const i of e.body.matchAll(og)){if("number"==typeof i.index||sg(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}function lg(e,t){const r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,s=t.line+a,o=1===t.line?r:0,u=t.column+o,l=`${e.name}:${s}:${u}\n`,h=n.split(/\r\n|[\n\r]/g),c=h[i];if(c.length>120){const e=Math.floor(u/80),t=u%80,r=[];for(let e=0;e<c.length;e+=80)r.push(c.slice(e,e+80));return l+hg([[`${s} |`,r[0]],...r.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",r[e+1]]])}return l+hg([[s-1+" |",h[i-1]],[`${s} |`,c],["|","^".padStart(u)],[`${s+1} |`,h[i+1]]])}function hg(e){const t=e.filter((([e,t])=>void 0!==t)),r=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(r)+(t?" "+t:""))).join("\n")}class cg extends Error{constructor(e,...t){var r,n,i;const{nodes:a,source:s,positions:o,path:u,originalError:l,extensions:h}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=u?u:void 0,this.originalError=null!=l?l:void 0,this.nodes=dg(Array.isArray(a)?a:a?[a]:void 0);const c=dg(null===(r=this.nodes)||void 0===r?void 0:r.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=s?s:null==c||null===(n=c[0])||void 0===n?void 0:n.source,this.positions=null!=o?o:null==c?void 0:c.map((e=>e.start)),this.locations=o&&s?o.map((e=>ug(s,e))):null==c?void 0:c.map((e=>ug(e.source,e.start)));const d="object"==typeof(f=null==l?void 0:l.extensions)&&null!==f?null==l?void 0:l.extensions:void 0;var f;this.extensions=null!==(i=null!=h?h:d)&&void 0!==i?i:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=l&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,cg):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const r of this.nodes)r.loc&&(e+="\n\n"+lg((t=r.loc).source,ug(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+lg(this.source,t);var t;return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function dg(e){return void 0===e||0===e.length?void 0:e}function fg(e,t,r){return new cg(`Syntax Error: ${r}`,{source:e,positions:[t]})}class pg{constructor(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class yg{constructor(e,t,r,n,i,a){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const mg={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},bg=new Set(Object.keys(mg));function gg(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&bg.has(t)}var vg,wg,_g,Mg,Tg,Eg;function Ag(e){return 9===e||32===e}function xg(e){return e>=48&&e<=57}function kg(e){return e>=97&&e<=122||e>=65&&e<=90}function Sg(e){return kg(e)||95===e}function Ig(e){var t;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let t=0;t<e.length;++t){var a;const s=e[t],o=Cg(s);o!==s.length&&(n=null!==(a=n)&&void 0!==a?a:t,i=t,0!==t&&o<r&&(r=o))}return e.map(((e,t)=>0===t?e:e.slice(r))).slice(null!==(t=n)&&void 0!==t?t:0,i+1)}function Cg(e){let t=0;for(;t<e.length&&Ag(e.charCodeAt(t));)++t;return t}!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(vg||(vg={})),function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(wg||(wg={})),(Eg=_g||(_g={})).NAME="Name",Eg.DOCUMENT="Document",Eg.OPERATION_DEFINITION="OperationDefinition",Eg.VARIABLE_DEFINITION="VariableDefinition",Eg.SELECTION_SET="SelectionSet",Eg.FIELD="Field",Eg.ARGUMENT="Argument",Eg.FRAGMENT_SPREAD="FragmentSpread",Eg.INLINE_FRAGMENT="InlineFragment",Eg.FRAGMENT_DEFINITION="FragmentDefinition",Eg.VARIABLE="Variable",Eg.INT="IntValue",Eg.FLOAT="FloatValue",Eg.STRING="StringValue",Eg.BOOLEAN="BooleanValue",Eg.NULL="NullValue",Eg.ENUM="EnumValue",Eg.LIST="ListValue",Eg.OBJECT="ObjectValue",Eg.OBJECT_FIELD="ObjectField",Eg.DIRECTIVE="Directive",Eg.NAMED_TYPE="NamedType",Eg.LIST_TYPE="ListType",Eg.NON_NULL_TYPE="NonNullType",Eg.SCHEMA_DEFINITION="SchemaDefinition",Eg.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",Eg.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",Eg.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",Eg.FIELD_DEFINITION="FieldDefinition",Eg.INPUT_VALUE_DEFINITION="InputValueDefinition",Eg.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",Eg.UNION_TYPE_DEFINITION="UnionTypeDefinition",Eg.ENUM_TYPE_DEFINITION="EnumTypeDefinition",Eg.ENUM_VALUE_DEFINITION="EnumValueDefinition",Eg.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",Eg.DIRECTIVE_DEFINITION="DirectiveDefinition",Eg.SCHEMA_EXTENSION="SchemaExtension",Eg.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",Eg.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",Eg.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",Eg.UNION_TYPE_EXTENSION="UnionTypeExtension",Eg.ENUM_TYPE_EXTENSION="EnumTypeExtension",Eg.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",(Tg=Mg||(Mg={})).SOF="<SOF>",Tg.EOF="<EOF>",Tg.BANG="!",Tg.DOLLAR="$",Tg.AMP="&",Tg.PAREN_L="(",Tg.PAREN_R=")",Tg.SPREAD="...",Tg.COLON=":",Tg.EQUALS="=",Tg.AT="@",Tg.BRACKET_L="[",Tg.BRACKET_R="]",Tg.BRACE_L="{",Tg.PIPE="|",Tg.BRACE_R="}",Tg.NAME="Name",Tg.INT="Int",Tg.FLOAT="Float",Tg.STRING="String",Tg.BLOCK_STRING="BlockString",Tg.COMMENT="Comment";class Og{constructor(e){const t=new yg(Mg.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==Mg.EOF)do{if(e.next)e=e.next;else{const t=Fg(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Mg.COMMENT);return e}}function Rg(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Ng(e,t){return Pg(e.charCodeAt(t))&&Bg(e.charCodeAt(t+1))}function Pg(e){return e>=55296&&e<=56319}function Bg(e){return e>=56320&&e<=57343}function Dg(e,t){const r=e.source.body.codePointAt(t);if(void 0===r)return Mg.EOF;if(r>=32&&r<=126){const e=String.fromCodePoint(r);return'"'===e?"'\"'":`"${e}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function Lg(e,t,r,n,i){const a=e.line,s=1+r-e.lineStart;return new yg(t,r,n,a,s,i)}function Fg(e,t){const r=e.source.body,n=r.length;let i=t;for(;i<n;){const t=r.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===r.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Ug(e,i);case 33:return Lg(e,Mg.BANG,i,i+1);case 36:return Lg(e,Mg.DOLLAR,i,i+1);case 38:return Lg(e,Mg.AMP,i,i+1);case 40:return Lg(e,Mg.PAREN_L,i,i+1);case 41:return Lg(e,Mg.PAREN_R,i,i+1);case 46:if(46===r.charCodeAt(i+1)&&46===r.charCodeAt(i+2))return Lg(e,Mg.SPREAD,i,i+3);break;case 58:return Lg(e,Mg.COLON,i,i+1);case 61:return Lg(e,Mg.EQUALS,i,i+1);case 64:return Lg(e,Mg.AT,i,i+1);case 91:return Lg(e,Mg.BRACKET_L,i,i+1);case 93:return Lg(e,Mg.BRACKET_R,i,i+1);case 123:return Lg(e,Mg.BRACE_L,i,i+1);case 124:return Lg(e,Mg.PIPE,i,i+1);case 125:return Lg(e,Mg.BRACE_R,i,i+1);case 34:return 34===r.charCodeAt(i+1)&&34===r.charCodeAt(i+2)?Wg(e,i):zg(e,i)}if(xg(t)||45===t)return jg(e,i,t);if(Sg(t))return Zg(e,i);throw fg(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Rg(t)||Ng(r,i)?`Unexpected character: ${Dg(e,i)}.`:`Invalid character: ${Dg(e,i)}.`)}return Lg(e,Mg.EOF,n,n)}function Ug(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const e=r.charCodeAt(i);if(10===e||13===e)break;if(Rg(e))++i;else{if(!Ng(r,i))break;i+=2}}return Lg(e,Mg.COMMENT,t,i,r.slice(t+1,i))}function jg(e,t,r){const n=e.source.body;let i=t,a=r,s=!1;if(45===a&&(a=n.charCodeAt(++i)),48===a){if(a=n.charCodeAt(++i),xg(a))throw fg(e.source,i,`Invalid number, unexpected digit after 0: ${Dg(e,i)}.`)}else i=qg(e,i,a),a=n.charCodeAt(i);if(46===a&&(s=!0,a=n.charCodeAt(++i),i=qg(e,i,a),a=n.charCodeAt(i)),69!==a&&101!==a||(s=!0,a=n.charCodeAt(++i),43!==a&&45!==a||(a=n.charCodeAt(++i)),i=qg(e,i,a),a=n.charCodeAt(i)),46===a||Sg(a))throw fg(e.source,i,`Invalid number, expected digit but got: ${Dg(e,i)}.`);return Lg(e,s?Mg.FLOAT:Mg.INT,t,i,n.slice(t,i))}function qg(e,t,r){if(!xg(r))throw fg(e.source,t,`Invalid number, expected digit but got: ${Dg(e,t)}.`);const n=e.source.body;let i=t+1;for(;xg(n.charCodeAt(i));)++i;return i}function zg(e,t){const r=e.source.body,n=r.length;let i=t+1,a=i,s="";for(;i<n;){const n=r.charCodeAt(i);if(34===n)return s+=r.slice(a,i),Lg(e,Mg.STRING,t,i+1,s);if(92!==n){if(10===n||13===n)break;if(Rg(n))++i;else{if(!Ng(r,i))throw fg(e.source,i,`Invalid character within String: ${Dg(e,i)}.`);i+=2}}else{s+=r.slice(a,i);const t=117===r.charCodeAt(i+1)?123===r.charCodeAt(i+2)?Gg(e,i):Kg(e,i):Vg(e,i);s+=t.value,i+=t.size,a=i}}throw fg(e.source,i,"Unterminated string.")}function Gg(e,t){const r=e.source.body;let n=0,i=3;for(;i<12;){const e=r.charCodeAt(t+i++);if(125===e){if(i<5||!Rg(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|$g(e),n<0)break}throw fg(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+i)}".`)}function Kg(e,t){const r=e.source.body,n=Hg(r,t+2);if(Rg(n))return{value:String.fromCodePoint(n),size:6};if(Pg(n)&&92===r.charCodeAt(t+6)&&117===r.charCodeAt(t+7)){const e=Hg(r,t+8);if(Bg(e))return{value:String.fromCodePoint(n,e),size:12}}throw fg(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+6)}".`)}function Hg(e,t){return $g(e.charCodeAt(t))<<12|$g(e.charCodeAt(t+1))<<8|$g(e.charCodeAt(t+2))<<4|$g(e.charCodeAt(t+3))}function $g(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Vg(e,t){const r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw fg(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function Wg(e,t){const r=e.source.body,n=r.length;let i=e.lineStart,a=t+3,s=a,o="";const u=[];for(;a<n;){const n=r.charCodeAt(a);if(34===n&&34===r.charCodeAt(a+1)&&34===r.charCodeAt(a+2)){o+=r.slice(s,a),u.push(o);const n=Lg(e,Mg.BLOCK_STRING,t,a+3,Ig(u).join("\n"));return e.line+=u.length-1,e.lineStart=i,n}if(92!==n||34!==r.charCodeAt(a+1)||34!==r.charCodeAt(a+2)||34!==r.charCodeAt(a+3))if(10!==n&&13!==n)if(Rg(n))++a;else{if(!Ng(r,a))throw fg(e.source,a,`Invalid character within String: ${Dg(e,a)}.`);a+=2}else o+=r.slice(s,a),u.push(o),13===n&&10===r.charCodeAt(a+1)?a+=2:++a,o="",s=a,i=a;else o+=r.slice(s,a),s=a+1,a+=4}throw fg(e.source,a,"Unterminated string.")}function Zg(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n&&(kg(a=r.charCodeAt(i))||xg(a)||95===a);)++i;var a;return Lg(e,Mg.NAME,t,i,r.slice(t,i))}function Jg(e,t){if(!Boolean(e))throw new Error(t)}const Yg=10,Xg=2;function Qg(e){return ev(e,[])}function ev(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:ev(t,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>Xg)return"[Array]";const r=Math.min(Yg,e.length),n=e.length-r,i=[];for(let n=0;n<r;++n)i.push(ev(e[n],t));return 1===n?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}(e,r);return function(e,t){const r=Object.entries(e);if(0===r.length)return"{}";if(t.length>Xg)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const n=r.map((([e,r])=>e+": "+ev(r,t)));return"{ "+n.join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}class tv{constructor(e,t="GraphQL request",r={line:1,column:1}){"string"==typeof e||Jg(!1,`Body must be a string. Received: ${Qg(e)}.`),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||Jg(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Jg(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class rv{constructor(e,t={}){const r=function(e){return e instanceof tv}(e)?e:new tv(e);this._lexer=new Og(r),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(Mg.NAME);return this.node(e,{kind:_g.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:_g.DOCUMENT,definitions:this.many(Mg.SOF,this.parseDefinition,Mg.EOF)})}parseDefinition(){if(this.peek(Mg.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===Mg.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw fg(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(Mg.BRACE_L))return this.node(e,{kind:_g.OPERATION_DEFINITION,operation:vg.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let r;return this.peek(Mg.NAME)&&(r=this.parseName()),this.node(e,{kind:_g.OPERATION_DEFINITION,operation:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Mg.NAME);switch(e.value){case"query":return vg.QUERY;case"mutation":return vg.MUTATION;case"subscription":return vg.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Mg.PAREN_L,this.parseVariableDefinition,Mg.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:_g.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Mg.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Mg.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Mg.DOLLAR),this.node(e,{kind:_g.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:_g.SELECTION_SET,selections:this.many(Mg.BRACE_L,this.parseSelection,Mg.BRACE_R)})}parseSelection(){return this.peek(Mg.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let r,n;return this.expectOptionalToken(Mg.COLON)?(r=t,n=this.parseName()):n=t,this.node(e,{kind:_g.FIELD,alias:r,name:n,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Mg.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Mg.PAREN_L,t,Mg.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,r=this.parseName();return this.expectToken(Mg.COLON),this.node(t,{kind:_g.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Mg.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(Mg.NAME)?this.node(e,{kind:_g.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:_g.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:_g.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:_g.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case Mg.BRACKET_L:return this.parseList(e);case Mg.BRACE_L:return this.parseObject(e);case Mg.INT:return this.advanceLexer(),this.node(t,{kind:_g.INT,value:t.value});case Mg.FLOAT:return this.advanceLexer(),this.node(t,{kind:_g.FLOAT,value:t.value});case Mg.STRING:case Mg.BLOCK_STRING:return this.parseStringLiteral();case Mg.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:_g.BOOLEAN,value:!0});case"false":return this.node(t,{kind:_g.BOOLEAN,value:!1});case"null":return this.node(t,{kind:_g.NULL});default:return this.node(t,{kind:_g.ENUM,value:t.value})}case Mg.DOLLAR:if(e){if(this.expectToken(Mg.DOLLAR),this._lexer.token.kind===Mg.NAME){const e=this._lexer.token.value;throw fg(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:_g.STRING,value:e.value,block:e.kind===Mg.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:_g.LIST,values:this.any(Mg.BRACKET_L,(()=>this.parseValueLiteral(e)),Mg.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:_g.OBJECT,fields:this.any(Mg.BRACE_L,(()=>this.parseObjectField(e)),Mg.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,r=this.parseName();return this.expectToken(Mg.COLON),this.node(t,{kind:_g.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Mg.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Mg.AT),this.node(t,{kind:_g.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Mg.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(Mg.BRACKET_R),t=this.node(e,{kind:_g.LIST_TYPE,type:r})}else t=this.parseNamedType();return this.expectOptionalToken(Mg.BANG)?this.node(e,{kind:_g.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:_g.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Mg.STRING)||this.peek(Mg.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.many(Mg.BRACE_L,this.parseOperationTypeDefinition,Mg.BRACE_R);return this.node(e,{kind:_g.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Mg.COLON);const r=this.parseNamedType();return this.node(e,{kind:_g.OPERATION_TYPE_DEFINITION,operation:t,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();return this.node(e,{kind:_g.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:_g.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Mg.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Mg.BRACE_L,this.parseFieldDefinition,Mg.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(Mg.COLON);const i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:_g.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(Mg.PAREN_L,this.parseInputValueDef,Mg.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(Mg.COLON);const n=this.parseTypeReference();let i;this.expectOptionalToken(Mg.EQUALS)&&(i=this.parseConstValueLiteral());const a=this.parseConstDirectives();return this.node(e,{kind:_g.INPUT_VALUE_DEFINITION,description:t,name:r,type:n,defaultValue:i,directives:a})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:_g.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:_g.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Mg.EQUALS)?this.delimitedMany(Mg.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:_g.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Mg.BRACE_L,this.parseEnumValueDefinition,Mg.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseEnumValueName(),n=this.parseConstDirectives();return this.node(e,{kind:_g.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw fg(this._lexer.source,this._lexer.token.start,`${nv(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:_g.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Mg.BRACE_L,this.parseInputValueDef,Mg.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Mg.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),r=this.optionalMany(Mg.BRACE_L,this.parseOperationTypeDefinition,Mg.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:_g.SCHEMA_EXTENSION,directives:t,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),r=this.parseConstDirectives();if(0===r.length)throw this.unexpected();return this.node(e,{kind:_g.SCALAR_TYPE_EXTENSION,name:t,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:_g.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:_g.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:_g.UNION_TYPE_EXTENSION,name:t,directives:r,types:n})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:_g.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:_g.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Mg.AT);const r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const a=this.parseDirectiveLocations();return this.node(e,{kind:_g.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:a})}parseDirectiveLocations(){return this.delimitedMany(Mg.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(wg,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new pg(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw fg(this._lexer.source,t.start,`Expected ${iv(e)}, found ${nv(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==Mg.NAME||t.value!==e)throw fg(this._lexer.source,t.start,`Expected "${e}", found ${nv(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===Mg.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return fg(this._lexer.source,t.start,`Unexpected ${nv(t)}.`)}any(e,t,r){this.expectToken(e);const n=[];for(;!this.expectOptionalToken(r);)n.push(t.call(this));return n}optionalMany(e,t,r){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(r));return e}return[]}many(e,t,r){this.expectToken(e);const n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}delimitedMany(e,t){this.expectOptionalToken(e);const r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==Mg.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw fg(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function nv(e){const t=e.value;return iv(e.kind)+(null!=t?` "${t}"`:"")}function iv(e){return function(e){return e===Mg.BANG||e===Mg.DOLLAR||e===Mg.AMP||e===Mg.PAREN_L||e===Mg.PAREN_R||e===Mg.SPREAD||e===Mg.COLON||e===Mg.EQUALS||e===Mg.AT||e===Mg.BRACKET_L||e===Mg.BRACKET_R||e===Mg.BRACE_L||e===Mg.PIPE||e===Mg.BRACE_R}(e)?`"${e}"`:e}const av=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function sv(e){return ov[e.charCodeAt(0)]}const ov=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],uv=Object.freeze({});function lv(e,t){const r=e[t];return"object"==typeof r?r:"function"==typeof r?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}const hv={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>cv(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=fv("(",cv(e.variableDefinitions,", "),")"),r=cv([e.operation,cv([e.name,t]),cv(e.directives," ")]," ");return("query"===r?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+fv(" = ",r)+fv(" ",cv(n," "))},SelectionSet:{leave:({selections:e})=>dv(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const a=fv("",e,": ")+t;let s=a+fv("(",cv(r,", "),")");return s.length>80&&(s=a+fv("(\n",pv(cv(r,"\n")),"\n)")),cv([s,cv(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+fv(" ",cv(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>cv(["...",fv("on ",e),cv(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${fv("(",cv(r,", "),")")} on ${t} ${fv("",cv(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e,t){const r=e.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=1===n.length,a=n.length>1&&n.slice(1).every((e=>0===e.length||Ag(e.charCodeAt(0)))),s=r.endsWith('\\"""'),o=e.endsWith('"')&&!s,u=e.endsWith("\\"),l=o||u,h=!i||e.length>70||l||a||s;let c="";const d=i&&Ag(e.charCodeAt(0));return(h&&!d||a)&&(c+="\n"),c+=r,(h||l)&&(c+="\n"),'"""'+c+'"""'}(e):`"${e.replace(av,sv)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+cv(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+cv(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+fv("(",cv(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>fv("",e,"\n")+cv(["schema",cv(t," "),dv(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>fv("",e,"\n")+cv(["scalar",t,cv(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>fv("",e,"\n")+cv(["type",t,fv("implements ",cv(r," & ")),cv(n," "),dv(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>fv("",e,"\n")+t+(yv(r)?fv("(\n",pv(cv(r,"\n")),"\n)"):fv("(",cv(r,", "),")"))+": "+n+fv(" ",cv(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>fv("",e,"\n")+cv([t+": "+r,fv("= ",n),cv(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>fv("",e,"\n")+cv(["interface",t,fv("implements ",cv(r," & ")),cv(n," "),dv(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>fv("",e,"\n")+cv(["union",t,cv(r," "),fv("= ",cv(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>fv("",e,"\n")+cv(["enum",t,cv(r," "),dv(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>fv("",e,"\n")+cv([t,cv(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>fv("",e,"\n")+cv(["input",t,cv(r," "),dv(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>fv("",e,"\n")+"directive @"+t+(yv(r)?fv("(\n",pv(cv(r,"\n")),"\n)"):fv("(",cv(r,", "),")"))+(n?" repeatable":"")+" on "+cv(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>cv(["extend schema",cv(e," "),dv(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>cv(["extend scalar",e,cv(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>cv(["extend type",e,fv("implements ",cv(t," & ")),cv(r," "),dv(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>cv(["extend interface",e,fv("implements ",cv(t," & ")),cv(r," "),dv(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>cv(["extend union",e,cv(t," "),fv("= ",cv(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>cv(["extend enum",e,cv(t," "),dv(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>cv(["extend input",e,cv(t," "),dv(r)]," ")}};function cv(e,t=""){var r;return null!==(r=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==r?r:""}function dv(e){return fv("{\n",pv(cv(e,"\n")),"\n}")}function fv(e,t,r=""){return null!=t&&""!==t?e+t+r:""}function pv(e){return fv(" ",e.replace(/\n/g,"\n "))}function yv(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}const mv=e=>{let t;const r=e.definitions.filter((e=>"OperationDefinition"===e.kind));return 1===r.length&&(t=r[0]?.name?.value),t},bv=e=>{if("string"==typeof e){let t;try{const r=new rv(e,void 0).parseDocument();t=mv(r)}catch(e){}return{query:e,operationName:t}}const t=mv(e);return{query:(r=e,function(e,t,r=mg){const n=new Map;for(const e of Object.values(_g))n.set(e,lv(t,e));let i,a,s,o=Array.isArray(e),u=[e],l=-1,h=[],c=e;const d=[],f=[];do{l++;const e=l===u.length,b=e&&0!==h.length;if(e){if(a=0===f.length?void 0:d[d.length-1],c=s,s=f.pop(),b)if(o){c=c.slice();let e=0;for(const[t,r]of h){const n=t-e;null===r?(c.splice(n,1),e++):c[n]=r}}else{c=Object.defineProperties({},Object.getOwnPropertyDescriptors(c));for(const[e,t]of h)c[e]=t}l=i.index,u=i.keys,h=i.edits,o=i.inArray,i=i.prev}else if(s){if(a=o?l:u[l],c=s[a],null==c)continue;d.push(a)}let g;if(!Array.isArray(c)){var p,y;gg(c)||Jg(!1,`Invalid AST Node: ${Qg(c)}.`);const r=e?null===(p=n.get(c.kind))||void 0===p?void 0:p.leave:null===(y=n.get(c.kind))||void 0===y?void 0:y.enter;if(g=null==r?void 0:r.call(t,c,a,s,d,f),g===uv)break;if(!1===g){if(!e){d.pop();continue}}else if(void 0!==g&&(h.push([a,g]),!e)){if(!gg(g)){d.pop();continue}c=g}}var m;void 0===g&&b&&h.push([a,c]),e?d.pop():(i={inArray:o,index:l,keys:u,edits:h,prev:i},o=Array.isArray(c),u=o?c:null!==(m=r[c.kind])&&void 0!==m?m:[],l=-1,h=[],s&&f.push(s),s=c)}while(void 0!==i);return 0!==h.length?h[h.length-1][1]:e}(r,hv)),operationName:t};var r};class gv extends Error{constructor(e,t){super(`${gv.extractMessage(e)}: ${JSON.stringify({response:e,request:t})}`),Object.setPrototypeOf(this,gv.prototype),this.response=e,this.request=t,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,gv)}static extractMessage(e){return e.errors?.[0]?.message??`GraphQL Error (Code: ${e.status})`}}const vv=e=>{let t={};return e&&("undefined"!=typeof Headers&&e instanceof Headers||ey&&Qp.Headers&&e instanceof Qp.Headers?t=(e=>{const t={};return e.forEach(((e,r)=>{t[r]=e})),t})(e):Array.isArray(e)?e.forEach((([e,r])=>{e&&void 0!==r&&(t[e]=r)})):t=e),t},wv=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim();class _v{constructor(e,t={}){this.url=e,this.requestConfig=t,this.rawRequest=async(...e)=>{const[t,r,n]=e,i=((e,t,r)=>e.query?e:{query:e,variables:t,requestHeaders:r,signal:void 0})(t,r,n),{headers:a,fetch:s=Qp,method:o="POST",requestMiddleware:u,responseMiddleware:l,...h}=this.requestConfig,{url:c}=this;void 0!==i.signal&&(h.signal=i.signal);const{operationName:d}=bv(i.query);return Mv({url:c,query:i.query,variables:i.variables,headers:{...vv(Av(a)),...vv(i.requestHeaders)},operationName:d,fetch:s,method:o,fetchOptions:h,middleware:u}).then((e=>(l&&l(e),e))).catch((e=>{throw l&&l(e),e}))}}async request(e,...t){const[r,n]=t,i=((e,t,r)=>e.document?e:{document:e,variables:t,requestHeaders:r,signal:void 0})(e,r,n),{headers:a,fetch:s=Qp,method:o="POST",requestMiddleware:u,responseMiddleware:l,...h}=this.requestConfig,{url:c}=this;void 0!==i.signal&&(h.signal=i.signal);const{query:d,operationName:f}=bv(i.document);return Mv({url:c,query:d,variables:i.variables,headers:{...vv(Av(a)),...vv(i.requestHeaders)},operationName:f,fetch:s,method:o,fetchOptions:h,middleware:u}).then((e=>(l&&l(e),e.data))).catch((e=>{throw l&&l(e),e}))}batchRequests(e,t){const r=((e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0})(e,t),{headers:n,...i}=this.requestConfig;void 0!==r.signal&&(i.signal=r.signal);const a=r.documents.map((({document:e})=>bv(e).query)),s=r.documents.map((({variables:e})=>e));return Mv({url:this.url,query:a,variables:s,headers:{...vv(Av(n)),...vv(r.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??Qp,method:this.requestConfig.method||"POST",fetchOptions:i,middleware:this.requestConfig.requestMiddleware}).then((e=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(e),e.data))).catch((e=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(e),e}))}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,t){const{headers:r}=this.requestConfig;return r?r[e]=t:this.requestConfig.headers={[e]:t},this}setEndpoint(e){return this.url=e,this}}const Mv=async e=>{const{query:t,variables:r,fetchOptions:n}=e,i=(a=(e.method??"post").toUpperCase(),async e=>{const{url:t,query:r,variables:n,operationName:i,fetch:s,fetchOptions:o,middleware:u}=e,l={...e.headers};let h,c="";"POST"===a?(h=Tv(r,n,i,o.jsonSerializer),"string"==typeof h&&(l["Content-Type"]="application/json")):c=(e=>{if(!Array.isArray(e.query)){const t=e,r=[`query=${encodeURIComponent(wv(t.query))}`];return e.variables&&r.push(`variables=${encodeURIComponent(t.jsonSerializer.stringify(t.variables))}`),t.operationName&&r.push(`operationName=${encodeURIComponent(t.operationName)}`),r.join("&")}if(void 0!==e.variables&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,r=e.query.reduce(((e,r,n)=>(e.push({query:wv(r),variables:t.variables?t.jsonSerializer.stringify(t.variables[n]):void 0}),e)),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(r))}`})({query:r,variables:n,operationName:i,jsonSerializer:o.jsonSerializer??ag});const d={method:a,headers:l,body:h,...o};let f=t,p=d;if(u){const e=await Promise.resolve(u({...d,url:t,operationName:i,variables:n})),{url:r,...a}=e;f=r,p=a}return c&&(f=`${f}?${c}`),await s(f,p)});var a;const s=Array.isArray(e.query),o=await i(e),u=await Ev(o,n.jsonSerializer??ag),l=Array.isArray(u)?!u.some((({data:e})=>!e)):Boolean(u.data),h=Array.isArray(u)||!u.errors||Array.isArray(u.errors)&&!u.errors.length||"all"===n.errorPolicy||"ignore"===n.errorPolicy;if(o.ok&&h&&l){const{errors:e,...t}=(Array.isArray(u),u),r="ignore"===n.errorPolicy?t:u;return{...s?{data:r}:r,headers:o.headers,status:o.status}}throw new gv({..."string"==typeof u?{error:u}:u,status:o.status,headers:o.headers},{query:t,variables:r})},Tv=(e,t,r,n)=>{const i=n??ag;if(!Array.isArray(e))return i.stringify({query:e,variables:t,operationName:r});if(void 0!==t&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const a=e.reduce(((e,r,n)=>(e.push({query:r,variables:t?t[n]:void 0}),e)),[]);return i.stringify(a)},Ev=async(e,t)=>{let r;return e.headers.forEach(((e,t)=>{"content-type"===t.toLowerCase()&&(r=e)})),r&&(r.toLowerCase().startsWith("application/json")||r.toLowerCase().startsWith("application/graphql+json")||r.toLowerCase().startsWith("application/graphql-response+json"))?t.parse(await e.text()):e.text()},Av=e=>"function"==typeof e?e():e;var xv=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function s(e){try{u(n.next(e))}catch(e){a(e)}}function o(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}u((n=n.apply(e,t||[])).next())}))};const kv=((e,...t)=>e.reduce(((e,r,n)=>`${e}${r}${n in t?String(t[n]):""}`),""))`
|
|
3
|
-
query GetValidContacts(
|
|
4
|
-
$requiredSchema: [String!]!
|
|
5
|
-
$id: [String!]!
|
|
6
|
-
$start: Int!
|
|
7
|
-
$range: Int!
|
|
8
|
-
) {
|
|
9
|
-
protectedDatas(
|
|
10
|
-
where: {
|
|
11
|
-
transactionHash_not: "0x"
|
|
12
|
-
schema_contains: $requiredSchema
|
|
13
|
-
id_in: $id
|
|
14
|
-
}
|
|
15
|
-
skip: $start
|
|
16
|
-
first: $range
|
|
17
|
-
orderBy: creationTimestamp
|
|
18
|
-
orderDirection: desc
|
|
19
|
-
) {
|
|
20
|
-
id
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
`,{isAddress:Sv}=e,Iv=()=>{throw new za("Missing parameter")},Cv=["text/plain","text/html"];const Ov=({graphQLClient:e=Iv(),iexec:t=Iv()})=>{return r=void 0,n=void 0,a=function*(){try{const r=yield t.wallet.getAddress(),n=t.orderbook.fetchDatasetOrderbook("any",{app:tg,requester:r}),{orders:i}=yield ig({request:n});let a=[];const s=yield t.ens.resolveName(tg);i.forEach((e=>{if(e.order.apprestrict.toLowerCase()===s.toLowerCase()){const t={address:e.order.dataset.toLowerCase(),owner:e.signer.toLowerCase(),accessGrantTimestamp:e.publicationTimestamp};a.push(t)}}));const o=yield((e,t)=>xv(void 0,void 0,void 0,(function*(){try{const r=t.map((e=>e.address));let n=[],i=0;const a=1e3;let s=!0;do{const t={requiredSchema:["email:string"],id:r,start:i,range:a},o=yield e.request(kv,t),{protectedDatas:u}=o;n.push(...u),s=u.length===a,i+=a}while(s);const o=new Map(t.map((e=>[e.address,e]))),u=n.map((({id:e})=>{const t=o.get(e);if(t)return{address:e,owner:t.owner,accessGrantTimestamp:t.accessGrantTimestamp}}));return u}catch(e){throw new ng(`Failed to fetch subgraph: ${e.message}`,e)}})))(e,a);return o}catch(e){throw new ng(`Failed to fetch my contacts: ${e.message}`,e)}},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{u(a.next(e))}catch(e){t(e)}}function o(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(s,o)}u((a=a.apply(r,n||[])).next())}));var r,n,i,a};var Rv=i(5835);function Nv(e){return Rv.randomBytes(e).toString("hex")}const Pv=({graphQLClient:e=Iv(),iexec:t=Iv(),emailSubject:r,emailContent:n,contentType:i="text/plain",protectedData:a})=>{return s=void 0,o=void 0,l=function*(){var s,o,u,l,h;try{const c=ys().transform((e=>(null==e?void 0:e.toLowerCase())||e)).test("is-address-or-ens","${path} should be an ethereum address or a ENS name",(e=>(e=>void 0===e)(e)||(e=>Sv(e))(e)||(e=>e.endsWith(".eth")&&e.length>6)(e))).required().label("protectedData").validateSync(a),d=ys().max(78).strict().required().label("emailSubject").validateSync(r),f=ys().max(4096).strict().required().label("emailContent").validateSync(n),p=ys().oneOf(Cv,"Invalid contentType").optional().required().label("contentType").validateSync(i),y=yield((e,t)=>xv(void 0,void 0,void 0,(function*(){try{const r={requiredSchema:["email:string"],id:[t],start:0,range:1},n=yield e.request(kv,r),{protectedDatas:i}=n;return 1===i.length}catch(e){throw new ng(`Failed to fetch subgraph: ${e.message}`,e)}})))(e,c);if(!y)throw new Error("ProtectedData is not valid");const m=yield t.wallet.getAddress();if(!(yield t.storage.checkStorageTokenExists(m))){const e=yield t.storage.defaultStorageLogin();yield t.storage.pushStorageToken(e)}const b=yield t.orderbook.fetchDatasetOrderbook(c,{app:tg,requester:m}),g=null===(s=null==b?void 0:b.orders[0])||void 0===s?void 0:s.order;if(!g)throw new Error("Dataset order not found");const v=yield t.orderbook.fetchAppOrderbook(tg,{minTag:["tee","scone"],maxTag:["tee","scone"],workerpool:rg});if(!(null===(o=null==v?void 0:v.orders[0])||void 0===o?void 0:o.order))throw new Error("App order not found");const w=null===(u=v.orders.filter((e=>e.order.appprice<=0))[0])||void 0===u?void 0:u.order;if(!w)throw new Error("No App order found for the desired price");const _=yield t.orderbook.fetchWorkerpoolOrderbook({workerpool:rg,app:tg,dataset:c,minTag:["tee","scone"],maxTag:["tee","scone"],category:0});if(!(null===(l=null==_?void 0:_.orders[0])||void 0===l?void 0:l.order))throw new Error("Workerpool order not found");const M=_.orders.filter((e=>e.order.workerpoolprice<=0)),T=null===(h=M[Math.floor(Math.random()*M.length)])||void 0===h?void 0:h.order;if(!T)throw new Error("No Workerpool order found for the desired price");const E=Nv(16),A=Nv(16),x=Nv(16);yield t.secrets.pushRequesterSecret(E,d),yield t.secrets.pushRequesterSecret(A,f),yield t.secrets.pushRequesterSecret(x,JSON.stringify({contentType:p}));const k=yield t.order.createRequestorder({app:tg,category:T.category,dataset:c,appmaxprice:w.appprice,workerpoolmaxprice:T.workerpoolprice,tag:["tee","scone"],workerpool:rg,params:{iexec_developer_logger:!0,iexec_secrets:{1:E,2:A,3:x}}}),S=yield t.order.signRequestorder(k),{dealid:I}=yield t.order.matchOrders({apporder:w,datasetorder:g,workerpoolorder:T,requestorder:S});return{taskId:yield t.deal.computeTaskId(I,0)}}catch(e){throw new ng(`${e.message}`,e)}},new((u=void 0)||(u=Promise))((function(e,t){function r(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof u?i:new u((function(e){e(i)}))).then(r,n)}i((l=l.apply(s,o||[])).next())}));var s,o,u,l};class Bv{constructor(e,t){let r,n;try{r=new eg({ethProvider:e},null==t?void 0:t.iexecOptions)}catch(e){throw Error("Unsupported ethProvider")}try{n=new _v("https://thegraph-product.iex.ec/subgraphs/name/bellecour/dataprotector")}catch(e){throw Error("Impossible to create GraphQLClient")}this.fetchMyContacts=()=>Ov({iexec:r,graphQLClient:n}),this.sendEmail=e=>Pv(Object.assign(Object.assign({},e),{iexec:r,graphQLClient:n}))}}const Dv=e=>((e,t,{gasPrice:r,getTransactionCount:n,providers:i}={})=>new Ed(t,Md(e,{providers:i}),{gasPrice:r,getTransactionCount:n}))("bellecour",e)})();var s=a.j,o=a.U;export{s as IExecWeb3mail,o as getWeb3Provider};
|