@niftykit/diamond 0.2.2 → 0.2.8
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/README.md +56 -1
- package/dist/cjs/Diamond.js +27 -0
- package/dist/esm/Diamond.js +27 -0
- package/dist/types/Diamond.d.ts +2 -0
- package/dist/umd/index.js +1 -1
- package/package.json +2 -2
package/dist/umd/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Diamond=t():e.Diamond=t()}(this,(()=>(()=>{var e={202:function(e){"use strict";!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 o(e){return new Uint8Array(e)}function a(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 s,c={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("")}},f=(s="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(s[(240&n)>>4]+s[15&n])}return t.join("")}}),u={16:10,24:12,32:14},l=[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],h=[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],b=[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],p=[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],y=[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],A=[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],E=[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],_=[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],T=[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],k=[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 S(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 P=function(e){if(!(this instanceof P))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(e,!0)}),this._prepare()};P.prototype._prepare=function(){var e=u[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,o=S(this.key);for(t=0;t<i;t++)r=t>>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,c=i;c<n;){if(a=o[i-1],o[0]^=d[a>>16&255]<<24^d[a>>8&255]<<16^d[255&a]<<8^d[a>>24&255]^l[s]<<24,s+=1,8!=i)for(t=1;t<i;t++)o[t]^=o[t-1];else{for(t=1;t<i/2;t++)o[t]^=o[t-1];for(a=o[i/2-1],o[i/2]^=d[255&a]^d[a>>8&255]<<8^d[a>>16&255]<<16^d[a>>24&255]<<24,t=i/2+1;t<i;t++)o[t]^=o[t-1]}for(t=0;t<i&&c<n;)f=c>>2,h=c%4,this._Ke[f][h]=o[t],this._Kd[e-f][h]=o[t++],c++}for(var f=1;f<e;f++)for(var h=0;h<4;h++)a=this._Kd[f][h],this._Kd[f][h]=E[a>>24&255]^_[a>>16&255]^T[a>>8&255]^k[255&a]},P.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=S(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a<t;a++){for(i=0;i<4;i++)r[i]=b[n[i]>>24&255]^p[n[(i+1)%4]>>16&255]^m[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],c[4*i]=255&(d[n[i]>>24&255]^s>>24),c[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(d[255&n[(i+3)%4]]^s);return c},P.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=S(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a<t;a++){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]^A[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],c[4*i]=255&(h[n[i]>>24&255]^s>>24),c[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(h[255&n[(i+1)%4]]^s);return c};var x=function(e){if(!(this instanceof x))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new P(e)};x.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=o(e.length),r=o(16),n=0;n<e.length;n+=16)a(e,r,0,n,n+16),a(r=this._aes.encrypt(r),t,n);return t},x.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=o(e.length),r=o(16),n=0;n<e.length;n+=16)a(e,r,0,n,n+16),a(r=this._aes.decrypt(r),t,n);return t};var N=function(e,t){if(!(this instanceof N))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=o(16);this._lastCipherblock=i(t,!0),this._aes=new P(e)};N.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=o(e.length),r=o(16),n=0;n<e.length;n+=16){a(e,r,0,n,n+16);for(var s=0;s<16;s++)r[s]^=this._lastCipherblock[s];this._lastCipherblock=this._aes.encrypt(r),a(this._lastCipherblock,t,n)}return t},N.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=o(e.length),r=o(16),n=0;n<e.length;n+=16){a(e,r,0,n,n+16),r=this._aes.decrypt(r);for(var s=0;s<16;s++)t[n+s]=r[s]^this._lastCipherblock[s];a(e,this._lastCipherblock,0,n,n+16)}return t};var M=function(e,t,r){if(!(this instanceof M))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=o(16);r||(r=1),this.segmentSize=r,this._shiftRegister=i(t,!0),this._aes=new P(e)};M.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 o=0;o<this.segmentSize;o++)r[n+o]^=t[o];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},M.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 o=0;o<this.segmentSize;o++)r[n+o]^=t[o];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var C=function(e,t){if(!(this instanceof C))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=o(16);this._lastPrecipher=i(t,!0),this._lastPrecipherIndex=16,this._aes=new P(e)};C.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},C.prototype.decrypt=C.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=o(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 I=function(e,t){if(!(this instanceof I))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 P(e)};I.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},I.prototype.decrypt=I.prototype.encrypt;var O={AES:P,Counter:R,ModeOfOperation:{ecb:x,cbc:N,cfb:M,ofb:C,ctr:I},utils:{hex:f,utf8:c},padding:{pkcs7:{pad:function(e){var t=16-(e=i(e,!0)).length%16,r=o(e.length+t);a(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 s=o(r);return a(e,s,0,0,r),s}}},_arrayTest:{coerceArray:i,createArray:o,copyArray:a}};e.exports=O}()},273:e=>{"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<32;n++){var i=t.charAt(n);if(void 0!==r[i])throw new TypeError(i+" is ambiguous");r[i]=n}function o(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 a(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=o(t)^n>>5}for(t=o(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=o(t)^31&i}return t}function s(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 s=(e=n).lastIndexOf("1");if(-1===s)return"No separator character for "+e;if(0===s)return"Missing prefix for "+e;var c=e.slice(0,s),f=e.slice(s+1);if(f.length<6)return"Data too short";var u=a(c);if("string"==typeof u)return u;for(var l=[],d=0;d<f.length;++d){var h=f.charAt(d),b=r[h];if(void 0===b)return"Unknown character "+h;u=o(u)^b,d+6>=f.length||l.push(b)}return 1!==u?"Invalid checksum for "+e:{prefix:c,words:l}}function c(e,t,r,n){for(var i=0,o=0,a=(1<<r)-1,s=[],c=0;c<e.length;++c)for(i=i<<t|e[c],o+=t;o>=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<<r-o&a);else{if(o>=t)return"Excess padding";if(i<<r-o&a)return"Non-zero padding"}return s}e.exports={decodeUnsafe:function(){var e=s.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=s.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=a(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var s=e+"1",c=0;c<r.length;++c){var f=r[c];if(f>>5!=0)throw new Error("Non 5-bit word");i=o(i)^f,s+=t.charAt(f)}for(c=0;c<6;++c)i=o(i);for(i^=1,c=0;c<6;++c)s+=t.charAt(i>>5*(5-c)&31);return s},toWordsUnsafe:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},197:function(e,t,r){!function(e,t){"use strict";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 o(e,t,r){if(o.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 a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(196).Buffer}catch(e){}function s(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 c(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function f(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),c=t;c<s;c++){var f=e.charCodeAt(c)-48;o*=i,a=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&a<i,"Invalid character"),o+=a}return o}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.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)))},o.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)},o.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 o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.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,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=c(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=c(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.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 o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,u=r;u<s;u+=n)c=f(e,u,u+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var l=1;for(c=f(e,u,e.length,t),u=0;u<a;u++)l*=t;this.imuln(l),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},o.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},o.prototype._move=function(e){u(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){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"],h=[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],b=[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 p(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],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var f=1;f<n;f++){for(var u=c>>>26,l=67108863&c,d=Math.min(f,t.length-1),h=Math.max(0,f-e.length+1);h<=d;h++){var b=f-h|0;u+=(a=(i=0|e.words[b])*(o=0|t.words[h])+l)/67108864|0,l=67108863&a}r.words[f]=0|l,c=0|u}return 0!==c?r.words[f]=0|c:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],c=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-c.length]+c+r:c+r}for(0!==o&&(r=o.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 f=h[e],u=b[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var p=l.modrn(u).toString(e);r=(l=l.idivn(u)).isZero()?p+r:d[f-p.length]+p+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")},o.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},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.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},o.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},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.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},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.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()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.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()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.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()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.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()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.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()},o.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,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.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)},o.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 o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,i,o,a=e.words,s=t.words,c=r.words,f=0,u=0|a[0],l=8191&u,d=u>>>13,h=0|a[1],b=8191&h,p=h>>>13,m=0|a[2],y=8191&m,g=m>>>13,v=0|a[3],w=8191&v,A=v>>>13,E=0|a[4],_=8191&E,T=E>>>13,k=0|a[5],S=8191&k,P=k>>>13,x=0|a[6],N=8191&x,M=x>>>13,C=0|a[7],R=8191&C,I=C>>>13,O=0|a[8],B=8191&O,F=O>>>13,D=0|a[9],U=8191&D,L=D>>>13,j=0|s[0],z=8191&j,G=j>>>13,q=0|s[1],K=8191&q,H=q>>>13,J=0|s[2],W=8191&J,V=J>>>13,Q=0|s[3],Y=8191&Q,X=Q>>>13,Z=0|s[4],$=8191&Z,ee=Z>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,fe=se>>>13,ue=0|s[8],le=8191&ue,de=ue>>>13,he=0|s[9],be=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(l,z))|0)+((8191&(i=(i=Math.imul(l,G))+Math.imul(d,z)|0))<<13)|0;f=((o=Math.imul(d,G))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(b,z),i=(i=Math.imul(b,G))+Math.imul(p,z)|0,o=Math.imul(p,G);var ye=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(d,K)|0))<<13)|0;f=((o=o+Math.imul(d,H)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,z),i=(i=Math.imul(y,G))+Math.imul(g,z)|0,o=Math.imul(g,G),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(p,K)|0,o=o+Math.imul(p,H)|0;var ge=(f+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(d,W)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,z),i=(i=Math.imul(w,G))+Math.imul(A,z)|0,o=Math.imul(A,G),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,H)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(p,W)|0,o=o+Math.imul(p,V)|0;var ve=(f+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(d,Y)|0))<<13)|0;f=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,z),i=(i=Math.imul(_,G))+Math.imul(T,z)|0,o=Math.imul(T,G),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,H)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,V)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(p,Y)|0,o=o+Math.imul(p,X)|0;var we=(f+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(d,$)|0))<<13)|0;f=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(S,z),i=(i=Math.imul(S,G))+Math.imul(P,z)|0,o=Math.imul(P,G),n=n+Math.imul(_,K)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(p,$)|0,o=o+Math.imul(p,ee)|0;var Ae=(f+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(d,re)|0))<<13)|0;f=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(N,z),i=(i=Math.imul(N,G))+Math.imul(M,z)|0,o=Math.imul(M,G),n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(p,re)|0,o=o+Math.imul(p,ne)|0;var Ee=(f+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ae)|0)+Math.imul(d,oe)|0))<<13)|0;f=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(R,z),i=(i=Math.imul(R,G))+Math.imul(I,z)|0,o=Math.imul(I,G),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(p,oe)|0,o=o+Math.imul(p,ae)|0;var _e=(f+(n=n+Math.imul(l,ce)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(d,ce)|0))<<13)|0;f=((o=o+Math.imul(d,fe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,z),i=(i=Math.imul(B,G))+Math.imul(F,z)|0,o=Math.imul(F,G),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,n=n+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,fe)|0)+Math.imul(p,ce)|0,o=o+Math.imul(p,fe)|0;var Te=(f+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;f=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,z),i=(i=Math.imul(U,G))+Math.imul(L,z)|0,o=Math.imul(L,G),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(F,K)|0,o=o+Math.imul(F,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(g,ce)|0,o=o+Math.imul(g,fe)|0,n=n+Math.imul(b,le)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(p,le)|0,o=o+Math.imul(p,de)|0;var ke=(f+(n=n+Math.imul(l,be)|0)|0)+((8191&(i=(i=i+Math.imul(l,pe)|0)+Math.imul(d,be)|0))<<13)|0;f=((o=o+Math.imul(d,pe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,H))+Math.imul(L,K)|0,o=Math.imul(L,H),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(F,W)|0,o=o+Math.imul(F,V)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,fe)|0,n=n+Math.imul(y,le)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(g,le)|0,o=o+Math.imul(g,de)|0;var Se=(f+(n=n+Math.imul(b,be)|0)|0)+((8191&(i=(i=i+Math.imul(b,pe)|0)+Math.imul(p,be)|0))<<13)|0;f=((o=o+Math.imul(p,pe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,V))+Math.imul(L,W)|0,o=Math.imul(L,V),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(F,Y)|0,o=o+Math.imul(F,X)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(_,ce)|0,i=(i=i+Math.imul(_,fe)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,fe)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(A,le)|0,o=o+Math.imul(A,de)|0;var Pe=(f+(n=n+Math.imul(y,be)|0)|0)+((8191&(i=(i=i+Math.imul(y,pe)|0)+Math.imul(g,be)|0))<<13)|0;f=((o=o+Math.imul(g,pe)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,X))+Math.imul(L,Y)|0,o=Math.imul(L,X),n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,fe)|0,n=n+Math.imul(_,le)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(T,le)|0,o=o+Math.imul(T,de)|0;var xe=(f+(n=n+Math.imul(w,be)|0)|0)+((8191&(i=(i=i+Math.imul(w,pe)|0)+Math.imul(A,be)|0))<<13)|0;f=((o=o+Math.imul(A,pe)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,ee))+Math.imul(L,$)|0,o=Math.imul(L,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(F,re)|0,o=o+Math.imul(F,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,fe)|0)+Math.imul(M,ce)|0,o=o+Math.imul(M,fe)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,de)|0;var Ne=(f+(n=n+Math.imul(_,be)|0)|0)+((8191&(i=(i=i+Math.imul(_,pe)|0)+Math.imul(T,be)|0))<<13)|0;f=((o=o+Math.imul(T,pe)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(L,re)|0,o=Math.imul(L,ne),n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(F,oe)|0,o=o+Math.imul(F,ae)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,fe)|0,n=n+Math.imul(N,le)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,de)|0;var Me=(f+(n=n+Math.imul(S,be)|0)|0)+((8191&(i=(i=i+Math.imul(S,pe)|0)+Math.imul(P,be)|0))<<13)|0;f=((o=o+Math.imul(P,pe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,ae))+Math.imul(L,oe)|0,o=Math.imul(L,ae),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,fe)|0)+Math.imul(F,ce)|0,o=o+Math.imul(F,fe)|0,n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(I,le)|0,o=o+Math.imul(I,de)|0;var Ce=(f+(n=n+Math.imul(N,be)|0)|0)+((8191&(i=(i=i+Math.imul(N,pe)|0)+Math.imul(M,be)|0))<<13)|0;f=((o=o+Math.imul(M,pe)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(U,ce),i=(i=Math.imul(U,fe))+Math.imul(L,ce)|0,o=Math.imul(L,fe),n=n+Math.imul(B,le)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(F,le)|0,o=o+Math.imul(F,de)|0;var Re=(f+(n=n+Math.imul(R,be)|0)|0)+((8191&(i=(i=i+Math.imul(R,pe)|0)+Math.imul(I,be)|0))<<13)|0;f=((o=o+Math.imul(I,pe)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,le),i=(i=Math.imul(U,de))+Math.imul(L,le)|0,o=Math.imul(L,de);var Ie=(f+(n=n+Math.imul(B,be)|0)|0)+((8191&(i=(i=i+Math.imul(B,pe)|0)+Math.imul(F,be)|0))<<13)|0;f=((o=o+Math.imul(F,pe)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863;var Oe=(f+(n=Math.imul(U,be))|0)+((8191&(i=(i=Math.imul(U,pe))+Math.imul(L,be)|0))<<13)|0;return f=((o=Math.imul(L,pe))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=me,c[1]=ye,c[2]=ge,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=Ee,c[7]=_e,c[8]=Te,c[9]=ke,c[10]=Se,c[11]=Pe,c[12]=xe,c[13]=Ne,c[14]=Me,c[15]=Ce,c[16]=Re,c[17]=Ie,c[18]=Oe,0!==f&&(c[19]=f,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,c=Math.min(o,t.length-1),f=Math.max(0,o-e.length+1);f<=c;f++){var u=o-f,l=(0|e.words[u])*(0|t.words[f]),d=67108863&l;s=67108863&(d=d+s|0),i+=(a=(a=a+(l/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function g(e,t,r){return y(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=p),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?y(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.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,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},v.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,c=Math.cos(2*Math.PI/s),f=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var l=c,d=f,h=0;h<a;h++){var b=r[u+h],p=n[u+h],m=r[u+h+a],y=n[u+h+a],g=l*m-d*y;y=l*y+d*m,m=g,r[u+h]=b+m,n[u+h]=p+y,r[u+h+a]=b-m,n[u+h+a]=p-y,h!==s&&(g=c*l-f*d,d=c*d+f*l,l=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 o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},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),o=this.stub(n),a=new Array(n),s=new Array(n),c=new Array(n),f=new Array(n),u=new Array(n),l=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,f,n),this.transform(a,o,s,c,n,i),this.transform(f,o,u,l,n,i);for(var h=0;h<n;h++){var b=s[h]*u[h]-c[h]*l[h];c[h]=s[h]*l[h]+c[h]*u[h],s[h]=b}return this.conjugate(s,c,n),this.transform(s,c,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),g(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.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 o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.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 o(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},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,c=(0|this.words[t])-s<<r;this.words[t]=c|a,a=s>>>26-r}a&&(this.words[t]=a,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()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,c=r;if(i-=a,i=Math.max(0,i),c){for(var f=0;f<a;f++)c.words[f]=this.words[f];c.length=a}if(0===a);else if(this.length>a)for(this.length-=a,f=0;f<this.length;f++)this.words[f]=this.words[f+a];else this.words[0]=0,this.length=1;var u=0;for(f=this.length-1;f>=0&&(0!==u||f>=i);f--){var l=0|this.words[f];this.words[f]=u<<26-o|l>>>o,u=l&s}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.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))},o.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()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.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)},o.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},o.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()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var c=(0|e.words[i])*t;s=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,c=n.length-i.length;if("mod"!==t){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var f=0;f<s.length;f++)s.words[f]=0}var u=n.clone()._ishlnsubmul(i,1,c);0===u.negative&&(n=u,s&&(s.words[c]=1));for(var l=c-1;l>=0;l--){var d=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.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),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.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 o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.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 o(1),a=new o(0),s=new o(0),c=new o(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var u=r.clone(),l=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(u),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var b=0,p=1;0==(r.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(c)):(r.isub(t),s.isub(i),c.isub(a))}return{a:s,b:c,gcd:r.iushln(f)}},o.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,a=new o(1),s=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,u=1;0==(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var l=0,d=1;0==(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.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 o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.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 o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.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},o.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},o.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},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.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)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.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 A(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function T(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._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 P(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}A.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},A.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},A.prototype.split=function(e,t){e.iushrn(this.n,0,t)},A.prototype.imulK=function(e){return e.imul(this.k)},i(E,A),E.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 o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},E.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(_,A),i(T,A),i(k,A),k.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},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new E;else if("p224"===e)t=new _;else if("p192"===e)t=new T;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return w[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.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")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.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)},S.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},S.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)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.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 o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),c=s.redNeg(),f=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);0!==this.pow(u,f).cmp(c);)u.redIAdd(c);for(var l=this.pow(u,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),b=a;0!==h.cmp(s);){for(var p=h,m=0;0!==p.cmp(s);m++)p=p.redSqr();n(m<b);var y=this.pow(l,new o(1).iushln(b-m-1));d=d.redMul(y),l=y.redSqr(),h=h.redMul(l),b=m}return d},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(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],a=0,s=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var f=t.words[n],u=c-1;u>=0;u--){var l=f>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4==++s||0===n&&0===u)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}c=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new P(e)},i(P,S),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.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),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},P.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(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),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)},P.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},391:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BaseContract:()=>In,BigNumber:()=>V,Contract:()=>On,ContractFactory:()=>Bn,FixedNumber:()=>Jn,Signer:()=>fr,VoidSigner:()=>ur,Wallet:()=>Ao,Wordlist:()=>_i,constants:()=>i,errors:()=>m,ethers:()=>c,getDefaultProvider:()=>hc,logger:()=>Kc,providers:()=>o,utils:()=>s,version:()=>qc,wordlists:()=>Pi});var n={};r.r(n),r.d(n,{decode:()=>Pe,encode:()=>Te});var i={};r.r(i),r.d(i,{AddressZero:()=>To,EtherSymbol:()=>So,HashZero:()=>ko,MaxInt256:()=>mt,MaxUint256:()=>bt,MinInt256:()=>pt,NegativeOne:()=>ft,One:()=>lt,Two:()=>dt,WeiPerEther:()=>ht,Zero:()=>ut});var o={};r.r(o),r.d(o,{AlchemyProvider:()=>As,AlchemyWebSocketProvider:()=>ws,AnkrProvider:()=>ks,BaseProvider:()=>Ya,CloudflareProvider:()=>Ps,EtherscanProvider:()=>Bs,FallbackProvider:()=>Ys,Formatter:()=>Ea,InfuraProvider:()=>tc,InfuraWebSocketProvider:()=>ec,IpcProvider:()=>Xs,JsonRpcBatchProvider:()=>rc,JsonRpcProvider:()=>fs,JsonRpcSigner:()=>as,NodesmithProvider:()=>ic,PocketProvider:()=>sc,Provider:()=>ir,Resolver:()=>Wa,StaticJsonRpcProvider:()=>ms,UrlJsonRpcProvider:()=>ys,Web3Provider:()=>lc,WebSocketProvider:()=>bs,getDefaultProvider:()=>hc,getNetwork:()=>Oo,isCommunityResourcable:()=>_a,isCommunityResource:()=>Ta,showThrottleMessage:()=>Sa});var a={};r.r(a),r.d(a,{decode:()=>Bo,encode:()=>Fo});var s={};r.r(s),r.d(s,{AbiCoder:()=>Jt,ConstructorFragment:()=>Bt,ErrorFragment:()=>Ut,EventFragment:()=>Ct,FormatTypes:()=>St,Fragment:()=>Mt,FunctionFragment:()=>Ft,HDNode:()=>Ui,Indexed:()=>Zt,Interface:()=>tr,LogDescription:()=>Qt,Logger:()=>g,ParamType:()=>xt,RLP:()=>n,SigningKey:()=>Zr,SupportedAlgorithm:()=>pi,TransactionDescription:()=>Yt,TransactionTypes:()=>rn,UnicodeNormalizationForm:()=>je,Utf8ErrorFuncs:()=>qe,Utf8ErrorReason:()=>ze,_TypedDataEncoder:()=>di,_fetchData:()=>pa,_toEscapedUtf8String:()=>We,accessListify:()=>dn,arrayify:()=>k,base58:()=>bi,base64:()=>a,checkProperties:()=>ie,checkResultErrors:()=>he,commify:()=>Uc,computeAddress:()=>cn,computeHmac:()=>wi,computePublicKey:()=>en,concat:()=>S,deepCopy:()=>fe,defaultAbiCoder:()=>Wt,defaultPath:()=>Di,defineReadOnly:()=>te,dnsEncode:()=>ca,entropyToMnemonic:()=>zi,fetchJson:()=>ma,formatBytes32String:()=>Oc,formatEther:()=>zc,formatUnits:()=>Lc,getAccountPath:()=>qi,getAddress:()=>Oe,getContractAddress:()=>De,getCreate2Address:()=>Ue,getIcapAddress:()=>Fe,getJsonWalletAddress:()=>yo,getStatic:()=>re,hashMessage:()=>Yn,hexConcat:()=>O,hexDataLength:()=>R,hexDataSlice:()=>I,hexStripZeros:()=>F,hexValue:()=>B,hexZeroPad:()=>D,hexlify:()=>C,id:()=>Xe,isAddress:()=>Be,isBytes:()=>T,isBytesLike:()=>E,isHexString:()=>N,isValidMnemonic:()=>Gi,isValidName:()=>aa,joinSignature:()=>L,keccak256:()=>ve,mnemonicToEntropy:()=>ji,mnemonicToSeed:()=>Li,namehash:()=>sa,nameprep:()=>Ic,parseBytes32String:()=>Bc,parseEther:()=>Gc,parseTransaction:()=>gn,parseUnits:()=>jc,poll:()=>ya,randomBytes:()=>Wi,recoverAddress:()=>fn,recoverPublicKey:()=>$r,resolveProperties:()=>ne,ripemd160:()=>yi,serializeTransaction:()=>mn,sha256:()=>gi,sha512:()=>vi,shallowCopy:()=>oe,shuffled:()=>Fs,solidityKeccak256:()=>Ac,solidityPack:()=>wc,soliditySha256:()=>Ec,splitSignature:()=>U,stripZeros:()=>P,toUtf8Bytes:()=>He,toUtf8CodePoints:()=>Ye,toUtf8String:()=>Qe,verifyMessage:()=>Eo,verifyTypedData:()=>_o,zeroPad:()=>x});var c={};r.r(c),r.d(c,{BaseContract:()=>In,BigNumber:()=>V,Contract:()=>On,ContractFactory:()=>Bn,FixedNumber:()=>Jn,Signer:()=>fr,VoidSigner:()=>ur,Wallet:()=>Ao,Wordlist:()=>_i,constants:()=>i,errors:()=>m,getDefaultProvider:()=>hc,logger:()=>Kc,providers:()=>o,utils:()=>s,version:()=>qc,wordlists:()=>Pi});let f=!1,u=!1;const l={debug:1,default:2,info:2,warning:3,error:4,off:5};let d=l.default,h=null;const b=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 p,m;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(p||(p={})),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"}(m||(m={}));const y="0123456789abcdef";class g{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==l[r]&&this.throwArgumentError("invalid log level name","logLevel",e),d>l[r]||console.log.apply(console,t)}debug(...e){this._log(g.levels.DEBUG,e)}info(...e){this._log(g.levels.INFO,e)}warn(...e){this._log(g.levels.WARNING,e)}makeError(e,t,r){if(u)return this.makeError("censored error",t,{});t||(t=g.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+=y[t[e]>>4],r+=y[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 o="";switch(t){case m.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case m.CALL_EXCEPTION:case m.INSUFFICIENT_FUNDS:case m.MISSING_NEW:case m.NONCE_EXPIRED:case m.REPLACEMENT_UNDERPRICED:case m.TRANSACTION_REPLACED:case m.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const a=new Error(e);return a.reason=i,a.code=t,Object.keys(r).forEach((function(e){a[e]=r[e]})),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,g.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"),b&&this.throwError("platform missing String.prototype.normalize",g.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:b})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,g.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,g.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,g.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,g.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",g.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",g.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",g.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return h||(h=new g("logger/5.7.0")),h}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",g.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),f){if(!e)return;this.globalLogger().throwError("error censorship permanent",g.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}u=!!e,f=!!t}static setLogLevel(e){const t=l[e.toLowerCase()];null!=t?d=t:g.globalLogger().warn("invalid log level - "+e)}static from(e){return new g(e)}}g.errors=m,g.levels=p;const v=new g("bytes/5.7.0");function w(e){return!!e.toHexString}function A(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return A(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function E(e){return N(e)&&!(e.length%2)||T(e)}function _(e){return"number"==typeof e&&e==e&&e%1==0}function T(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!_(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!_(r)||r<0||r>=256)return!1}return!0}function k(e,t){if(t||(t={}),"number"==typeof e){v.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),A(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),w(e)&&(e=e.toHexString()),N(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":v.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 A(new Uint8Array(n))}return T(e)?A(new Uint8Array(e)):v.throwArgumentError("invalid arrayify value","value",e)}function S(e){const t=e.map((e=>k(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),A(n)}function P(e){let t=k(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 x(e,t){(e=k(e)).length>t&&v.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),A(r)}function N(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const M="0123456789abcdef";function C(e,t){if(t||(t={}),"number"==typeof e){v.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=M[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),w(e))return e.toHexString();if(N(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":v.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(T(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+=M[(240&n)>>4]+M[15&n]}return t}return v.throwArgumentError("invalid hexlify value","value",e)}function R(e){if("string"!=typeof e)e=C(e);else if(!N(e)||e.length%2)return null;return(e.length-2)/2}function I(e,t,r){return"string"!=typeof e?e=C(e):(!N(e)||e.length%2)&&v.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function O(e){let t="0x";return e.forEach((e=>{t+=C(e).substring(2)})),t}function B(e){const t=F(C(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function F(e){"string"!=typeof e&&(e=C(e)),N(e)||v.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)}function D(e,t){for("string"!=typeof e?e=C(e):N(e)||v.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&v.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function U(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(E(e)){let r=k(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=C(r.slice(0,32)),t.s=C(r.slice(32,64))):65===r.length?(t.r=C(r.slice(0,32)),t.s=C(r.slice(32,64)),t.v=r[64]):v.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:v.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=C(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=x(k(t._vs),32);t._vs=C(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&v.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=C(r);null==t.s?t.s=i:t.s!==i&&v.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?v.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&&v.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&N(t.r)?t.r=D(t.r,32):v.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&N(t.s)?t.s=D(t.s,32):v.throwArgumentError("signature missing or invalid s","signature",e);const r=k(t.s);r[0]>=128&&v.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=C(r);t._vs&&(N(t._vs)||v.throwArgumentError("signature invalid _vs","signature",e),t._vs=D(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&v.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function L(e){return C(S([(e=U(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var j=r(197),z=r.n(j);const G="bignumber/5.7.0";var q=z().BN;const K=new g(G),H={},J=9007199254740991;let W=!1;class V{constructor(e,t){e!==H&&K.throwError("cannot call constructor directly; use BigNumber.from",g.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Y(X(this).fromTwos(e))}toTwos(e){return Y(X(this).toTwos(e))}abs(){return"-"===this._hex[0]?V.from(this._hex.substring(1)):this}add(e){return Y(X(this).add(X(e)))}sub(e){return Y(X(this).sub(X(e)))}div(e){return V.from(e).isZero()&&Z("division-by-zero","div"),Y(X(this).div(X(e)))}mul(e){return Y(X(this).mul(X(e)))}mod(e){const t=X(e);return t.isNeg()&&Z("division-by-zero","mod"),Y(X(this).umod(t))}pow(e){const t=X(e);return t.isNeg()&&Z("negative-power","pow"),Y(X(this).pow(t))}and(e){const t=X(e);return(this.isNegative()||t.isNeg())&&Z("unbound-bitwise-result","and"),Y(X(this).and(t))}or(e){const t=X(e);return(this.isNegative()||t.isNeg())&&Z("unbound-bitwise-result","or"),Y(X(this).or(t))}xor(e){const t=X(e);return(this.isNegative()||t.isNeg())&&Z("unbound-bitwise-result","xor"),Y(X(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Z("negative-width","mask"),Y(X(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Z("negative-width","shl"),Y(X(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Z("negative-width","shr"),Y(X(this).shrn(e))}eq(e){return X(this).eq(X(e))}lt(e){return X(this).lt(X(e))}lte(e){return X(this).lte(X(e))}gt(e){return X(this).gt(X(e))}gte(e){return X(this).gte(X(e))}isNegative(){return"-"===this._hex[0]}isZero(){return X(this).isZero()}toNumber(){try{return X(this).toNumber()}catch(e){Z("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return K.throwError("this platform does not support BigInt",g.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?W||(W=!0,K.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?K.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",g.errors.UNEXPECTED_ARGUMENT,{}):K.throwError("BigNumber.toString does not accept parameters",g.errors.UNEXPECTED_ARGUMENT,{})),X(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof V)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new V(H,Q(e)):e.match(/^-?[0-9]+$/)?new V(H,Q(new q(e))):K.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&Z("underflow","BigNumber.from",e),(e>=J||e<=-J)&&Z("overflow","BigNumber.from",e),V.from(String(e));const t=e;if("bigint"==typeof t)return V.from(t.toString());if(T(t))return V.from(C(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return V.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(N(e)||"-"===e[0]&&N(e.substring(1))))return V.from(e)}return K.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Q(e){if("string"!=typeof e)return Q(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&K.throwArgumentError("invalid hex","value",e),"0x00"===(e=Q(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 Y(e){return V.from(Q(e))}function X(e){const t=V.from(e).toHexString();return"-"===t[0]?new q("-"+t.substring(3),16):new q(t.substring(2),16)}function Z(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),K.throwError(e,g.errors.NUMERIC_FAULT,n)}var $=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ee=new g("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 $(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 oe(e){const t={};for(const r in e)t[r]=e[r];return t}const ae={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function se(e){if(null==e||ae[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(!se(n))return!1}return!0}return ee.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ce(e){if(se(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>fe(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&te(t,r,fe(n))}return t}return ee.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function fe(e){return ce(e)}class ue{constructor(e){for(const t in e)this[t]=fe(e[t])}}const le="abi/5.7.0",de=new g(le);function he(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const o=e.slice();o.push(i);try{r(o,n[i])}catch(e){t.push({path:o,error:e})}}};return r([],e),t}class be{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){de.throwArgumentError(e,this.localName,t)}}class pe{constructor(e){te(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return O(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(S(e._data))}writeBytes(e){let t=k(e);const r=t.length%this.wordSize;return r&&(t=S([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=k(V.from(e));return t.length>this.wordSize&&de.throwError("value out-of-bounds",g.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=S([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 me{constructor(e,t,r,n){te(this,"_data",k(e)),te(this,"wordSize",t||32),te(this,"_coerceFunc",r),te(this,"allowLoose",n),this._offset=0}get data(){return C(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):me.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:de.throwError("data out-of-bounds",g.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new me(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 V.from(this.readBytes(this.wordSize))}}var ye=r(669),ge=r.n(ye);function ve(e){return"0x"+ge().keccak_256(k(e))}const we=new g("rlp/5.7.0");function Ae(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function Ee(e,t,r){let n=0;for(let i=0;i<r;i++)n=256*n+e[t+i];return n}function _e(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(_e(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=Ae(t.length);return r.unshift(247+r.length),r.concat(t)}E(e)||we.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(k(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=Ae(t.length);return r.unshift(183+r.length),r.concat(t)}function Te(e){return C(_e(e))}function ke(e,t,r,n){const i=[];for(;r<t+1+n;){const o=Se(e,r);i.push(o.result),(r+=o.consumed)>t+1+n&&we.throwError("child data too short",g.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function Se(e,t){if(0===e.length&&we.throwError("data too short",g.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&we.throwError("data short segment too short",g.errors.BUFFER_OVERRUN,{});const n=Ee(e,t+1,r);return t+1+r+n>e.length&&we.throwError("data long segment too short",g.errors.BUFFER_OVERRUN,{}),ke(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&we.throwError("data array too short",g.errors.BUFFER_OVERRUN,{}),ke(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&we.throwError("data array too short",g.errors.BUFFER_OVERRUN,{});const n=Ee(e,t+1,r);return t+1+r+n>e.length&&we.throwError("data array too short",g.errors.BUFFER_OVERRUN,{}),{consumed:1+r+n,result:C(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;return t+1+r>e.length&&we.throwError("data too short",g.errors.BUFFER_OVERRUN,{}),{consumed:1+r,result:C(e.slice(t+1,t+1+r))}}return{consumed:1,result:C(e[t])}}function Pe(e){const t=k(e),r=Se(t,0);return r.consumed!==t.length&&we.throwArgumentError("invalid rlp data","data",e),r.result}const xe=new g("address/5.7.0");function Ne(e){N(e,20)||xe.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=k(ve(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 Me={};for(let e=0;e<10;e++)Me[String(e)]=String(e);for(let e=0;e<26;e++)Me[String.fromCharCode(65+e)]=String(10+e);const Ce=Math.floor((Re=9007199254740991,Math.log10?Math.log10(Re):Math.log(Re)/Math.LN10));var Re;function Ie(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>Me[e])).join("");for(;t.length>=Ce;){let e=t.substring(0,Ce);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}function Oe(e){let t=null;if("string"!=typeof e&&xe.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=Ne(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&xe.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)!==Ie(e)&&xe.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new q(r,36).toString(16);t.length<40;)t="0"+t;t=Ne("0x"+t)}else xe.throwArgumentError("invalid address","address",e);var r;return t}function Be(e){try{return Oe(e),!0}catch(e){}return!1}function Fe(e){let t=(r=Oe(e).substring(2),new q(r,16).toString(36)).toUpperCase();for(var r;t.length<30;)t="0"+t;return"XE"+Ie("XE00"+t)+t}function De(e){let t=null;try{t=Oe(e.from)}catch(t){xe.throwArgumentError("missing from address","transaction",e)}return Oe(I(ve(Te([t,P(k(V.from(e.nonce).toHexString()))])),12))}function Ue(e,t,r){return 32!==R(t)&&xe.throwArgumentError("salt must be 32 bytes","salt",t),32!==R(r)&&xe.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Oe(I(ve(S(["0xff",Oe(e),t,r])),12))}const Le=new g("strings/5.7.0");var je,ze;function Ge(e,t,r,n,i){if(e===ze.BAD_PREFIX||e===ze.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===ze.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(je||(je={})),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"}(ze||(ze={}));const qe=Object.freeze({error:function(e,t,r,n,i){return Le.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Ge,replace:function(e,t,r,n,i){return e===ze.OVERLONG?(n.push(i),0):(n.push(65533),Ge(e,t,r))}});function Ke(e,t){null==t&&(t=qe.error),e=k(e);const r=[];let n=0;for(;n<e.length;){const i=e[n++];if(i>>7==0){r.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?ze.UNEXPECTED_CONTINUE:ze.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length){n+=t(ze.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i<o;i++){let i=e[n];if(128!=(192&i)){n+=t(ze.MISSING_CONTINUE,n,e,r),s=null;break}s=s<<6|63&i,n++}null!==s&&(s>1114111?n+=t(ze.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(ze.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(ze.OVERLONG,n-1-o,e,r,s):r.push(s))}return r}function He(e,t=je.current){t!=je.current&&(Le.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 o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return k(r)}function Je(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function We(e,t){return'"'+Ke(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Je(e):Je(55296+((e-=65536)>>10&1023))+Je(56320+(1023&e))})).join("")+'"'}function Ve(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Qe(e,t){return Ve(Ke(e,t))}function Ye(e,t=je.current){return Ke(He(e,t))}function Xe(e){return ve(He(e))}class Ze extends be{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=Oe(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return Oe(D(e.readValue().toHexString(),20))}}class $e extends be{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 et=new g(le);function tt(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||et.throwError("cannot encode object for signature with missing names",g.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&et.throwError("cannot encode object for signature with duplicate names",g.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else et.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&et.throwArgumentError("types/value length mismatch","tuple",r);let i=new pe(e.wordSize),o=new pe(e.wordSize),a=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=o.length;e.encode(o,r);let n=i.writeUpdatableValue();a.push((e=>{n(e+t)}))}else e.encode(i,r)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function rt(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),o=n.subReader(r.toNumber());try{i=t.decode(o)}catch(e){if(e.code===g.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===g.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 o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));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 nt extends be{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)),et.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 tt(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&et.throwError("insufficient data length",g.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e<t;e++)r.push(new $e(this.coder));return e.coerce(this.name,rt(e,r))}}class it extends be{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 ot extends be{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=k(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class at extends ot{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,C(super.decode(e)))}}class st extends be{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=k(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,C(e.readBytes(this.size)))}}class ct extends be{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 ft=V.from(-1),ut=V.from(0),lt=V.from(1),dt=V.from(2),ht=V.from("1000000000000000000"),bt=V.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),pt=V.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),mt=V.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class yt extends be{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=V.from(t),n=bt.mask(8*e.wordSize);if(this.signed){let e=n.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(lt).mul(ft)))&&this._throwError("value out-of-bounds",t)}else(r.lt(ut)||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)}}class gt extends ot{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,He(t))}decode(e){return Qe(super.decode(e))}}class vt extends be{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 tt(e,this.coders,t)}decode(e){return e.coerce(this.name,rt(e,this.coders))}}const wt=new g(le),At={};let Et={calldata:!0,memory:!0,storage:!0},_t={calldata:!0,memory:!0};function Tt(e,t){if("bytes"===e||"string"===e){if(Et[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&_t[t])return!0;return(Et[t]||"payable"===t)&&wt.throwArgumentError("invalid modifier","name",t),!1}function kt(e,t){for(let r in t)te(e,r,t[r])}const St=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Pt=new RegExp(/^(.*)\[([0-9]*)\]$/);class xt{constructor(e,t){e!==At&&wt.throwError("use fromString",g.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),kt(this,t);let r=this.type.match(Pt);kt(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=St.sighash),St[e]||wt.throwArgumentError("invalid format type","format",e),e===St.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!==St.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===St.full?", ":",")+")"):t+=this.type,e!==St.sighash&&(!0===this.indexed&&(t+=" indexed"),e===St.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(At,{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){wt.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 o={type:"",name:"",state:{allowType:!0}},a=o;for(let r=0;r<e.length;r++){let o=e[r];switch(o){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||n(r),a.state.allowType=!1,a.type=Lt(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(t||n(r),a.indexed=!0,a.name=""),Tt(a.type,a.name)&&(a.name=""),a.type=Lt(a.type);let e=a;a=a.parent,a||n(r),delete e.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(t||n(r),a.indexed=!0,a.name=""),Tt(a.type,a.name)&&(a.name=""),a.type=Lt(a.type);let s=i(a.parent);a.parent.components.push(s),delete a.parent,a=s;break;case" ":a.state.allowType&&""!==a.type&&(a.type=Lt(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(t||n(r),a.indexed&&n(r),a.indexed=!0,a.name=""):Tt(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||n(r),a.type+=o,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||n(r),a.type+=o,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=o,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=o,delete a.state.allowArray):a.state.readArray?a.type+=o:n(r)}}return a.parent&&wt.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===a.name?(t||n(r.length-7),a.indexed&&n(r.length-7),a.indexed=!0,a.name=""):Tt(a.type,a.name)&&(a.name=""),o.type=Lt(o.type),o}(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 Nt(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let i=0;i<e.length;i++){let o=e[i];","===o&&0===n?(t.push(r),r=""):(r+=o,"("===o?n++:")"===o&&(n--,-1===n&&wt.throwArgumentError("unbalanced parenthesis","value",e)))}return r&&t.push(r),t}(e).map((e=>xt.fromString(e,t)))}class Mt{constructor(e,t){e!==At&&wt.throwError("use a static from method",g.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),kt(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Mt.isFragment(e)?e:"string"==typeof e?Mt.fromString(e):Mt.fromObject(e)}static fromObject(e){if(Mt.isFragment(e))return e;switch(e.type){case"function":return Ft.fromObject(e);case"event":return Ct.fromObject(e);case"constructor":return Bt.fromObject(e);case"error":return Ut.fromObject(e);case"fallback":case"receive":return null}return wt.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]?Ct.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Ft.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Bt.fromString(e.trim()):"error"===e.split(" ")[0]?Ut.fromString(e.substring(5).trim()):wt.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Ct extends Mt{format(e){if(e||(e=St.sighash),St[e]||wt.throwArgumentError("invalid format type","format",e),e===St.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!==St.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===St.full?", ":",")+") ",e!==St.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Ct.fromString(e):Ct.fromObject(e)}static fromObject(e){if(Ct.isEventFragment(e))return e;"event"!==e.type&&wt.throwArgumentError("invalid event object","value",e);const t={name:zt(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(xt.fromObject):[],type:"event"};return new Ct(At,t)}static fromString(e){let t=e.match(Gt);t||wt.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:wt.warn("unknown modifier: "+e)}})),Ct.fromObject({name:t[1].trim(),anonymous:r,inputs:Nt(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Rt(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&wt.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||wt.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=V.from(r[1]),r[0]):e}function It(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 Ot(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&&wt.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&wt.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||wt.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&&wt.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&&wt.throwArgumentError("unable to determine stateMutability","value",e),t}class Bt extends Mt{format(e){if(e||(e=St.sighash),St[e]||wt.throwArgumentError("invalid format type","format",e),e===St.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===St.sighash&&wt.throwError("cannot format a constructor for sighash",g.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===St.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?Bt.fromString(e):Bt.fromObject(e)}static fromObject(e){if(Bt.isConstructorFragment(e))return e;"constructor"!==e.type&&wt.throwArgumentError("invalid constructor object","value",e);let t=Ot(e);t.constant&&wt.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?V.from(e.gas):null};return new Bt(At,r)}static fromString(e){let t={type:"constructor"},r=(e=Rt(e,t)).match(Gt);return r&&"constructor"===r[1].trim()||wt.throwArgumentError("invalid constructor string","value",e),t.inputs=Nt(r[2].trim(),!1),It(r[3].trim(),t),Bt.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Ft extends Bt{format(e){if(e||(e=St.sighash),St[e]||wt.throwArgumentError("invalid format type","format",e),e===St.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!==St.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===St.full?", ":",")+") ",e!==St.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?Ft.fromString(e):Ft.fromObject(e)}static fromObject(e){if(Ft.isFunctionFragment(e))return e;"function"!==e.type&&wt.throwArgumentError("invalid function object","value",e);let t=Ot(e);const r={type:e.type,name:zt(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?V.from(e.gas):null};return new Ft(At,r)}static fromString(e){let t={type:"function"},r=(e=Rt(e,t)).split(" returns ");r.length>2&&wt.throwArgumentError("invalid function string","value",e);let n=r[0].match(Gt);if(n||wt.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&zt(t.name),t.inputs=Nt(n[2],!1),It(n[3].trim(),t),r.length>1){let n=r[1].match(Gt);""==n[1].trim()&&""==n[3].trim()||wt.throwArgumentError("unexpected tokens","value",e),t.outputs=Nt(n[2],!1)}else t.outputs=[];return Ft.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function Dt(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||wt.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Ut extends Mt{format(e){if(e||(e=St.sighash),St[e]||wt.throwArgumentError("invalid format type","format",e),e===St.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==St.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===St.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Ut.fromString(e):Ut.fromObject(e)}static fromObject(e){if(Ut.isErrorFragment(e))return e;"error"!==e.type&&wt.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:zt(e.name),inputs:e.inputs?e.inputs.map(xt.fromObject):[]};return Dt(new Ut(At,t))}static fromString(e){let t={type:"error"},r=e.match(Gt);return r||wt.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&zt(t.name),t.inputs=Nt(r[2],!1),Dt(Ut.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 jt=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function zt(e){return e&&e.match(jt)||wt.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Gt=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),qt=new g(le),Kt=new RegExp(/^bytes([0-9]*)$/),Ht=new RegExp(/^(u?int)([0-9]*)$/);class Jt{constructor(e){te(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Ze(e.name);case"bool":return new it(e.name);case"string":return new gt(e.name);case"bytes":return new at(e.name);case"array":return new nt(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new vt((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new ct(e.name)}let t=e.type.match(Ht);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 yt(r/8,"int"===t[1],e.name)}if(t=e.type.match(Kt),t){let r=parseInt(t[1]);return(0===r||r>32)&&qt.throwArgumentError("invalid bytes length","param",e),new st(r,e.name)}return qt.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new me(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new pe(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(xt.from(e))));return new vt(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&qt.throwError("types/values length mismatch",g.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 vt(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 vt(n,"_").decode(this._getReader(k(t),r))}}const Wt=new Jt,Vt=new g(le);class Qt extends ue{}class Yt extends ue{}class Xt extends ue{}class Zt extends ue{static isIndexed(e){return!(!e||!e._isIndexed)}}const $t={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function er(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class tr{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,te(this,"fragments",t.map((e=>Mt.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 Vt.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]?Vt.warn("duplicate definition - "+r):t[r]=e})),this.deploy||te(this,"deploy",Bt.from({payable:!1,type:"constructor"})),te(this,"_isInterface",!0)}format(e){e||(e=St.full),e===St.sighash&&Vt.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===St.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return Wt}static getAddress(e){return Oe(e)}static getSighash(e){return I(Xe(e.format()),0,4)}static getEventTopic(e){return Xe(e.format())}getFunction(e){if(N(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];Vt.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?Vt.throwArgumentError("no matching function","name",t):r.length>1&&Vt.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Ft.fromString(e).format()];return t||Vt.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(N(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];Vt.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?Vt.throwArgumentError("no matching event","name",t):r.length>1&&Vt.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[Ct.fromString(e).format()];return t||Vt.throwArgumentError("no matching event","signature",e),t}getError(e){if(N(e)){const t=re(this.constructor,"getSighash");for(const r in this.errors)if(e===t(this.errors[r]))return this.errors[r];Vt.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?Vt.throwArgumentError("no matching error","name",t):r.length>1&&Vt.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Ft.fromString(e).format()];return t||Vt.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=k(t);return C(r.slice(0,4))!==this.getSighash(e)&&Vt.throwArgumentError(`data signature does not match error ${e.name}.`,"data",C(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),C(S([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=k(t);return C(r.slice(0,4))!==this.getSighash(e)&&Vt.throwArgumentError(`data signature does not match function ${e.name}.`,"data",C(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),C(S([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=k(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=C(r.slice(0,4)),t=$t[e];if(t)o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.signature,t.reason&&(n=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return Vt.throwError("call revert exception"+i,g.errors.CALL_EXCEPTION,{method:e.format(),data:C(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),C(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Vt.throwError("too many arguments for "+e.format(),g.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?Xe(t):"bytes"===e.type?ve(C(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=V.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),D(C(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?Vt.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map((e=>n(o,e)))):r.push(n(o,t)):null!=t&&Vt.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.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&&Vt.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)r.push(Xe(a));else if("bytes"===e.type)r.push(ve(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[a]))}else n.push(e),i.push(a)})),{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);N(r[0],32)&&r[0].toLowerCase()===t||Vt.throwError("fragment/topic mismatch",g.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];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})),o.push(!0)):(n.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=r?this._abiCoder.decode(n,S(r)):null,s=this._abiCoder.decode(i,t,!0),c=[],f=0,u=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)c[t]=new Zt({_isIndexed:!0,hash:null});else if(o[t])c[t]=new Zt({_isIndexed:!0,hash:a[u++]});else try{c[t]=a[u++]}catch(e){c[t]=e}else try{c[t]=s[f++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw er(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e<c.length;e++){const t=c[e];t instanceof Error&&Object.defineProperty(c,e,{enumerable:!0,get:()=>{throw er(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Yt({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:V.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Qt({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=C(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new Xt({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)}}const rr=new g("abstract-provider/5.7.0");class nr extends ue{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class ir{constructor(){rr.checkAbstract(new.target,ir),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=V.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,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((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)}}var or=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ar=new g("abstract-signer/5.7.0"),sr=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],cr=[g.errors.INSUFFICIENT_FUNDS,g.errors.NONCE_EXPIRED,g.errors.REPLACEMENT_UNDERPRICED];class fr{constructor(){ar.checkAbstract(new.target,fr),te(this,"_isSigner",!0)}getBalance(e){return or(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return or(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return or(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 or(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 or(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 or(this,void 0,void 0,(function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return or(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return or(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return or(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===sr.indexOf(t)&&ar.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=oe(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()&&ar.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return or(this,void 0,void 0,(function*(){const t=yield ne(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>or(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&ar.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||ar.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):ar.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&&ar.throwError("network does not support EIP-1559",g.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):ar.throwError("failed to get consistent fee data",g.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(cr.indexOf(e.code)>=0)throw e;return ar.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",g.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]&&ar.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield ne(t)}))}_checkProvider(e){this.provider||ar.throwError("missing provider",g.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class ur extends fr{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((()=>{ar.throwError(e,g.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 ur(this.address,e)}}var lr=r(485),dr=r.n(lr);function hr(e,t,r){return 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)}},e(r,r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var br=pr;function pr(e,t){if(!e)throw new Error(t||"Assertion failed")}pr.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var mr=hr((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),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),yr=hr((function(e,t){var r=t;r.assert=br,r.toArray=mr.toArray,r.zero2=mr.zero2,r.toHex=mr.toHex,r.encode=mr.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,o=e.clone(),a=0;a<n.length;a++){var s,c=o.andln(i-1);o.isOdd()?(s=c>(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,f=t.andln(3)+o&3;3===c&&(c=-1),3===f&&(f=-1),a=0==(1&c)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==f?c:-c,r[0].push(a),s=0==(1&f)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==c?f:-f,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),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(z())(e,"hex","le")}})),gr=yr.getNAF,vr=yr.getJSF,wr=yr.assert;function Ar(e,t){this.type=e,this.p=new(z())(t.p,16),this.red=t.prime?z().red(t.prime):z().mont(this.p),this.zero=new(z())(0).toRed(this.red),this.one=new(z())(1).toRed(this.red),this.two=new(z())(2).toRed(this.red),this.n=t.n&&new(z())(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 Er=Ar;function _r(e,t){this.curve=e,this.type=t,this.precomputed=null}Ar.prototype.point=function(){throw new Error("Not implemented")},Ar.prototype.validate=function(){throw new Error("Not implemented")},Ar.prototype._fixedNafMul=function(e,t){wr(e.precomputed);var r=e._getDoubles(),n=gr(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<n.length;o+=r.step){a=0;for(var c=o+r.step-1;c>=o;c--)a=(a<<1)+n[c];s.push(a)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=i;l>0;l--){for(o=0;o<s.length;o++)(a=s[o])===l?u=u.mixedAdd(r.points[o]):a===-l&&(u=u.mixedAdd(r.points[o].neg()));f=f.add(u)}return f.toP()},Ar.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=gr(t,r,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var f=o[s];wr(0!==f),a="affine"===e.type?f>0?a.mixedAdd(i[f-1>>1]):a.mixedAdd(i[-f-1>>1].neg()):f>0?a.add(i[f-1>>1]):a.add(i[-f-1>>1].neg())}return"affine"===e.type?a.toP():a},Ar.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,f=this._wnafT2,u=this._wnafT3,l=0;for(o=0;o<n;o++){var d=(s=t[o])._getNAFPoints(e);c[o]=d.wnd,f[o]=d.points}for(o=n-1;o>=1;o-=2){var h=o-1,b=o;if(1===c[h]&&1===c[b]){var p=[t[h],null,null,t[b]];0===t[h].y.cmp(t[b].y)?(p[1]=t[h].add(t[b]),p[2]=t[h].toJ().mixedAdd(t[b].neg())):0===t[h].y.cmp(t[b].y.redNeg())?(p[1]=t[h].toJ().mixedAdd(t[b]),p[2]=t[h].add(t[b].neg())):(p[1]=t[h].toJ().mixedAdd(t[b]),p[2]=t[h].toJ().mixedAdd(t[b].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=vr(r[h],r[b]);for(l=Math.max(y[0].length,l),u[h]=new Array(l),u[b]=new Array(l),a=0;a<l;a++){var g=0|y[0][a],v=0|y[1][a];u[h][a]=m[3*(g+1)+(v+1)],u[b][a]=0,f[h]=p}}else u[h]=gr(r[h],c[h],this._bitLength),u[b]=gr(r[b],c[b],this._bitLength),l=Math.max(u[h].length,l),l=Math.max(u[b].length,l)}var w=this.jpoint(null,null,null),A=this._wnafT4;for(o=l;o>=0;o--){for(var E=0;o>=0;){var _=!0;for(a=0;a<n;a++)A[a]=0|u[a][o],0!==A[a]&&(_=!1);if(!_)break;E++,o--}if(o>=0&&E++,w=w.dblp(E),o<0)break;for(a=0;a<n;a++){var T=A[a];0!==T&&(T>0?s=f[a][T-1>>1]:T<0&&(s=f[a][-T-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o<n;o++)f[o]=null;return i?w:w.toP()},Ar.BasePoint=_r,_r.prototype.eq=function(){throw new Error("Not implemented")},_r.prototype.validate=function(){return this.curve.validate(this)},Ar.prototype.decodePoint=function(e,t){e=yr.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]?wr(e[e.length-1]%2==0):7===e[0]&&wr(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")},_r.prototype.encodeCompressed=function(e){return this.encode(e,!0)},_r.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))},_r.prototype.encode=function(e,t){return yr.encode(this._encode(t),e)},_r.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},_r.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)},_r.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 o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},_r.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}},_r.prototype._getBeta=function(){return null},_r.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var Tr=hr((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}}})),kr=yr.assert;function Sr(e){Er.call(this,"short",e),this.a=new(z())(e.a,16).toRed(this.red),this.b=new(z())(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)}Tr(Sr,Er);var Pr=Sr;function xr(e,t,r,n){Er.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(z())(t,16),this.y=new(z())(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 Nr(e,t,r,n){Er.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(z())(0)):(this.x=new(z())(t,16),this.y=new(z())(r,16),this.z=new(z())(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}Sr.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new(z())(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(z())(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],kr(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(z())(e.a,16),b:new(z())(e.b,16)}})):this._getEndoBasis(r)}}},Sr.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:z().mont(e),r=new(z())(2).toRed(t).redInvm(),n=r.redNeg(),i=new(z())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},Sr.prototype._getEndoBasis=function(e){for(var t,r,n,i,o,a,s,c,f,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,d=this.n.clone(),h=new(z())(1),b=new(z())(0),p=new(z())(0),m=new(z())(1),y=0;0!==l.cmpn(0);){var g=d.div(l);c=d.sub(g.mul(l)),f=p.sub(g.mul(h));var v=m.sub(g.mul(b));if(!n&&c.cmp(u)<0)t=s.neg(),r=h,n=c.neg(),i=f;else if(n&&2==++y)break;s=c,d=l,l=c,p=h,h=f,m=b,b=v}o=c.neg(),a=f;var w=n.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},Sr.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),f=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(f).neg()}},Sr.prototype.pointFromX=function(e,t){(e=new(z())(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)},Sr.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)},Sr.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],c=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),c=c.neg(!0)),n[2*o]=s,n[2*o+1]=c,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var f=this._wnafMulAdd(1,n,i,2*o,r),u=0;u<2*o;u++)n[u]=null,i[u]=null;return f},Tr(xr,Er.BasePoint),Sr.prototype.point=function(e,t,r){return new xr(this,e,t,r)},Sr.prototype.pointFromJSON=function(e,t){return xr.fromJSON(this,e,t)},xr.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}},xr.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]},xr.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 o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},xr.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)+">"},xr.prototype.isInfinity=function(){return this.inf},xr.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)},xr.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),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},xr.prototype.getX=function(){return this.x.fromRed()},xr.prototype.getY=function(){return this.y.fromRed()},xr.prototype.mul=function(e){return e=new(z())(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)},xr.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)},xr.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)},xr.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))},xr.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},xr.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Tr(Nr,Er.BasePoint),Sr.prototype.jpoint=function(e,t,r){return new Nr(this,e,t,r)},Nr.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)},Nr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Nr.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),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),u=f.redMul(s),l=n.redMul(f),d=c.redSqr().redIAdd(u).redISub(l).redISub(l),h=c.redMul(l.redISub(d)).redISub(o.redMul(u)),b=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,b)},Nr.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,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),f=c.redMul(a),u=r.redMul(c),l=s.redSqr().redIAdd(f).redISub(u).redISub(u),d=s.redMul(u.redISub(l)).redISub(i.redMul(f)),h=this.z.redMul(a);return this.curve.jpoint(l,d,h)},Nr.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,o=this.x,a=this.y,s=this.z,c=s.redSqr().redSqr(),f=a.redAdd(a);for(t=0;t<e;t++){var u=o.redSqr(),l=f.redSqr(),d=l.redSqr(),h=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(c)),b=o.redMul(l),p=h.redSqr().redISub(b.redAdd(b)),m=b.redISub(p),y=h.redMul(m);y=y.redIAdd(y).redISub(d);var g=f.redMul(s);t+1<e&&(c=c.redMul(d)),o=p,s=g,f=y}return this.curve.jpoint(o,f.redMul(i),s)},Nr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Nr.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),c=s.redSqr().redISub(a).redISub(a),f=o.redIAdd(o);f=(f=f.redIAdd(f)).redIAdd(f),e=c,t=s.redMul(a.redISub(c)).redISub(f),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),l=this.y.redSqr(),d=l.redSqr(),h=this.x.redAdd(l).redSqr().redISub(u).redISub(d);h=h.redIAdd(h);var b=u.redAdd(u).redIAdd(u),p=b.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=p.redISub(h).redISub(h),t=b.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},Nr.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=s.redSqr().redISub(a).redISub(a);e=c;var f=o.redIAdd(o);f=(f=f.redIAdd(f)).redIAdd(f),t=s.redMul(a.redISub(c)).redISub(f),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),l=this.y.redSqr(),d=this.x.redMul(l),h=this.x.redSub(u).redMul(this.x.redAdd(u));h=h.redAdd(h).redIAdd(h);var b=d.redIAdd(d),p=(b=b.redIAdd(b)).redAdd(b);e=h.redSqr().redISub(p),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(u);var m=l.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(b.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},Nr.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),f=(c=c.redIAdd(c)).redMul(a),u=s.redSqr().redISub(f.redAdd(f)),l=f.redISub(u),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=s.redMul(l).redISub(d),b=r.redAdd(r).redMul(n);return this.curve.jpoint(u,h,b)},Nr.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),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var f=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(c),u=t.redMul(f);u=(u=u.redIAdd(u)).redIAdd(u);var l=this.x.redMul(s).redISub(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.y.redMul(f.redMul(c.redISub(f)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(l,d,h)},Nr.prototype.mul=function(e,t){return e=new(z())(e,t),this.curve._wnafMul(this,e)},Nr.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)},Nr.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}},Nr.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)+">"},Nr.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Mr=hr((function(e,t){var r=t;r.base=Er,r.short=Pr,r.mont=null,r.edwards=null})),Cr=hr((function(e,t){var r,n=t,i=yr.assert;function o(e){"short"===e.type?this.curve=new Mr.short(e):"edwards"===e.type?this.curve=new Mr.edwards(e):this.curve=new Mr.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 a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:dr().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:dr().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:dr().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:dr().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"]}),a("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:dr().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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:dr().sha256,gRed:!1,g:["9"]}),a("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:dr().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}a("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:dr().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Rr(e){if(!(this instanceof Rr))return new Rr(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=mr.toArray(e.entropy,e.entropyEnc||"hex"),r=mr.toArray(e.nonce,e.nonceEnc||"hex"),n=mr.toArray(e.pers,e.persEnc||"hex");br(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Ir=Rr;Rr.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},Rr.prototype._hmac=function(){return new(dr().hmac)(this.hash,this.K)},Rr.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())},Rr.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=mr.toArray(e,t),r=mr.toArray(r,n),br(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Rr.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=mr.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 o=i.slice(0,e);return this._update(r),this._reseed++,mr.encode(o,t)};var Or=yr.assert;function Br(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 Fr=Br;Br.fromPublic=function(e,t,r){return t instanceof Br?t:new Br(e,{pub:t,pubEnc:r})},Br.fromPrivate=function(e,t,r){return t instanceof Br?t:new Br(e,{priv:t,privEnc:r})},Br.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"}},Br.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},Br.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},Br.prototype._importPrivate=function(e,t){this.priv=new(z())(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Br.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?Or(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Or(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)},Br.prototype.derive=function(e){return e.validate()||Or(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Br.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},Br.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},Br.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Dr=yr.assert;function Ur(e,t){if(e instanceof Ur)return e;this._importDER(e,t)||(Dr(e.r&&e.s,"Signature without r or s"),this.r=new(z())(e.r,16),this.s=new(z())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Lr=Ur;function jr(){this.place=0}function zr(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,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function Gr(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 qr(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)}}Ur.prototype._importDER=function(e,t){e=yr.toArray(e,t);var r=new jr;if(48!==e[r.place++])return!1;var n=zr(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=zr(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=zr(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new(z())(o),this.s=new(z())(s),this.recoveryParam=null,!0},Ur.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=Gr(t),r=Gr(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];qr(n,t.length),(n=n.concat(t)).push(2),qr(n,r.length);var i=n.concat(r),o=[48];return qr(o,i.length),o=o.concat(i),yr.encode(o,e)};var Kr=function(){throw new Error("unsupported")},Hr=yr.assert;function Jr(e){if(!(this instanceof Jr))return new Jr(e);"string"==typeof e&&(Hr(Object.prototype.hasOwnProperty.call(Cr,e),"Unknown curve "+e),e=Cr[e]),e instanceof Cr.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 Wr=Jr;Jr.prototype.keyPair=function(e){return new Fr(this,e)},Jr.prototype.keyFromPrivate=function(e,t){return Fr.fromPrivate(this,e,t)},Jr.prototype.keyFromPublic=function(e,t){return Fr.fromPublic(this,e,t)},Jr.prototype.genKeyPair=function(e){e||(e={});for(var t=new Ir({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Kr(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(z())(2));;){var i=new(z())(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Jr.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},Jr.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(z())(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Ir({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new(z())(1)),f=0;;f++){var u=n.k?n.k(f):new(z())(s.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(c)>=0)){var l=this.g.mul(u);if(!l.isInfinity()){var d=l.getX(),h=d.umod(this.n);if(0!==h.cmpn(0)){var b=u.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var p=(l.getY().isOdd()?1:0)|(0!==d.cmp(h)?2:0);return n.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),p^=1),new Lr({r:h,s:b,recoveryParam:p})}}}}}},Jr.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(z())(e,16)),r=this.keyFromPublic(r,n);var i=(t=new Lr(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),f=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),f)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Jr.prototype.recoverPubKey=function(e,t,r,n){Hr((3&r)===r,"The recovery param is more than two bits"),t=new Lr(t,n);var i=this.n,o=new(z())(e),a=t.r,s=t.s,c=1&r,f=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var u=t.r.invm(i),l=i.sub(o).mul(u).umod(i),d=s.mul(u).umod(i);return this.g.mulAdd(l,a,d)},Jr.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Lr(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Vr=hr((function(e,t){var r=t;r.version="6.5.4",r.utils=yr,r.rand=function(){throw new Error("unsupported")},r.curve=Mr,r.curves=Cr,r.ec=Wr,r.eddsa=null})).ec;const Qr=new g("signing-key/5.7.0");let Yr=null;function Xr(){return Yr||(Yr=new Vr("secp256k1")),Yr}class Zr{constructor(e){te(this,"curve","secp256k1"),te(this,"privateKey",C(e)),32!==R(this.privateKey)&&Qr.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=Xr().keyFromPrivate(k(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=Xr().keyFromPublic(k(this.publicKey)),r=Xr().keyFromPublic(k(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=Xr().keyFromPrivate(k(this.privateKey)),r=k(e);32!==r.length&&Qr.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return U({recoveryParam:n.recoveryParam,r:D("0x"+n.r.toString(16),32),s:D("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=Xr().keyFromPrivate(k(this.privateKey)),r=Xr().keyFromPublic(k(en(e)));return D("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function $r(e,t){const r=U(t),n={r:k(r.r),s:k(r.s)};return"0x"+Xr().recoverPubKey(k(e),n,r.recoveryParam).encode("hex",!1)}function en(e,t){const r=k(e);if(32===r.length){const e=new Zr(r);return t?"0x"+Xr().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?C(r):"0x"+Xr().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+Xr().keyFromPublic(r).getPublic(!0,"hex"):C(r):Qr.throwArgumentError("invalid public or private key","key","[REDACTED]")}const tn=new g("transactions/5.7.0");var rn;function nn(e){return"0x"===e?null:Oe(e)}function on(e){return"0x"===e?ut:V.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(rn||(rn={}));const an=[{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"}],sn={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function cn(e){return Oe(I(ve(I(en(e),1)),12))}function fn(e,t){return cn($r(k(e),t))}function un(e,t){const r=P(V.from(e).toHexString());return r.length>32&&tn.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function ln(e,t){return{address:Oe(e),storageKeys:(t||[]).map(((t,r)=>(32!==R(t)&&tn.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function dn(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&tn.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),ln(e[0],e[1])):ln(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return ln(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function hn(e){return dn(e).map((e=>[e.address,e.storageKeys]))}function bn(e,t){if(null!=e.gasPrice){const t=V.from(e.gasPrice),r=V.from(e.maxFeePerGas||0);t.eq(r)||tn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[un(e.chainId||0,"chainId"),un(e.nonce||0,"nonce"),un(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),un(e.maxFeePerGas||0,"maxFeePerGas"),un(e.gasLimit||0,"gasLimit"),null!=e.to?Oe(e.to):"0x",un(e.value||0,"value"),e.data||"0x",hn(e.accessList||[])];if(t){const e=U(t);r.push(un(e.recoveryParam,"recoveryParam")),r.push(P(e.r)),r.push(P(e.s))}return O(["0x02",Te(r)])}function pn(e,t){const r=[un(e.chainId||0,"chainId"),un(e.nonce||0,"nonce"),un(e.gasPrice||0,"gasPrice"),un(e.gasLimit||0,"gasLimit"),null!=e.to?Oe(e.to):"0x",un(e.value||0,"value"),e.data||"0x",hn(e.accessList||[])];if(t){const e=U(t);r.push(un(e.recoveryParam,"recoveryParam")),r.push(P(e.r)),r.push(P(e.s))}return O(["0x01",Te(r)])}function mn(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&tn.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){ie(e,sn);const r=[];an.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=k(C(n,i)),t.length&&n.length!==t.length&&n.length>0&&tn.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=P(n),n.length>t.maxLength&&tn.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(C(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&tn.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!E(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(C(n)),r.push("0x"),r.push("0x")),!t)return Te(r);const i=U(t);let o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&tn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&tn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(C(o)),r.push(P(k(i.r))),r.push(P(k(i.s))),Te(r)}(e,t);switch(e.type){case 1:return pn(e,t);case 2:return bn(e,t)}return tn.throwError(`unsupported transaction type: ${e.type}`,g.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function yn(e,t,r){try{const r=on(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){tn.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=D(t[1],32),e.s=D(t[2],32);try{const t=ve(r(e));e.from=fn(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function gn(e){const t=k(e);if(t[0]>127)return function(e){const t=Pe(e);9!==t.length&&6!==t.length&&tn.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:on(t[0]).toNumber(),gasPrice:on(t[1]),gasLimit:on(t[2]),to:nn(t[3]),value:on(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=V.from(t[6]).toNumber()}catch(e){return r}if(r.r=D(t[7],32),r.s=D(t[8],32),V.from(r.r).isZero()&&V.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(C(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=ve(Te(i));try{r.from=fn(o,{r:C(r.r),s:C(r.s),recoveryParam:n})}catch(e){}r.hash=ve(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=Pe(e.slice(1));8!==t.length&&11!==t.length&&tn.throwArgumentError("invalid component count for transaction type: 1","payload",C(e));const r={type:1,chainId:on(t[0]).toNumber(),nonce:on(t[1]).toNumber(),gasPrice:on(t[2]),gasLimit:on(t[3]),to:nn(t[4]),value:on(t[5]),data:t[6],accessList:dn(t[7])};return 8===t.length||(r.hash=ve(e),yn(r,t.slice(8),pn)),r}(t);case 2:return function(e){const t=Pe(e.slice(1));9!==t.length&&12!==t.length&&tn.throwArgumentError("invalid component count for transaction type: 2","payload",C(e));const r=on(t[2]),n=on(t[3]),i={type:2,chainId:on(t[0]).toNumber(),nonce:on(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:on(t[4]),to:nn(t[5]),value:on(t[6]),data:t[7],accessList:dn(t[8])};return 9===t.length||(i.hash=ve(e),yn(i,t.slice(9),bn)),i}(t)}return tn.throwError(`unsupported transaction type: ${t[0]}`,g.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var vn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const wn=new g("contracts/5.7.0"),An={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function En(e,t){return vn(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&wn.throwArgumentError("invalid address or ENS name","name",r);try{return Oe(r)}catch(e){}e||wn.throwError("a provider or signer is needed to resolve ENS names",g.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&wn.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function _n(e,t,r){return vn(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>_n(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield En(e,t):"tuple"===r.type?yield _n(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>_n(e,t,r.arrayChildren)))):Promise.reject(wn.makeError("invalid value for array",g.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function Tn(e,t,r){return vn(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=oe(r.pop())),wn.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=ne({override:En(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>vn(this,void 0,void 0,(function*(){return Oe(e.signer)!==e.override&&wn.throwError("Contract with a Signer cannot override from",g.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=En(e.provider,n.from));const i=yield ne({args:_n(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:ne(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=V.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=V.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=V.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=V.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=V.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=dn(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=k(o);for(let t=0;t<r.length;t++)e+=4,r[t]&&(e+=64);a.gasLimit=V.from(t.gas).add(e)}if(s.value){const e=V.from(s.value);e.isZero()||t.payable||wn.throwError("non-payable method cannot override value",g.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),a.value=e}s.customData&&(a.customData=oe(s.customData)),s.ccipReadEnabled&&(a.ccipReadEnabled=!!s.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 c=Object.keys(n).filter((e=>null!=n[e]));return c.length&&wn.throwError(`cannot override ${c.map((e=>JSON.stringify(e))).join(",")}`,g.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),a}))}function kn(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=fe(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)))}function Sn(e,t,r){const n=e.signer||e.provider;return function(...i){return vn(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=oe(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const a=yield Tn(e,t,i),s=yield n.call(a,o);try{let n=e.interface.decodeFunctionResult(t,s);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===g.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function Pn(e,t,r){return t.constant?Sn(e,t,r):function(e,t){return function(...r){return vn(this,void 0,void 0,(function*(){e.signer||wn.throwError("sending a transaction requires a signer",g.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield Tn(e,t,r),i=yield e.signer.sendTransaction(n);return kn(e,i),i}))}}(e,t)}function xn(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 Nn{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 Mn extends Nn{constructor(){super("error",null)}}class Cn extends Nn{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&wn.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(xn(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=he(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class Rn extends Nn{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 In{constructor(e,t,r){te(this,"interface",re(new.target,"getInterface")(t)),null==r?(te(this,"provider",null),te(this,"signer",null)):fr.isSigner(r)?(te(this,"provider",r.provider||null),te(this,"signer",r)):ir.isProvider(r)?(te(this,"provider",r),te(this,"signer",null)):wn.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]]):wn.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(te(this,"_runningEvents",{}),te(this,"_wrappedEmits",{}),null==e&&wn.throwArgumentError("invalid contract address or ENS name","addressOrName",e),te(this,"address",e),this.provider)te(this,"resolvedAddress",En(this.provider,e));else try{te(this,"resolvedAddress",Promise.resolve(Oe(e)))}catch(e){wn.throwError("provider is required to use ENS name as contract address",g.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])wn.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,Pn(this,t,!0)),null==this.functions[e]&&te(this.functions,e,Pn(this,t,!1)),null==this.callStatic[e]&&te(this.callStatic,e,Sn(this,t,!0)),null==this.populateTransaction[e]&&te(this.populateTransaction,e,function(e,t){return function(...r){return Tn(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 vn(this,void 0,void 0,(function*(){r||wn.throwError("estimate require a provider or signer",g.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Tn(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 De(e)}static getInterface(e){return tr.isInterface(e)?e:new tr(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&&wn.throwError("contract not deployed",g.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||wn.throwError("sending a transactions require a signer",g.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=oe(e||{});return["from","to"].forEach((function(e){null!=t[e]&&wn.throwError("cannot override "+e,g.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new ur(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 Zt.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 Mn);if("event"===e)return this._normalizeRunningEvent(new Nn("event",null));if("*"===e)return this._normalizeRunningEvent(new Rn(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Cn(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 Cn(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Nn(xn(t),t))}return this._normalizeRunningEvent(new Rn(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=fe(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||wn.throwError("events require a provider or a signer with a provider",g.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=oe(n.filter);return"string"==typeof t&&N(t,32)?(null!=r&&wn.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 On extends In{}class Bn{constructor(e,t,r){let n=null;n="string"==typeof t?t:T(t)?C(t):t&&"string"==typeof t.object?t.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!N(n)||n.length%2)&&wn.throwArgumentError("invalid bytecode","bytecode",t),r&&!fr.isSigner(r)&&wn.throwArgumentError("invalid signer","signer",r),te(this,"bytecode",n),te(this,"interface",re(new.target,"getInterface")(e)),te(this,"signer",r||null)}getDeployTransaction(...e){let t={};if(e.length===this.interface.deploy.inputs.length+1&&"object"==typeof e[e.length-1]){t=oe(e.pop());for(const e in t)if(!An[e])throw new Error("unknown transaction override "+e)}return["data","from","to"].forEach((e=>{null!=t[e]&&wn.throwError("cannot override "+e,g.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.value&&(V.from(t.value).isZero()||this.interface.deploy.payable||wn.throwError("non-payable constructor cannot override value",g.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})),wn.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=C(S([this.bytecode,this.interface.encodeDeploy(e)])),t}deploy(...e){return vn(this,void 0,void 0,(function*(){let t={};e.length===this.interface.deploy.inputs.length+1&&(t=e.pop()),wn.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");const r=yield _n(this.signer,e,this.interface.deploy.inputs);r.push(t);const n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=re(this.constructor,"getContractAddress")(i),a=re(this.constructor,"getContract")(o,this.interface,this.signer);return kn(a,i),te(a,"deployTransaction",i),a}))}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,t){null==e&&wn.throwError("missing compiler output",g.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof e&&(e=JSON.parse(e));const r=e.abi;let n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}static getInterface(e){return On.getInterface(e)}static getContractAddress(e){return De(e)}static getContract(e,t,r){return new On(e,t,r)}}const Fn=new g(G),Dn={},Un=V.from(0),Ln=V.from(-1);function jn(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),Fn.throwError(e,g.errors.NUMERIC_FAULT,i)}let zn="0";for(;zn.length<256;)zn+=zn;function Gn(e){if("number"!=typeof e)try{e=V.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+zn.substring(0,e):Fn.throwArgumentError("invalid decimal size","decimals",e)}function qn(e,t){null==t&&(t=0);const r=Gn(t),n=(e=V.from(e)).lt(Un);n&&(e=e.mul(Ln));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 o=e.div(r).toString();return e=1===r.length?o:o+"."+i,n&&(e="-"+e),e}function Kn(e,t){null==t&&(t=0);const r=Gn(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||Fn.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&Fn.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&Fn.throwArgumentError("too many decimal points","value",e);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&jn("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<r.length-1;)a+="0";const s=V.from(o),c=V.from(a);let f=s.mul(r).add(c);return n&&(f=f.mul(Ln)),f}class Hn{constructor(e,t,r,n){e!==Dn&&Fn.throwError("cannot use FixedFormat constructor; use FixedFormat.from",g.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=Gn(n),Object.freeze(this)}static from(e){if(e instanceof Hn)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||Fn.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&&Fn.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&&Fn.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&Fn.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new Hn(Dn,t,r,n)}}class Jn{constructor(e,t,r,n){e!==Dn&&Fn.throwError("cannot use FixedNumber constructor; use FixedNumber.from",g.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&&Fn.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=Kn(this._value,this.format.decimals),r=Kn(e._value,e.format.decimals);return Jn.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=Kn(this._value,this.format.decimals),r=Kn(e._value,e.format.decimals);return Jn.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=Kn(this._value,this.format.decimals),r=Kn(e._value,e.format.decimals);return Jn.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=Kn(this._value,this.format.decimals),r=Kn(e._value,e.format.decimals);return Jn.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=Jn.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(Wn.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Jn.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(Wn.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)&&Fn.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=Jn.from("1"+zn.substring(0,e),this.format),n=Vn.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&&Fn.throwArgumentError("invalid byte width","width",e),D(V.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Jn.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(V.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||N(e)||"bigint"==typeof e||T(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),Jn.fromString(qn(e,t),Hn.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=Hn.from(t),n=Kn(e,r.decimals);!r.signed&&n.lt(Un)&&jn("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=D(i,r.width/8));const o=qn(n,r.decimals);return new Jn(Dn,i,o,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=Hn.from(t);if(k(e).length>r.width/8)throw new Error("overflow");let n=V.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=qn(n,r.decimals);return new Jn(Dn,i,o,r)}static from(e,t){if("string"==typeof e)return Jn.fromString(e,t);if(T(e))return Jn.fromBytes(e,t);try{return Jn.fromValue(e,0,t)}catch(e){if(e.code!==g.errors.INVALID_ARGUMENT)throw e}return Fn.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const Wn=Jn.from(1),Vn=Jn.from("0.5"),Qn="Ethereum Signed Message:\n";function Yn(e){return"string"==typeof e&&(e=He(e)),ve(S([He(Qn),He(String(e.length)),e]))}const Xn="hash/5.7.0";const Zn=new g(Xn),$n=new Uint8Array(32);$n.fill(0);const ei=V.from(-1),ti=V.from(0),ri=V.from(1),ni=V.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ii=D(ri.toHexString(),32),oi=D(ti.toHexString(),32),ai={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},si=["name","version","chainId","verifyingContract","salt"];function ci(e){return function(t){return"string"!=typeof t&&Zn.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const fi={name:ci("name"),version:ci("version"),chainId:function(e){try{return V.from(e).toString()}catch(e){}return Zn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return Oe(e).toLowerCase()}catch(e){}return Zn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=k(e);if(32!==t.length)throw new Error("bad length");return C(t)}catch(e){}return Zn.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function ui(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))&&Zn.throwArgumentError("invalid numeric width","type",e);const i=ni.mask(r?n-1:n),o=r?i.add(ri).mul(ei):ti;return function(t){const r=V.from(t);return(r.lt(o)||r.gt(i))&&Zn.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),D(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))&&Zn.throwArgumentError("invalid bytes width","type",e),function(t){return k(t).length!==r&&Zn.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=k(e),r=t.length%32;return r?O([t,$n.slice(r)]):C(t)}(t)}}}switch(e){case"address":return function(e){return D(Oe(e),32)};case"bool":return function(e){return e?ii:oi};case"bytes":return function(e){return ve(e)};case"string":return function(e){return Xe(e)}}return null}function li(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class di{constructor(e){te(this,"types",Object.freeze(fe(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((o=>{i[o.name]&&Zn.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",e),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===n&&Zn.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),ui(a)||(r[a]||Zn.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),r[a].push(n),t[n][a]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?Zn.throwArgumentError("missing primary type","types",e):i.length>1&&Zn.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),te(this,"primaryType",i[0]),function i(o,a){a[o]&&Zn.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),a[o]=!0,Object.keys(t[o]).forEach((e=>{r[e]&&(i(e,a),Object.keys(a).forEach((t=>{n[t][e]=!0})))})),delete a[o]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=li(t,e[t])+r.map((t=>li(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=ui(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&&Zn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(ve)),ve(O(i))}}const r=this.types[e];if(r){const t=Xe(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?ve(n):n}));return n.unshift(t),O(n)}}return Zn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Zn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return ve(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(ui(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&&Zn.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)),{}):Zn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new di(e)}static getPrimaryType(e){return di.from(e).primaryType}static hashStruct(e,t,r){return di.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=ai[r];n||Zn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>si.indexOf(e.name)-si.indexOf(t.name))),di.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return O(["0x1901",di.hashDomain(e),di.from(t).hash(r)])}static hash(e,t,r){return ve(di.encode(e,t,r))}static resolveNames(e,t,r,n){return i=this,o=void 0,s=function*(){e=oe(e);const i={};e.verifyingContract&&!N(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=di.from(t);o.visit(r,((e,t)=>("address"!==e||N(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=o.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{c(s.next(e))}catch(e){t(e)}}function n(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}c((s=s.apply(i,o||[])).next())}));var i,o,a,s}static getPayload(e,t,r){di.hashDomain(e);const n={},i=[];si.forEach((t=>{const r=e[t];null!=r&&(n[t]=fi[t](r),i.push({name:t,type:ai[t]}))}));const o=di.from(t),a=oe(t);return a.EIP712Domain?Zn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=i,o.encode(r),{types:a,domain:n,primaryType:o.primaryType,message:o.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return C(k(t));if(e.match(/^u?int/))return V.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Zn.throwArgumentError("invalid string","value",t),t}return Zn.throwArgumentError("unsupported type","type",e)}))}}}class hi{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=k(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 k(new Uint8Array(t.reverse()))}}new hi("abcdefghijklmnopqrstuvwxyz234567");const bi=new hi("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var pi;!function(e){e.sha256="sha256",e.sha512="sha512"}(pi||(pi={}));const mi=new g("sha2/5.7.0");function yi(e){return"0x"+dr().ripemd160().update(k(e)).digest("hex")}function gi(e){return"0x"+dr().sha256().update(k(e)).digest("hex")}function vi(e){return"0x"+dr().sha512().update(k(e)).digest("hex")}function wi(e,t,r){return pi[e]||mi.throwError("unsupported algorithm "+e,g.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+dr().hmac(dr()[e],k(t)).update(k(r)).digest("hex")}function Ai(e,t,r,n,i){let o;e=k(e),t=k(t);let a=1;const s=new Uint8Array(n),c=new Uint8Array(t.length+4);let f,u;c.set(t);for(let l=1;l<=a;l++){c[t.length]=l>>24&255,c[t.length+1]=l>>16&255,c[t.length+2]=l>>8&255,c[t.length+3]=255&l;let d=k(wi(i,e,c));o||(o=d.length,u=new Uint8Array(o),a=Math.ceil(n/o),f=n-(a-1)*o),u.set(d);for(let t=1;t<r;t++){d=k(wi(i,e,d));for(let e=0;e<o;e++)u[e]^=d[e]}const h=(l-1)*o,b=l===a?f:o;s.set(k(u).slice(0,b),h)}return C(s)}const Ei=new g("wordlists/5.7.0");class _i{constructor(e){Ei.checkAbstract(new.target,_i),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 Xe(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}let Ti=null;function ki(e){if(null==Ti&&(Ti="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==_i.check(e)))throw Ti=null,new Error("BIP39 Wordlist for en (English) FAILED")}const Si=new class extends _i{constructor(){super("en")}getWord(e){return ki(this),Ti[e]}getWordIndex(e){return ki(this),Ti.indexOf(e)}};_i.register(Si);const Pi={en:Si},xi=new g("hdnode/5.7.0"),Ni=V.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Mi=He("Bitcoin seed"),Ci=2147483648;function Ri(e){return(1<<e)-1<<8-e}function Ii(e){return D(C(e),32)}function Oi(e){return bi.encode(S([e,I(gi(gi(e)),0,4)]))}function Bi(e){if(null==e)return Pi.en;if("string"==typeof e){const t=Pi[e];return null==t&&xi.throwArgumentError("unknown locale","wordlist",e),t}return e}const Fi={},Di="m/44'/60'/0'/0/0";class Ui{constructor(e,t,r,n,i,o,a,s){if(e!==Fi)throw new Error("HDNode constructor cannot be called directly");if(t){const e=new Zr(t);te(this,"privateKey",e.privateKey),te(this,"publicKey",e.compressedPublicKey)}else te(this,"privateKey",null),te(this,"publicKey",C(r));te(this,"parentFingerprint",n),te(this,"fingerprint",I(yi(gi(this.publicKey)),0,4)),te(this,"address",cn(this.publicKey)),te(this,"chainCode",i),te(this,"index",o),te(this,"depth",a),null==s?(te(this,"mnemonic",null),te(this,"path",null)):"string"==typeof s?(te(this,"mnemonic",null),te(this,"path",s)):(te(this,"mnemonic",s),te(this,"path",s.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return Oi(S([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",C(this.depth),this.parentFingerprint,D(C(this.index),4),this.chainCode,null!=this.privateKey?S(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Ui(Fi,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+="/"+(e&~Ci));const r=new Uint8Array(37);if(e&Ci){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(k(this.privateKey),1),t&&(t+="'")}else r.set(k(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=k(wi(pi.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let a=null,s=null;this.privateKey?a=Ii(V.from(i).add(this.privateKey).mod(Ni)):s=new Zr(C(i))._addPoint(this.publicKey);let c=t;const f=this.mnemonic;return f&&(c=Object.freeze({phrase:f.phrase,path:t,locale:f.locale||"en"})),new Ui(Fi,a,s,this.fingerprint,Ii(o),e,this.depth+1,c)}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>=Ci)throw new Error("invalid path index - "+n);r=r._derive(Ci+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=Ci)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=k(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=k(wi(pi.sha512,Mi,r));return new Ui(Fi,Ii(n.slice(0,32)),null,"0x00000000",Ii(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=zi(ji(e,r=Bi(r)),r),Ui._fromSeed(Li(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return Ui._fromSeed(e,null)}static fromExtendedKey(e){const t=bi.decode(e);82===t.length&&Oi(t.slice(0,78))===e||xi.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=C(t.slice(5,9)),i=parseInt(C(t.slice(9,13)).substring(2),16),o=C(t.slice(13,45)),a=t.slice(45,78);switch(C(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Ui(Fi,null,C(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new Ui(Fi,C(a.slice(1)),null,n,o,i,r,null)}return xi.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Li(e,t){t||(t="");const r=He("mnemonic"+t,je.NFKD);return Ai(He(e,je.NFKD),r,2048,64,"sha512")}function ji(e,t){t=Bi(t),xi.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=k(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let e=0;e<r.length;e++){let o=t.getWordIndex(r[e].normalize("NFKD"));if(-1===o)throw new Error("invalid mnemonic");for(let e=0;e<11;e++)o&1<<10-e&&(n[i>>3]|=1<<7-i%8),i++}const o=32*r.length/3,a=Ri(r.length/3);if((k(gi(n.slice(0,o/8)))[0]&a)!=(n[n.length-1]&a))throw new Error("invalid checksum");return C(n.slice(0,o/8))}function zi(e,t){if(t=Bi(t),(e=k(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,o=k(gi(e))[0]&Ri(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}function Gi(e,t){try{return ji(e,t),!0}catch(e){}return!1}function qi(e){return("number"!=typeof e||e<0||e>=Ci||e%1)&&xi.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}const Ki=new g("random/5.7.0"),Hi=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();let Ji=Hi.crypto||Hi.msCrypto;function Wi(e){(e<=0||e>1024||e%1||e!=e)&&Ki.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return Ji.getRandomValues(t),k(t)}Ji&&Ji.getRandomValues||(Ki.warn("WARNING: Missing strong random number source"),Ji={getRandomValues:function(e){return Ki.throwError("no secure random source avaialble",g.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var Vi=r(202),Qi=r.n(Vi),Yi=r(689),Xi=r.n(Yi);function Zi(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),k(e)}function $i(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function eo(e){return"string"==typeof e?He(e,je.NFKC):k(e)}function to(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 ro(e){const t=k(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=C(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const no="json-wallets/5.7.0";const io=new g(no);function oo(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class ao extends ue{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function so(e,t){const r=Zi(to(e,"crypto/ciphertext"));if(C(ve(S([t.slice(16,32),r]))).substring(2)!==to(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===to(e,"crypto/cipher")){const n=Zi(to(e,"crypto/cipherparams/iv")),i=new(Qi().Counter)(n);return k(new(Qi().ModeOfOperation.ctr)(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||io.throwError("unsupported cipher",g.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=cn(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),Oe(t)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:C(n)};if("0.1"===to(e,"x-ethers/version")){const t=Zi(to(e,"x-ethers/mnemonicCiphertext")),r=Zi(to(e,"x-ethers/mnemonicCounter")),n=new(Qi().Counter)(r),o=new(Qi().ModeOfOperation.ctr)(i,n),s=to(e,"x-ethers/path")||Di,c=to(e,"x-ethers/locale")||"en",f=k(o.decrypt(t));try{const e=zi(f,c),t=Ui.fromMnemonic(e,null,c).derivePath(s);if(t.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=t.mnemonic}catch(e){if(e.code!==g.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new ao(a)}function co(e,t,r,n,i){return k(Ai(e,t,r,n,i))}function fo(e,t,r,n,i){return Promise.resolve(co(e,t,r,n,i))}function uo(e,t,r,n,i){const o=eo(t),a=to(e,"crypto/kdf");if(a&&"string"==typeof a){const t=function(e,t){return io.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){const r=Zi(to(e,"crypto/kdfparams/salt")),s=parseInt(to(e,"crypto/kdfparams/n")),c=parseInt(to(e,"crypto/kdfparams/r")),f=parseInt(to(e,"crypto/kdfparams/p"));s&&c&&f||t("kdf",a),0!=(s&s-1)&&t("N",s);const u=parseInt(to(e,"crypto/kdfparams/dklen"));return 32!==u&&t("dklen",u),n(o,r,s,c,f,64,i)}if("pbkdf2"===a.toLowerCase()){const n=Zi(to(e,"crypto/kdfparams/salt"));let i=null;const a=to(e,"crypto/kdfparams/prf");"hmac-sha256"===a?i="sha256":"hmac-sha512"===a?i="sha512":t("prf",a);const s=parseInt(to(e,"crypto/kdfparams/c")),c=parseInt(to(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(o,n,s,c,i)}}return io.throwArgumentError("unsupported key-derivation function","kdf",a)}const lo=new g(no);class ho extends ue{isCrowdsaleAccount(e){return!(!e||!e._isCrowdsaleAccount)}}function bo(e,t){const r=JSON.parse(e);t=eo(t);const n=Oe(to(r,"ethaddr")),i=Zi(to(r,"encseed"));i&&i.length%16==0||lo.throwArgumentError("invalid encseed","json",e);const o=k(Ai(t,t,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),s=i.slice(16),c=new(Qi().ModeOfOperation.cbc)(o,a),f=Qi().padding.pkcs7.strip(k(c.decrypt(s)));let u="";for(let e=0;e<f.length;e++)u+=String.fromCharCode(f[e]);const l=ve(He(u));return new ho({_isCrowdsaleAccount:!0,address:n,privateKey:l})}function po(e){let t=null;try{t=JSON.parse(e)}catch(e){return!1}return t.encseed&&t.ethaddr}function mo(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 yo(e){if(po(e))try{return Oe(JSON.parse(e).ethaddr)}catch(e){return null}if(mo(e))try{return Oe(JSON.parse(e).address)}catch(e){return null}return null}function go(e,t,r){if(po(e)){r&&r(0);const n=bo(e,t);return r&&r(1),Promise.resolve(n)}return mo(e)?function(e,t,r){return n=this,i=void 0,a=function*(){const n=JSON.parse(e);return so(n,yield uo(n,t,fo,Xi().scrypt,r))},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{c(a.next(e))}catch(e){t(e)}}function s(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}c((a=a.apply(n,i||[])).next())}));var n,i,o,a}(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}var vo=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const wo=new g("wallet/5.7.0");class Ao extends fr{constructor(e,t){if(super(),null!=(r=e)&&N(r.privateKey,32)&&null!=r.address){const t=new Zr(e.privateKey);if(te(this,"_signingKey",(()=>t)),te(this,"address",cn(this.publicKey)),this.address!==Oe(e.address)&&wo.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||Di,locale:t.locale||"en"})));const r=this.mnemonic;cn(Ui.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&wo.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else te(this,"_mnemonic",(()=>null))}else{if(Zr.isSigningKey(e))"secp256k1"!==e.curve&&wo.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 Zr(e);te(this,"_signingKey",(()=>t))}te(this,"_mnemonic",(()=>null)),te(this,"address",cn(this.publicKey))}var r;t&&!ir.isProvider(t)&&wo.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 Ao(this,e)}signTransaction(e){return ne(e).then((t=>{null!=t.from&&(Oe(t.from)!==this.address&&wo.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(ve(mn(t)));return mn(t,r)}))}signMessage(e){return vo(this,void 0,void 0,(function*(){return L(this._signingKey().signDigest(Yn(e)))}))}_signTypedData(e,t,r){return vo(this,void 0,void 0,(function*(){const n=yield di.resolveNames(e,t,r,(e=>(null==this.provider&&wo.throwError("cannot resolve ENS names without a provider",g.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return L(this._signingKey().signDigest(di.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(Oe(e.address)!==cn(e.privateKey))throw new Error("address/privateKey mismatch");if(oo(e)){const t=e.mnemonic;if(Ui.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||Di).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=k(e.privateKey),o=eo(t);let a=null,s=null,c=null;if(oo(e)){const t=e.mnemonic;a=k(ji(t.phrase,t.locale||"en")),s=t.path||Di,c=t.locale||"en"}let f=r.client;f||(f="ethers.js");let u=null;u=r.salt?k(r.salt):Wi(32);let l=null;if(r.iv){if(l=k(r.iv),16!==l.length)throw new Error("invalid iv")}else l=Wi(16);let d=null;if(r.uuid){if(d=k(r.uuid),16!==d.length)throw new Error("invalid uuid")}else d=Wi(16);let h=1<<17,b=8,p=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(b=r.scrypt.r),r.scrypt.p&&(p=r.scrypt.p)),Xi().scrypt(o,u,h,b,p,64,n).then((t=>{const r=(t=k(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),m=new(Qi().Counter)(l),y=k(new(Qi().ModeOfOperation.ctr)(r,m).encrypt(i)),g=ve(S([n,y])),v={address:e.address.substring(2).toLowerCase(),id:ro(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:C(l).substring(2)},ciphertext:C(y).substring(2),kdf:"scrypt",kdfparams:{salt:C(u).substring(2),n:h,dklen:32,p,r:b},mac:g.substring(2)}};if(a){const e=Wi(16),t=new(Qi().Counter)(e),r=k(new(Qi().ModeOfOperation.ctr)(o,t).encrypt(a)),n=new Date,i=n.getUTCFullYear()+"-"+$i(n.getUTCMonth()+1,2)+"-"+$i(n.getUTCDate(),2)+"T"+$i(n.getUTCHours(),2)+"-"+$i(n.getUTCMinutes(),2)+"-"+$i(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:f,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:C(e).substring(2),mnemonicCiphertext:C(r).substring(2),path:s,locale:c,version:"0.1"}}return JSON.stringify(v)}))}(this,e,t,r)}static createRandom(e){let t=Wi(16);e||(e={}),e.extraEntropy&&(t=k(I(ve(S([t,e.extraEntropy])),0,16)));const r=zi(t,e.locale);return Ao.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return go(e,t,r).then((e=>new Ao(e)))}static fromEncryptedJsonSync(e,t){return new Ao(function(e,t){if(po(e))return bo(e,t);if(mo(e))return function(e,t){const r=JSON.parse(e);return so(r,uo(r,t,co,Xi().syncScrypt))}(e,t);throw new Error("invalid JSON wallet")}(e,t))}static fromMnemonic(e,t,r){return t||(t=Di),new Ao(Ui.fromMnemonic(e,null,r).derivePath(t))}}function Eo(e,t){return fn(Yn(e),t)}function _o(e,t,r,n){return fn(di.hash(e,t,r),n)}const To="0x0000000000000000000000000000000000000000",ko="0x0000000000000000000000000000000000000000000000000000000000000000",So="Ξ",Po=new g("networks/5.7.1");function xo(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 o=new t.PocketProvider(e,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}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"],o=new t.AnkrProvider(e,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}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 xo(e)},t}function No(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return No(e,t)},r}const Mo={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:xo("homestead")},Co={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:xo("ropsten")},Ro={chainId:63,name:"classicMordor",_defaultProvider:No("https://www.ethercluster.com/mordor","classicMordor")},Io={unspecified:{chainId:0,name:"unspecified"},homestead:Mo,mainnet:Mo,morden:{chainId:2,name:"morden"},ropsten:Co,testnet:Co,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:xo("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:xo("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:xo("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:xo("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:No("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Ro,classicTestnet:Ro,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:No("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:xo("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:xo("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 Oo(e){if(null==e)return null;if("number"==typeof e){for(const t in Io){const r=Io[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=Io[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=Io[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 Bo(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return k(t)}function Fo(e){e=k(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Do(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 Uo(e){return 1&e?~e>>1:e>>1}function Lo(e,t){let r=Array(e);for(let n=0,i=-1;n<e;n++)r[n]=i+=1+t();return r}function jo(e,t){let r=Array(e);for(let n=0,i=0;n<e;n++)r[n]=i+=Uo(t());return r}function zo(e,t){let r=Lo(e(),e),n=e(),i=Lo(n,e),o=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<o[e];t++)r.push(i[e]+t);return t?r.map((e=>t[e])):r}function Go(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;i<t;i++)jo(e,r).forEach(((e,t)=>n[t].push(e)));return n}function qo(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 Do(Go(i.length,1+e,t).map(((e,t)=>{const o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*n;return[o+t*r,a.map((e=>e+i))]}))})))}function Ko(e,t){return Go(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const Ho=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,o=[0,1];for(let e=1;e<n;e++)o.push(i+=r());let a=r(),s=t;t+=a;let c=0,f=0;function u(){return 0==c&&(f=f<<8|e[t++],c=8),f>>--c&1}const l=Math.pow(2,31),d=l>>>1,h=d>>1,b=l-1;let p=0;for(let e=0;e<31;e++)p=p<<1|u();let m=[],y=0,g=l;for(;;){let e=Math.floor(((p-y+1)*i-1)/g),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<o[n]?r=n:t=n}if(0==t)break;m.push(t);let a=y+Math.floor(g*o[t]/i),s=y+Math.floor(g*o[t+1]/i)-1;for(;0==((a^s)&d);)p=p<<1&b|u(),a=a<<1&b,s=s<<1&b|1;for(;a&~s&h;)p=p&d|p<<1&b>>>1|u(),a=a<<1^d,s=(s^d)<<1|d|1;y=a,g=1+s-a}let v=n-4;return m.map((t=>{switch(t-v){case 3:return v+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return v+256+(e[s++]<<8|e[s++]);case 1:return v+e[s++];default:return t-1}}))}(Bo("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=="))),Jo=new Set(zo(Ho)),Wo=new Set(zo(Ho)),Vo=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(qo(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Ko(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}(Do(t))}(Ho),Qo=function(e){let t=zo(e).sort(((e,t)=>e-t));return function r(){let n=[];for(;;){let i=zo(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(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:a,save:1==i,check:2==i}}()}(Ho),Yo=45,Xo=95;function Zo(e){return Ye(e)}function $o(e){return e.filter((e=>65039!=e))}function ea(e){for(let t of e.split(".")){let e=Zo(t);try{for(let t=e.lastIndexOf(Xo)-1;t>=0;t--)if(e[t]!==Xo)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===Yo&&e[3]===Yo)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function ta(e,t){var r;let n,i,o=Qo,a=[],s=e.length;for(t&&(t.length=0);s;){let c=e[--s];if(o=null===(r=o.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!o)break;if(o.save)i=c;else if(o.check&&c===i)break;a.push(c),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return n}const ra=new g(Xn),na=new Uint8Array(32);function ia(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function oa(e){const t=He(function(e){return ea(function(e,t){let r=Zo(e).reverse(),n=[];for(;r.length;){let e=ta(r);if(e){n.push(...t(e));continue}let i=r.pop();if(Jo.has(i)){n.push(i);continue}if(Wo.has(i))continue;let o=Vo[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return ea(String.fromCodePoint(...n).normalize("NFC"))}(e,$o))}(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++)46===t[e]&&(r.push(ia(t.slice(n,e))),n=e+1);if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(ia(t.slice(n))),r}function aa(e){try{return 0!==oa(e).length}catch(e){}return!1}function sa(e){"string"!=typeof e&&ra.throwArgumentError("invalid ENS name; not a string","name",e);let t=na;const r=oa(e);for(;r.length;)t=ve(S([t,ve(r.pop())]));return C(t)}function ca(e){return C(S(oa(e).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"}na.fill(0);var fa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};function ua(e,t){return fa(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(),o={};return n.headers.forEach?n.headers.forEach(((e,t)=>{o[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{o[e.toLowerCase()]=n.headers.get(e)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:k(new Uint8Array(i))}}))}var la=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const da=new g("web/5.7.1");function ha(e){return new Promise((t=>{setTimeout(t,e)}))}function ba(e,t){if(null==e)return null;if("string"==typeof e)return e;if(E(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Qe(e)}catch(e){}return C(e)}return e}function pa(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;da.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;da.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof e&&!!e.errorPassThrough,s={};let c=null;const f={method:"GET"};let u=!1,l=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||da.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(l=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(u=!0);if(f.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&da.throwError("basic authentication requires a secure https url",g.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+Fo(He(t))}}null!=e.skipFetchSetup&&(f.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(f.fetchOptions=oe(e.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(d):null;if(h)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?Bo(h[3]):(b=h[3],He(b.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){da.throwError("processing response error",g.errors.SERVER_ERROR,{body:ba(h[1],h[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var b;t&&(f.method="POST",f.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const p={};Object.keys(s).forEach((e=>{const t=s[e];p[t.key]=t.value})),f.headers=p;const m=function(){let e=null;return{promise:new Promise((function(t,r){l&&(e=setTimeout((()=>{null!=e&&(e=null,r(da.makeError("timeout",g.errors.TIMEOUT,{requestBody:ba(f.body,p["content-type"]),requestMethod:f.method,timeout:l,url:c})))}),l))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return la(this,void 0,void 0,(function*(){for(let e=0;e<n;e++){let t=null;try{if(t=yield ua(c,f),e<n)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===f.method&&e.match(/^https:/)){c=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(i&&(r=yield i(e,c)),r){let r=0;const n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):o*parseInt(String(Math.random()*Math.pow(2,e))),yield ha(r);continue}}}catch(e){t=e.response,null==t&&(m.cancel(),da.throwError("missing response",g.errors.SERVER_ERROR,{requestBody:ba(f.body,p["content-type"]),requestMethod:f.method,serverError:e,url:c}))}let s=t.body;if(u&&304===t.statusCode?s=null:!a&&(t.statusCode<200||t.statusCode>=300)&&(m.cancel(),da.throwError("bad response",g.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:ba(s,t.headers?t.headers["content-type"]:null),requestBody:ba(f.body,p["content-type"]),requestMethod:f.method,url:c})),r)try{const e=yield r(s,t);return m.cancel(),e}catch(r){if(r.throttleRetry&&e<n){let t=!0;if(i&&(t=yield i(e,c)),t){const t=o*parseInt(String(Math.random()*Math.pow(2,e)));yield ha(t);continue}}m.cancel(),da.throwError("processing response error",g.errors.SERVER_ERROR,{body:ba(s,t.headers?t.headers["content-type"]:null),error:r,requestBody:ba(f.body,p["content-type"]),requestMethod:f.method,url:c})}return m.cancel(),s}return da.throwError("failed response",g.errors.SERVER_ERROR,{requestBody:ba(f.body,p["content-type"]),requestMethod:f.method,url:c})}))}();return Promise.race([m.promise,y])}function ma(e,t,r){let n=null;if(null!=t){n=He(t);const r="string"==typeof e?{url:e}:oe(e);r.headers?0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length||(r.headers=oe(r.headers),r.headers["content-type"]="application/json"):r.headers={"content-type":"application/json"},e=r}return pa(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Qe(e))}catch(t){da.throwError("invalid JSON",g.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function ya(e,t){return t||(t={}),null==(t=oe(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,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{a()&&n(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let c=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(c++,c>s)return void(a()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){a()&&n(e)}))}()}))}var ga=r(273),va=r.n(ga);const wa="providers/5.7.2",Aa=new g(wa);class Ea{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),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:o,type:c,accessList:Ea.allowNull(this.accessList.bind(this),null),blockHash:Ea.allowNull(o,null),blockNumber:Ea.allowNull(s,null),transactionIndex:Ea.allowNull(s,null),confirmations:Ea.allowNull(s,null),from:t,gasPrice:Ea.allowNull(r),maxPriorityFeePerGas:Ea.allowNull(r),maxFeePerGas:Ea.allowNull(r),gasLimit:r,to:Ea.allowNull(t,null),value:r,nonce:s,data:i,r:Ea.allowNull(this.uint256),s:Ea.allowNull(this.uint256),v:Ea.allowNull(s),creates:Ea.allowNull(t,null),raw:Ea.allowNull(i)},e.transactionRequest={from:Ea.allowNull(t),nonce:Ea.allowNull(s),gasLimit:Ea.allowNull(r),gasPrice:Ea.allowNull(r),maxPriorityFeePerGas:Ea.allowNull(r),maxFeePerGas:Ea.allowNull(r),to:Ea.allowNull(t),value:Ea.allowNull(r),data:Ea.allowNull((e=>this.data(e,!0))),type:Ea.allowNull(s),accessList:Ea.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:Ea.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:Ea.allowNull(this.address,null),from:Ea.allowNull(this.address,null),contractAddress:Ea.allowNull(t,null),transactionIndex:s,root:Ea.allowNull(a),gasUsed:r,logsBloom:Ea.allowNull(i),blockHash:o,transactionHash:o,logs:Ea.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:Ea.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:Ea.allowNull(r),status:Ea.allowNull(s),type:c},e.block={hash:Ea.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:Ea.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Ea.allowNull(t),extraData:i,transactions:Ea.allowNull(Ea.arrayOf(o)),baseFeePerGas:Ea.allowNull(r)},e.blockWithTransactions=oe(e.block),e.blockWithTransactions.transactions=Ea.allowNull(Ea.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Ea.allowNull(n,void 0),toBlock:Ea.allowNull(n,void 0),blockHash:Ea.allowNull(o,void 0),address:Ea.allowNull(t,void 0),topics:Ea.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Ea.allowNull(s),blockHash:Ea.allowNull(o),transactionIndex:s,removed:Ea.allowNull(this.boolean.bind(this)),address:t,data:Ea.allowFalsish(i,"0x"),topics:Ea.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return dn(e||[])}number(e){return"0x"===e?0:V.from(e).toNumber()}type(e){return"0x"===e||null==e?0:V.from(e).toNumber()}bigNumber(e){return V.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),N(e))?e.toLowerCase():Aa.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 Oe(e)}callAddress(e){if(!N(e,32))return null;const t=Oe(I(e,12));return t===To?null:t}contractAddress(e){return De(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||N(e))return B(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==R(r)?Aa.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=V.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!N(e))throw new Error("invalid uint256");return D(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=Ea.check(t,e);return n._difficulty=null==r?null:V.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Ea.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&V.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=Ea.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;N(r)&&(r=V.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),N(r)&&(r=V.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 gn(e)}receiptLog(e){return Ea.check(this.formats.receiptLog,e)}receipt(e){const t=Ea.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=V.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Aa.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Aa.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Aa.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 Ea.check(this.formats.filter,e)}filterLog(e){return Ea.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 _a(e){return e&&"function"==typeof e.isCommunityResource}function Ta(e){return _a(e)&&e.isCommunityResource()}let ka=!1;function Sa(){ka||(ka=!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 Pa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const xa=new g(wa);function Na(e){return null==e?"null":(32!==R(e)&&xa.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Ma(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[Na(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return Na(e)})).join("&")}function Ca(e){if("string"==typeof e){if(32===R(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Ma(e);if(nr.isForkEvent(e))throw xa.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Ma(e.topics||[])}throw new Error("invalid event - "+e)}function Ra(){return(new Date).getTime()}function Ia(e){return new Promise((t=>{setTimeout(t,e)}))}const Oa=["block","network","pending","poll"];class Ba{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||Oa.indexOf(this.tag)>=0}}const Fa={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 Da(e){return D(V.from(e).toHexString(),32)}function Ua(e){return bi.encode(S([e,I(gi(gi(e)),0,4)]))}const La=new RegExp("^(ipfs)://(.*)$","i"),ja=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),La,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function za(e,t){try{return Qe(Ga(e,t))}catch(e){}return null}function Ga(e,t){if("0x"===e)return null;const r=V.from(I(e,t,t+32)).toNumber(),n=V.from(I(e,r,r+32)).toNumber();return I(e,r+32,r+32+n)}function qa(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):xa.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function Ka(e){const t=k(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 Ha(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Ja(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=k(e[n]);t[n]=Ka(r),t.push(Ka(i.length)),t.push(Ha(i)),r+=32+32*Math.ceil(i.length/32)}return O(t)}class Wa{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=>V.from(e).eq(1))).catch((e=>{if(e.code===g.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Pa(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:O([e,sa(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=O(["0x9061b923",Ja([ca(this.name),r.data])]));try{let e=yield this.provider.call(r);return k(e).length%32==4&&xa.throwError("resolver threw error",g.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=Ga(e,0)),e}catch(e){if(e.code===g.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Pa(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?Ga(r,0):null}))}_getAddress(e,t){const r=Fa[String(e)];if(null==r&&xa.throwError(`unsupported coin type: ${e}`,g.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=k(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 Ua(S([[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 Ua(S([[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=va().toWords(n.slice(2));return e.unshift(t),va().encode(r.prefix,e)}}return null}getAddress(e){return Pa(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===ko?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===g.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",Da(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&xa.throwError("invalid or unsupported coin data",g.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return Pa(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<ja.length;r++){const n=t.match(ja[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:qa(t)};case"erc721":case"erc1155":{const r="erc721"===i?"0xc87b56dd":"0x0e89341c";e.push({type:i,content:t});const o=this._resolvedAddress||(yield this.getAddress()),a=(n[2]||"").split("/");if(2!==a.length)return null;const s=yield this.provider.formatter.address(a[0]),c=D(V.from(a[1]).toHexString(),32);if("erc721"===i){const t=this.provider.formatter.callAddress(yield this.provider.call({to:s,data:O(["0x6352211e",c])}));if(o!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===i){const t=V.from(yield this.provider.call({to:s,data:O(["0x00fdd58e",D(o,32),c])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const f={to:this.provider.formatter.address(a[0]),data:O([r,c])};let u=za(yield this.provider.call(f),0);if(null==u)return null;e.push({type:"metadata-url-base",content:u}),"erc1155"===i&&(u=u.replace("{id}",c.substring(2)),e.push({type:"metadata-url-expanded",content:u})),u.match(/^ipfs:/i)&&(u=qa(u)),e.push({type:"metadata-url",content:u});const l=yield ma(u);if(!l)return null;e.push({type:"metadata",content:JSON.stringify(l)});let d=l.image;if("string"!=typeof d)return null;if(d.match(/^(https:\/\/|data:)/i));else{if(null==d.match(La))return null;e.push({type:"url-ipfs",content:d}),d=qa(d)}return e.push({type:"url",content:d}),{linkage:e,url:d}}}}}catch(e){}return null}))}getContentHash(){return Pa(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://"+bi.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://"+bi.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://"+Fo("0x"+i[1]).replace(/[=+\/]/g,(t=>e[t]))}return xa.throwError("invalid or unsupported content hash data",g.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Pa(this,void 0,void 0,(function*(){let t=He(e);t=S([Da(64),Da(t.length),t]),t.length%32!=0&&(t=S([t,D("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",C(t));return null==r||"0x"===r?null:Qe(r)}))}}let Va=null,Qa=1;class Ya extends ir{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)):xa.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Pa(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||xa.throwError("no network detected",g.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 ya((()=>this._ready().then((e=>e),(e=>{if(e.code!==g.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==Va&&(Va=new Ea),Va}static getNetwork(e){return Oo(null==e?"homestead":e)}ccipReadFetch(e,t,r){return Pa(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e<r.length;e++){const t=r[e],a=t.replace("{sender}",n).replace("{data}",i),s=t.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),c=yield ma({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const f=c.message||"unknown error";if(c.status>=400&&c.status<500)return xa.throwError(`response not found during CCIP fetch: ${f}`,g.errors.SERVER_ERROR,{url:t,errorMessage:f});o.push(f)}return xa.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,g.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return Pa(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(Ra()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Ra(),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=Ra();return(e=V.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 Pa(this,void 0,void 0,(function*(){const e=Qa++,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)xa.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",xa.makeError("network block skew detected",g.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 o=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(o)}}})),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 Pa(this,void 0,void 0,(function*(){return xa.throwError("provider does not support network detection",g.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Pa(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 Ia(0),this._network;const r=xa.makeError("underlying network changed",g.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=Ra();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=Ra(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return Pa(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return Pa(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const a=[];let s=!1;const c=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},f=e=>{e.confirmations<t||c()||i(e)};if(this.on(e,f),a.push((()=>{this.removeListener(e,f)})),n){let r=n.startBlock,i=null;const f=a=>Pa(this,void 0,void 0,(function*(){s||(yield Ia(1e3),this.getTransactionCount(n.from).then((u=>Pa(this,void 0,void 0,(function*(){if(!s){if(u<=n.nonce)r=a;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<=a;){if(s)return;const r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){const a=r.transactions[i];if(a.hash===e)return;if(a.from===n.from&&a.nonce===n.nonce){if(s)return;const r=yield this.waitForTransaction(a.hash,t);if(c())return;let i="replaced";return a.data===n.data&&a.to===n.to&&a.value.eq(n.value)?i="repriced":"0x"===a.data&&a.from===a.to&&a.value.isZero()&&(i="cancelled"),void o(xa.makeError("transaction was replaced",g.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(a),hash:e,receipt:r}))}}i++}}s||this.once("block",f)}}))),(e=>{s||this.once("block",f)})))}));if(s)return;this.once("block",f),a.push((()=>{this.removeListener("block",f)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||o(xa.makeError("timeout exceeded",g.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Pa(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Pa(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return V.from(e)}catch(t){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Pa(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 V.from(n)}catch(e){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return Pa(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 V.from(n).toNumber()}catch(e){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return Pa(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 C(n)}catch(e){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return Pa(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=>B(e)))}),i=yield this.perform("getStorageAt",n);try{return C(i)}catch(e){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==R(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&xa.throwError("Transaction hash mismatch from Provider.sendTransaction.",g.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>Pa(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 o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&xa.throwError("transaction failed",g.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return Pa(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>C(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 Pa(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?V.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?C(e):null)))})),this.formatter.transactionRequest(yield ne(r))}))}_getFilter(e){return Pa(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 Pa(this,void 0,void 0,(function*(){r>=10&&xa.throwError("CCIP read exceeded maximum redirections",g.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)&&R(i)%32==4)try{const o=I(i,4),a=I(o,0,32);V.from(a).eq(n)||xa.throwError("CCIP Read sender did not match",g.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],c=V.from(I(o,32,64)).toNumber(),f=V.from(I(o,c,c+32)).toNumber(),u=I(o,c+32);for(let t=0;t<f;t++){const r=za(u,32*t);null==r&&xa.throwError("CCIP Read contained corrupt URL string",g.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),s.push(r)}const l=Ga(o,64);V.from(I(o,100,128)).isZero()||xa.throwError("CCIP Read callback selector included junk",g.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const d=I(o,96,100),h=Ga(o,128),b=yield this.ccipReadFetch(e,l,s);null==b&&xa.throwError("CCIP Read disabled or provided no URLs",g.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const p={to:n,data:O([d,Ja([b,h])])};return this._call(p,t,r+1)}catch(e){if(e.code===g.errors.SERVER_ERROR)throw e}try{return C(i)}catch(r){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:i,error:r})}}))}call(e,t){return Pa(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 Pa(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 V.from(r)}catch(e){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}}))}_getAddress(e){return Pa(this,void 0,void 0,(function*(){"string"!=typeof(e=yield e)&&xa.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&xa.throwError("ENS name not configured",g.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return Pa(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if(N(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),N(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(t){xa.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return ya((()=>Pa(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 Pa(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return ya((()=>Pa(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 Pa(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return ya((()=>Pa(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 Pa(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)})),Ea.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return Pa(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Pa(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&xa.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 Pa(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 Wa(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Pa(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||xa.throwError("network does not support ENS",g.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+sa(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return Pa(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(N(e))throw t}"string"!=typeof e&&xa.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Pa(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=za(yield this.call({to:r,data:"0x691f3431"+sa(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return Pa(this,void 0,void 0,(function*(){let t=null;if(N(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new Wa(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==g.errors.CALL_EXCEPTION)throw e}try{const e=za(yield this.call({to:n,data:"0x691f3431"+sa(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==g.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 xa.throwError(e+" not implemented",g.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 Ba(Ca(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=Ca(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=Ca(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Ca(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=Ca(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=Ca(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var Xa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Za=new g(wa),$a=["call","estimateGas"];function es(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=N(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=es(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return es(JSON.parse(e),t)}catch(e){}return null}function ts(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=es(t,!0);if(e)return e.data;Za.throwError("missing revert data in call exception; Transaction reverted without a reason string",g.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=es(t.body,!1);null==r&&(r=es(t,!1)),r&&Za.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",g.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===g.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)&&Za.throwError("insufficient funds for intrinsic transaction cost",g.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&Za.throwError("nonce has already been used",g.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Za.throwError("replacement fee too low",g.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&Za.throwError("legacy pre-eip-155 transactions not supported",g.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),$a.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Za.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",g.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function rs(e){return new Promise((function(t){setTimeout(t,e)}))}function ns(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 is(e){return e?e.toLowerCase():e}const os={};class as extends fr{constructor(e,t,r){if(super(),e!==os)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)):Za.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return Za.throwError("cannot alter JSON-RPC Signer connection",g.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new ss(os,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&&Za.throwError("unknown account #"+this._index,g.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=oe(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=oe(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>Xa(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&Za.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&&Za.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)&&Za.throwError("user rejected transaction",g.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),ts("sendTransaction",e,n))))}))}signTransaction(e){return Za.throwError("signing transactions is unsupported",g.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Xa(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 ya((()=>Xa(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 Xa(this,void 0,void 0,(function*(){const t="string"==typeof e?He(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[C(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&Za.throwError("user rejected signing",g.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return Xa(this,void 0,void 0,(function*(){const t="string"==typeof e?He(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),C(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&Za.throwError("user rejected signing",g.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return Xa(this,void 0,void 0,(function*(){const n=yield di.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(di.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&Za.throwError("user rejected signing",g.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return Xa(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class ss extends as{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 cs={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class fs extends Ya{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(oe(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 Xa(this,void 0,void 0,(function*(){yield rs(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(V.from(e).toNumber())}catch(t){return Za.throwError("could not detect network",g.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return Za.throwError("could not detect network",g.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new as(os,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:fe(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=ma(this.connection,JSON.stringify(r),ns).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",[is(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[is(t.address),t.blockTag]];case"getCode":return["eth_getCode",[is(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[is(t.address),D(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=is(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return Xa(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&V.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=oe(t)).transaction=oe(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&Za.throwError(e+" not implemented",g.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return ts(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 rs(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=oe(cs);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=B(V.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=C(e[t]))})),e.accessList&&(n.accessList=dn(e.accessList)),n}}let us=null;try{if(us=WebSocket,null==us)throw new Error("inject please")}catch(e){const t=new g(wa);us=function(){t.throwError("WebSockets not supported in this environment",g.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var ls=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ds=new g(wa);let hs=1;class bs extends fs{constructor(e,t){"any"===t&&ds.throwError("WebSocketProvider does not support 'any' network yet",g.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 us(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){ds.throwError("cannot reset events block on WebSocketProvider",g.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){ds.throwError("cannot set polling interval on WebSocketProvider",g.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return ls(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&ds.throwError("cannot set polling on WebSocketProvider",g.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const r=hs++;return new Promise(((n,i)=>{const o=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?i(e):n(t)},payload:o},this._wsReady&&this.websocket.send(o)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return ls(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=V.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 ls(this,void 0,void 0,(function*(){this.websocket.readyState===us.CONNECTING&&(yield new Promise((e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}}))),this.websocket.close(1e3)}))}}const ps=new g(wa);class ms extends fs{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||ps.throwError("no network detected",g.errors.UNKNOWN_ERROR,{}),null==this._network&&(te(this,"_network",t),this.emit("network",t,null))),t},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}c((i=i.apply(t,r||[])).next())}));var t,r,n,i}}class ys extends ms{constructor(e,t){ps.checkAbstract(new.target,ys),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(){ps.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return ps.throwError("API provider does not support signing",g.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return ps.throwError("not implemented; sub-classes must override getUrl",g.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const gs=new g(wa),vs="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class ws extends bs{constructor(e,t){const r=new As(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===vs}}class As extends ys{static getWebSocketProvider(e,t){return new ws(e,t)}static getApiKey(e){return null==e?vs:(e&&"string"!=typeof e&&gs.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:gs.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===vs&&Sa(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===vs}}const Es=new g(wa),_s="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Ts(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 Es.throwArgumentError("unsupported network","name",e)}class ks extends ys{isCommunityResource(){return this.apiKey===_s}static getApiKey(e){return null==e?_s:e}static getUrl(e,t){null==t&&(t=_s);const r={allowGzip:!0,url:"https://"+Ts(e.name)+t,throttleCallback:(e,r)=>(t.apiKey===_s&&Sa(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}const Ss=new g(wa);class Ps extends ys{static getApiKey(e){return null!=e&&Ss.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/":Ss.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,a=function*(){return"getBlockNumber"===e?(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number:r.perform.call(this,e,t)},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{c(a.next(e))}catch(e){t(e)}}function s(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}c((a=a.apply(n,i||[])).next())}));var n,i,o,a}}var xs=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Ns=new g(wa);function Ms(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]?B(C(n)):"accessList"===r?"["+dn(n).map((e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`)).join(",")+"]":C(n),t[r]=n)}return t}function Cs(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 Rs(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 Is(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function Os(e,t,r){if("call"===e&&t.code===g.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,"")),N(r))return r;Ns.throwError("missing revert data in call exception",g.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===g.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/)&&Ns.throwError("insufficient funds for intrinsic transaction cost",g.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Ns.throwError("nonce has already been used",g.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&Ns.throwError("replacement fee too low",g.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&Ns.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",g.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class Bs extends Ya{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 Ns.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 xs(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null,o="proxy"===e?Rs:Cs;this.emit("debug",{action:"request",request:n,provider:this});const a={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&Sa(),Promise.resolve(!0))};let s=null;i&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(i).map((e=>`${e}=${i[e]}`)).join("&"));const c=yield ma(a,s,o||Rs);return this.emit("debug",{action:"response",request:n,response:fe(c),provider:this}),c}))}detectNetwork(){return xs(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return xs(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=>Os("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=Ms(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(e){return Os("call",e,t.transaction)}}case"estimateGas":{const e=Ms(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(e){return Os("estimateGas",e,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=Is(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=Is(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Ns.throwError("unsupported topic count",g.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const r=t.filter.topics[0];"string"==typeof r&&66===r.length||Ns.throwError("unsupported topic format",g.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 xs(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}}function Fs(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}var Ds=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Us=new g(wa);function Ls(){return(new Date).getTime()}function js(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)||Us.throwArgumentError("provider mismatch","networks",e):t=n}return t}function zs(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 Gs(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(V.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>Gs(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]":Gs(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let qs=1;function Ks(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 Hs=[g.errors.CALL_EXCEPTION,g.errors.INSUFFICIENT_FUNDS,g.errors.NONCE_EXPIRED,g.errors.REPLACEMENT_UNDERPRICED,g.errors.UNPREDICTABLE_GAS_LIMIT],Js=["address","args","errorArgs","errorSignature","method","transaction"];function Ws(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 Vs(e,t){return Ds(this,void 0,void 0,(function*(){const r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:ya((()=>new Promise(((n,i)=>{setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function Qs(e,t,r,n){return Ds(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&&N(n.blockTag)&&(i=yield Vs(e,t)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&N(n.blockTag)&&(i=yield Vs(e,t)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&N(n.blockTag)&&(i=yield Vs(e,t)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&N(n.blockTag)&&(i=yield Vs(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&&N(r.fromBlock)||r.toBlock&&N(r.toBlock))&&(i=yield Vs(e,t)),i.getLogs(r)}}return Us.throwError("unknown method error",g.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class Ys extends Ya{constructor(e,t){0===e.length&&Us.throwArgumentError("missing providers","providers",e);const r=e.map(((e,t)=>{if(ir.isProvider(e)){const t=Ta(e)?2e3:750,r=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:r})}const r=oe(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=Ta(e)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&Us.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&&Us.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let i=js(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 Ds(this,void 0,void 0,(function*(){return js(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}))}perform(e,t){return Ds(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=Gs;switch(t){case"getBlockNumber":return function(t){const r=t.map((e=>e.result));let n=zs(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 zs(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=oe(e)).confirmations=-1,Gs(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=oe(e)).transactions=e.transactions.map((e=>((e=oe(e)).confirmations=-1,e))),Gs(e))}:function(e){return null==e?null:Gs(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=Fs(this.providerConfigs.map(oe));n.sort(((e,t)=>e.priority-t.priority));const i=this._highestBlockNumber;let o=0,a=!0;for(;;){const s=Ls();let c=n.filter((e=>e.runner&&s-e.start<e.stallTimeout)).reduce(((e,t)=>e+t.weight),0);for(;c<this.quorum&&o<n.length;){const r=n[o++],a=qs++;r.start=Ls(),r.staller=Ks(r.stallTimeout),r.staller.wait((()=>{r.staller=null})),r.runner=Qs(r,i,e,t).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Ws(r,Ls()),request:{method:e,params:fe(t)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Ws(r,Ls()),request:{method:e,params:fe(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Ws(r,null),request:{method:e,params:fe(t)},provider:this}),c+=r.weight}const f=[];n.forEach((e=>{!e.done&&e.runner&&(f.push(e.runner),e.staller&&f.push(e.staller.getPromise()))})),f.length&&(yield Promise.race(f));const u=n.filter((e=>e.done&&null==e.error));if(u.length>=this.quorum){const e=r(u);if(void 0!==e)return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;a||(yield Ks(100).getPromise()),a=!1}const l=n.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const r=t.error.code;return Hs.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{});if(Object.keys(l).forEach((e=>{const t=l[e];if(t.weight<this.quorum)return;n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}));const r=t.error,i={};Js.forEach((e=>{null!=r[e]&&(i[e]=r[e])})),Us.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})),Us.throwError("failed to meet quorum",g.errors.SERVER_ERROR,{method:e,params:t,results:n.map((e=>Ws(e))),provider:this})}))}}const Xs=null,Zs=new g(wa),$s="84842078b09946638c03157f83405213";class ec extends bs{constructor(e,t){const r=new tc(e,t),n=r.connection;n.password&&Zs.throwError("INFURA WebSocket project secrets unsupported",g.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===$s}}class tc extends ys{static getWebSocketProvider(e,t){return new ec(e,t)}static getApiKey(e){const t={apiKey:$s,projectId:$s,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(Zs.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),Zs.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:Zs.throwError("unsupported network",g.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===$s&&Sa(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===$s}}class rc extends fs{send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},i=new Promise(((e,t)=>{n.resolve=e,n.reject=t}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const t=e.map((e=>e.request));return this.emit("debug",{action:"requestBatch",request:fe(t),provider:this}),ma(this.connection,JSON.stringify(t)).then((r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach(((e,t)=>{const n=r[t];if(n.error){const t=new Error(n.error.message);t.code=n.error.code,t.data=n.error.data,e.reject(t)}else e.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach((e=>{e.reject(r)}))}))}),10)),i}}const nc=new g(wa);class ic extends ys{static getApiKey(e){return e&&"string"!=typeof e&&nc.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){nc.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:nc.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}const oc=new g(wa),ac="62e1ad51b37b8e00394bda3b";class sc extends ys{static getApiKey(e){const t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=ac:"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:oc.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:oc.throwError("unsupported network",g.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===ac}}const cc=new g(wa);let fc=1;function uc(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:fe(i),provider:this}),t(i,((t,o)=>{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:o,provider:this}),o.error){const e=new Error(o.error.message);return e.code=o.error.code,e.data=o.error.data,n(e)}e(o.result)}))}))}}class lc extends fs{constructor(e,t){null==e&&cc.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:fe(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=uc(0,e.sendAsync.bind(e)):e.send?n=uc(0,e.send.bind(e)):cc.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 dc=new g(wa);function hc(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 fs(e);case"ws":case"wss":return new bs(e);default:dc.throwArgumentError("unsupported URL scheme","network",e)}}const r=Oo(e);return r&&r._defaultProvider||dc.throwError("unsupported getDefaultProvider network",g.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:Ys,AlchemyProvider:As,AnkrProvider:ks,CloudflareProvider:Ps,EtherscanProvider:Bs,InfuraProvider:tc,JsonRpcProvider:fs,NodesmithProvider:ic,PocketProvider:sc,Web3Provider:lc,IpcProvider:Xs},t)}const bc=new RegExp("^bytes([0-9]+)$"),pc=new RegExp("^(u?int)([0-9]*)$"),mc=new RegExp("^(.*)\\[([0-9]*)\\]$"),yc="0000000000000000000000000000000000000000000000000000000000000000",gc=new g("solidity/5.7.0");function vc(e,t,r){switch(e){case"address":return r?x(t,32):k(t);case"string":return He(t);case"bytes":return k(t);case"bool":return t=t?"0x01":"0x00",r?x(t,32):k(t)}let n=e.match(pc);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&gc.throwArgumentError("invalid number type","type",e),r&&(i=256),x(t=V.from(t).toTwos(i),i/8)}if(n=e.match(bc),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&gc.throwArgumentError("invalid bytes type","type",e),k(t).byteLength!==i&&gc.throwArgumentError(`invalid value for ${e}`,"value",t),r?k((t+yc).substring(0,66)):t}if(n=e.match(mc),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&gc.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(vc(r,e,!0))})),S(i)}return gc.throwArgumentError("invalid type","type",e)}function wc(e,t){e.length!=t.length&&gc.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(vc(e,t[n]))})),C(S(r))}function Ac(e,t){return ve(wc(e,t))}function Ec(e,t){return gi(wc(e,t))}function _c(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function Tc(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function kc(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n];if(r+=i.l,e>=r&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}const Sc=Tc("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Pc="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),xc=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Nc=_c("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Mc=_c("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Cc=_c("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),Rc=Tc("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function Ic(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=Ye(e);var r;r=t.map((e=>{if(Pc.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=kc(e,xc);if(t)return[e+t.s];let r=Nc[e];if(r)return r;let n=Mc[e];return n?[e+n[0]]:Cc[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=Ye(Ve(t),je.NFKC),t.forEach((e=>{if(kc(e,Rc))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(kc(e,Sc))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=Ve(t);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}function Oc(e){const t=He(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return C(S([t,ko]).slice(0,32))}function Bc(e){const t=k(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return Qe(t.slice(0,r))}const Fc=new g("units/5.7.0"),Dc=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Uc(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Fc.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return n+o.join(",")+i}function Lc(e,t){if("string"==typeof t){const e=Dc.indexOf(t);-1!==e&&(t=3*e)}return qn(e,null!=t?t:18)}function jc(e,t){if("string"!=typeof e&&Fc.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=Dc.indexOf(t);-1!==e&&(t=3*e)}return Kn(e,null!=t?t:18)}function zc(e){return Lc(e,18)}function Gc(e){return jc(e,18)}const qc="ethers/5.7.2",Kc=new g(qc);try{const e=window;null==e._ethers&&(e._ethers=c)}catch(e){}},485:(e,t,r)=>{var n=t;n.utils=r(212),n.common=r(495),n.sha=r(530),n.ripemd=r(396),n.hmac=r(47),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},495:(e,t,r)=>{"use strict";var n=r(212),i=r(561);function o(){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=o,o.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},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.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 o=8;o<this.padLength;o++)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,o=8;o<this.padLength;o++)n[i++]=0;return n}},47:(e,t,r)=>{"use strict";var n=r(212),i=r(561);function o(e,t,r){if(!(this instanceof o))return new o(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=o,o.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)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},396:(e,t,r)=>{"use strict";var n=r(212),i=r(495),o=n.rotl32,a=n.sum32,s=n.sum32_3,c=n.sum32_4,f=i.BlockHash;function u(){if(!(this instanceof u))return new u;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(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 h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(u,f),t.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],f=this.h[3],u=this.h[4],g=r,v=n,w=i,A=f,E=u,_=0;_<80;_++){var T=a(o(c(r,l(_,n,i,f),e[b[_]+t],d(_)),m[_]),u);r=u,u=f,f=o(i,10),i=n,n=T,T=a(o(c(g,l(79-_,v,w,A),e[p[_]+t],h(_)),y[_]),E),g=E,E=A,A=o(w,10),w=v,v=T}T=s(this.h[1],i,A),this.h[1]=s(this.h[2],f,E),this.h[2]=s(this.h[3],u,g),this.h[3]=s(this.h[4],r,v),this.h[4]=s(this.h[0],n,w),this.h[0]=T},u.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var b=[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],p=[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],y=[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]},530:(e,t,r)=>{"use strict";t.sha1=r(79),t.sha224=r(823),t.sha256=r(32),t.sha384=r(328),t.sha512=r(168)},79:(e,t,r)=>{"use strict";var n=r(212),i=r(495),o=r(713),a=n.rotl32,s=n.sum32,c=n.sum32_5,f=o.ft_1,u=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,u),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]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],u=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var b=~~(n/20),p=c(a(i,5),f(b,o,u,d),h,r[n],l[b]);h=d,d=u,u=a(o,30),o=i,i=p}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],u),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},823:(e,t,r)=>{"use strict";var n=r(212),i=r(32);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},32:(e,t,r)=>{"use strict";var n=r(212),i=r(495),o=r(713),a=r(561),s=n.sum32,c=n.sum32_4,f=n.sum32_5,u=o.ch32,l=o.maj32,d=o.s0_256,h=o.s1_256,b=o.g0_256,p=o.g1_256,m=i.BlockHash,y=[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=y,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]=c(p(r[n-2]),r[n-7],b(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],m=this.h[2],y=this.h[3],g=this.h[4],v=this.h[5],w=this.h[6],A=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var E=f(A,h(g),u(g,v,w),this.k[n],r[n]),_=s(d(i),l(i,o,m));A=w,w=v,v=g,g=s(y,E),y=m,m=o,o=i,i=s(E,_)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],m),this.h[3]=s(this.h[3],y),this.h[4]=s(this.h[4],g),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],A)},g.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},328:(e,t,r)=>{"use strict";var n=r(212),i=r(168);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},168:(e,t,r)=>{"use strict";var n=r(212),i=r(495),o=r(561),a=n.rotr64_hi,s=n.rotr64_lo,c=n.shr64_hi,f=n.shr64_lo,u=n.sum64,l=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,b=n.sum64_4_lo,p=n.sum64_5_hi,m=n.sum64_5_lo,y=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;y.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 o=e&r^~e&i;return o<0&&(o+=4294967296),o}function A(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function _(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function T(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function k(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function P(e,t){var r=a(e,t,1)^a(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,1)^s(e,t,8)^f(e,t,7);return r<0&&(r+=4294967296),r}function N(e,t){var r=s(e,t,19)^s(t,e,29)^f(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,y),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],y=r[n-3],g=void 0,(g=a(m,y,19)^a(y,m,29)^c(m,y,6))<0&&(g+=4294967296),g),o=N(r[n-4],r[n-3]),s=r[n-14],f=r[n-13],u=P(r[n-30],r[n-29]),l=x(r[n-30],r[n-29]),d=r[n-32],p=r[n-31];r[n]=h(i,o,s,f,u,l,d,p),r[n+1]=b(i,o,s,f,u,l,d,p)}var m,y,g},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r,n,i,s=this.W,c=this.h[0],f=this.h[1],h=this.h[2],b=this.h[3],y=this.h[4],g=this.h[5],v=this.h[6],P=this.h[7],x=this.h[8],N=this.h[9],M=this.h[10],C=this.h[11],R=this.h[12],I=this.h[13],O=this.h[14],B=this.h[15];o(this.k.length===s.length);for(var F=0;F<s.length;F+=2){var D=O,U=B,L=(i=void 0,(i=a(r=x,n=N,14)^a(r,n,18)^a(n,r,9))<0&&(i+=4294967296),i),j=S(x,N),z=w(x,0,M,0,R),G=A(0,N,0,C,0,I),q=this.k[F],K=this.k[F+1],H=s[F],J=s[F+1],W=p(D,U,L,j,z,G,q,K,H,J),V=m(D,U,L,j,z,G,q,K,H,J);D=T(c,f),U=k(c,f),L=E(c,0,h,0,y),j=_(0,f,0,b,0,g);var Q=l(D,U,L,j),Y=d(D,U,L,j);O=R,B=I,R=M,I=C,M=x,C=N,x=l(v,P,W,V),N=d(P,P,W,V),v=y,P=g,y=h,g=b,h=c,b=f,c=l(W,V,Q,Y),f=d(W,V,Q,Y)}u(this.h,0,c,f),u(this.h,2,h,b),u(this.h,4,y,g),u(this.h,6,v,P),u(this.h,8,x,N),u(this.h,10,M,C),u(this.h,12,R,I),u(this.h,14,O,B)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},713:(e,t,r)=>{"use strict";var n=r(212).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(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?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,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}},212:(e,t,r)=>{"use strict";var n=r(561),i=r(285);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function c(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 a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|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+=s(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=a(i)),r+=c(i.toString(16))}return r},t.zero2=s,t.zero8=c,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var a=new Array(o/4),s=0,c=t;s<a.length;s++,c+=4){var f;f="big"===i?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],a[s]=f>>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}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],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},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,o,a,s){var c=0,f=t;return c+=(f=f+n>>>0)<t?1:0,c+=(f=f+o>>>0)<o?1:0,e+r+i+a+(c+=(f=f+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,c,f){var u=0,l=t;return u+=(l=l+n>>>0)<t?1:0,u+=(l=l+o>>>0)<o?1:0,u+=(l=l+s>>>0)<s?1:0,e+r+i+a+c+(u+=(l=l+f>>>0)<f?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,c,f){return t+n+o+s+f>>>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}},285: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}}},669:(e,t,r)=>{var n;!function(){"use strict";var i="input is invalid type",o="object"==typeof window,a=o?window:{};a.JS_SHA3_NO_WINDOW&&(o=!1);var s=!o&&"object"==typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?a=r.g:s&&(a=self);var c=!a.JS_SHA3_NO_COMMON_JS&&e.exports,f=r.amdO,u=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),d=[4,1024,262144,67108864],h=[0,8,16,24],b=[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],p=[224,256,384,512],m=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],g={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!u||!a.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 v=function(e,t,r){return function(n){return new O(e,t,e).update(n)[r]()}},w=function(e,t,r){return function(n,i){return new O(e,t,i).update(n)[r]()}},A=function(e,t,r){return function(t,n,i,o){return S["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return S["kmac"+e].update(t,n,i,o)[r]()}},_=function(e,t,r,n){for(var i=0;i<y.length;++i){var o=y[i];e[o]=t(r,n,o)}return e},T=function(e,t){var r=v(e,t,"hex");return r.create=function(){return new O(e,t,e)},r.update=function(e){return r.create().update(e)},_(r,v,e,t)},k=[{name:"keccak",padding:[1,256,65536,16777216],bits:p,createMethod:T},{name:"sha3",padding:[6,1536,393216,100663296],bits:p,createMethod:T},{name:"shake",padding:[31,7936,2031616,520093696],bits:m,createMethod:function(e,t){var r=w(e,t,"hex");return r.create=function(r){return new O(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},_(r,w,e,t)}},{name:"cshake",padding:d,bits:m,createMethod:function(e,t){var r=g[e],n=A(e,0,"hex");return n.create=function(n,i,o){return i||o?new O(e,t,n).bytepad([i,o],r):S["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},_(n,A,e,t)}},{name:"kmac",padding:d,bits:m,createMethod:function(e,t){var r=g[e],n=E(e,0,"hex");return n.create=function(n,i,o){return new B(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},_(n,E,e,t)}}],S={},P=[],x=0;x<k.length;++x)for(var N=k[x],M=N.bits,C=0;C<M.length;++C){var R=N.name+"_"+M[C];if(P.push(R),S[R]=N.createMethod(M[C],N.padding),"sha3"!==N.name){var I=N.name+M[C];P.push(I),S[I]=S[R]}}function O(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 B(e,t,r){O.call(this,e,t,r)}O.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(i);if(null===e)throw new Error(i);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,o,a=this.blocks,s=this.byteCount,c=e.length,f=this.blockCount,l=0,d=this.s;l<c;){if(this.reset)for(this.reset=!1,a[0]=this.block,n=1;n<f+1;++n)a[n]=0;if(t)for(n=this.start;l<c&&n<s;++l)a[n>>2]|=e[l]<<h[3&n++];else for(n=this.start;l<c&&n<s;++l)(o=e.charCodeAt(l))<128?a[n>>2]|=o<<h[3&n++]:o<2048?(a[n>>2]|=(192|o>>6)<<h[3&n++],a[n>>2]|=(128|63&o)<<h[3&n++]):o<55296||o>=57344?(a[n>>2]|=(224|o>>12)<<h[3&n++],a[n>>2]|=(128|o>>6&63)<<h[3&n++],a[n>>2]|=(128|63&o)<<h[3&n++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++l)),a[n>>2]|=(240|o>>18)<<h[3&n++],a[n>>2]|=(128|o>>12&63)<<h[3&n++],a[n>>2]|=(128|o>>6&63)<<h[3&n++],a[n>>2]|=(128|63&o)<<h[3&n++]);if(this.lastByteIndex=n,n>=s){for(this.start=n-s,this.block=a[f],n=0;n<f;++n)d[n]^=a[n];F(d),this.reset=!0}else this.start=n}return this},O.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},O.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}var n=0,o=e.length;if(t)n=o;else for(var a=0;a<e.length;++a){var s=e.charCodeAt(a);s<128?n+=1:s<2048?n+=2:s<55296||s>=57344?n+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},O.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,o=[];return o.length=i,this.update(o),this},O.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];F(n)}},O.prototype.toString=O.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<n;){for(o=0;o<t&&a<n;++o,++a)e=r[o],s+=l[e>>4&15]+l[15&e]+l[e>>12&15]+l[e>>8&15]+l[e>>20&15]+l[e>>16&15]+l[e>>28&15]+l[e>>24&15];a%t==0&&(F(r),o=0)}return i&&(e=r[o],s+=l[e>>4&15]+l[15&e],i>1&&(s+=l[e>>12&15]+l[e>>8&15]),i>2&&(s+=l[e>>20&15]+l[e>>16&15])),s},O.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a<n;){for(o=0;o<t&&a<n;++o,++a)c[a]=r[o];a%t==0&&F(r)}return i&&(c[o]=r[o],e=e.slice(0,s)),e},O.prototype.buffer=O.prototype.arrayBuffer,O.prototype.digest=O.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,c=[];s<i;){for(a=0;a<r&&s<i;++a,++s)e=s<<2,t=n[a],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%r==0&&F(n)}return o&&(e=s<<2,t=n[a],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},B.prototype=new O,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),O.prototype.finalize.call(this)};var F=function(e){var t,r,n,i,o,a,s,c,f,u,l,d,h,p,m,y,g,v,w,A,E,_,T,k,S,P,x,N,M,C,R,I,O,B,F,D,U,L,j,z,G,q,K,H,J,W,V,Q,Y,X,Z,$,ee,te,re,ne,ie,oe,ae,se,ce,fe,ue;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>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^(c<<1|f>>>31),r=o^(f<<1|c>>>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=a^(u<<1|l>>>31),r=s^(l<<1|u>>>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=c^(d<<1|h>>>31),r=f^(h<<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=u^(i<<1|o>>>31),r=l^(o<<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],W=e[11]<<4|e[10]>>>28,V=e[10]<<4|e[11]>>>28,N=e[20]<<3|e[21]>>>29,M=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,q=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,F=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,Q=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,C=e[33]<<13|e[32]>>>19,R=e[32]<<13|e[33]>>>19,fe=e[42]<<2|e[43]>>>30,ue=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,Z=e[35]<<15|e[34]>>>17,I=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,L=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,J=e[9]<<27|e[8]>>>5,P=e[18]<<20|e[19]>>>12,x=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,z=e[38]<<8|e[39]>>>24,G=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=p^~y&v,e[1]=m^~g&w,e[10]=k^~P&N,e[11]=S^~x&M,e[20]=B^~D&L,e[21]=F^~U&j,e[30]=H^~W&Q,e[31]=J^~V&Y,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=y^~v&A,e[3]=g^~w&E,e[12]=P^~N&C,e[13]=x^~M&R,e[22]=D^~L&z,e[23]=U^~j&G,e[32]=W^~Q&X,e[33]=V^~Y&Z,e[42]=ne^~oe&se,e[43]=ie^~ae&ce,e[4]=v^~A&_,e[5]=w^~E&T,e[14]=N^~C&I,e[15]=M^~R&O,e[24]=L^~z&q,e[25]=j^~G&K,e[34]=Q^~X&$,e[35]=Y^~Z&ee,e[44]=oe^~se&fe,e[45]=ae^~ce&ue,e[6]=A^~_&p,e[7]=E^~T&m,e[16]=C^~I&k,e[17]=R^~O&S,e[26]=z^~q&B,e[27]=G^~K&F,e[36]=X^~$&H,e[37]=Z^~ee&J,e[46]=se^~fe&te,e[47]=ce^~ue&re,e[8]=_^~p&y,e[9]=T^~m&g,e[18]=I^~k&P,e[19]=O^~S&x,e[28]=q^~B&D,e[29]=K^~F&U,e[38]=$^~H&W,e[39]=ee^~J&V,e[48]=fe^~te&ne,e[49]=ue^~re&ie,e[0]^=b[n],e[1]^=b[n+1]};if(c)e.exports=S;else{for(x=0;x<P.length;++x)a[P[x]]=S[P[x]];f&&(void 0===(n=function(){return S}.call(t,r,t,e))||(e.exports=n))}}()},561: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)}},689:function(e){"use strict";!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,o=2773480762,a=1359893119,s=2600822924,c=528734635,f=1541459225;const u=new Uint32Array(64);function l(e){let l=0,d=e.length;for(;d>=64;){let h,b,p,m,y,g=r,v=n,w=i,A=o,E=a,_=s,T=c,k=f;for(b=0;b<16;b++)p=l+4*b,u[b]=(255&e[p])<<24|(255&e[p+1])<<16|(255&e[p+2])<<8|255&e[p+3];for(b=16;b<64;b++)h=u[b-2],m=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,h=u[b-15],y=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,u[b]=(m+u[b-7]|0)+(y+u[b-16]|0)|0;for(b=0;b<64;b++)m=(((E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7))+(E&_^~E&T)|0)+(k+(t[b]+u[b]|0)|0)|0,y=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&v^g&w^v&w)|0,k=T,T=_,_=E,E=A+m|0,A=w,w=v,v=g,g=m+y|0;r=r+g|0,n=n+v|0,i=i+w|0,o=o+A|0,a=a+E|0,s=s+_|0,c=c+T|0,f=f+k|0,l+=64,d-=64}}l(e);let d,h=e.length%64,b=e.length/536870912|0,p=e.length<<3,m=h<56?56:120,y=e.slice(e.length-h,e.length);for(y.push(128),d=h+1;d<m;d++)y.push(0);return y.push(b>>>24&255),y.push(b>>>16&255),y.push(b>>>8&255),y.push(b>>>0&255),y.push(p>>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),l(y),[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,o>>>24&255,o>>>16&255,o>>>8&255,o>>>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,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,o=new Array(i),a=new Array(64);let s,c=[];for(s=0;s<64;s++)o[s]=54;for(s=0;s<e.length;s++)o[s]^=e[s];for(s=0;s<t.length;s++)o[64+s]=t[s];for(s=i-4;s<i;s++)o[s]=0;for(s=0;s<64;s++)a[s]=92;for(s=0;s<e.length;s++)a[s]^=e[s];function f(){for(let e=i-1;e>=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;r>=32;)f(),c=c.concat(n(a.concat(n(o)))),r-=32;return r>0&&(f(),c=c.concat(n(a.concat(n(o))).slice(0,r))),c}function o(e,t,r,n,i){let o;for(f(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(e,16*o,i,16),s(i,n),f(i,0,e,t+16*o,16);for(o=0;o<r;o++)f(e,t+2*o*16,e,16*o,16);for(o=0;o<r;o++)f(e,t+16*(2*o+1),e,16*(o+r),16)}function a(e,t){return e<<t|e>>>32-t}function s(e,t){f(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function c(e,t,r,n){for(let i=0;i<n;i++)r[i]^=e[t+i]}function f(e,t,r,n,i){for(;i--;)r[n++]=e[t++]}function u(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 l(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function d(e,t,n,a,s,d,h){if(n=l(n,"N"),a=l(a,"r"),s=l(s,"p"),d=l(d,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/a)throw new Error("N too large");if(a>r/128/s)throw new Error("r too large");if(!u(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!u(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let b=i(e,t,128*s*a);const p=new Uint32Array(32*s*a);for(let e=0;e<p.length;e++){const t=4*e;p[e]=(255&b[t+3])<<24|(255&b[t+2])<<16|(255&b[t+1])<<8|(255&b[t+0])<<0}const m=new Uint32Array(64*a),y=new Uint32Array(32*a*n),g=32*a,v=new Uint32Array(16),w=new Uint32Array(16),A=s*n*2;let E,_,T=0,k=null,S=!1,P=0,x=0;const N=h?parseInt(1e3/a):4294967295,M="undefined"!=typeof setImmediate?setImmediate:setTimeout,C=function(){if(S)return h(new Error("cancelled"),T/A);let t;switch(P){case 0:_=32*x*a,f(p,_,m,0,g),P=1,E=0;case 1:t=n-E,t>N&&(t=N);for(let e=0;e<t;e++)f(m,0,y,(E+e)*g,g),o(m,g,a,v,w);if(E+=t,T+=t,h){const e=parseInt(1e3*T/A);if(e!==k){if(S=h(null,T/A),S)break;k=e}}if(E<n)break;E=0,P=2;case 2:t=n-E,t>N&&(t=N);for(let e=0;e<t;e++){const e=m[16*(2*a-1)]&n-1;c(y,e*g,m,g),o(m,g,a,v,w)}if(E+=t,T+=t,h){const e=parseInt(1e3*T/A);if(e!==k){if(S=h(null,T/A),S)break;k=e}}if(E<n)break;if(f(m,0,p,_,g),x++,x<s){P=0;break}b=[];for(let e=0;e<p.length;e++)b.push(p[e]>>0&255),b.push(p[e]>>8&255),b.push(p[e]>>16&255),b.push(p[e]>>24&255);const r=i(e,b,d);return h&&h(null,1,r),r}h&&M(C)};if(!h)for(;;){const e=C();if(null!=e)return e}C()}const h={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(s,c){let f=0;a&&a(0),d(e,t,r,n,i,o,(function(e,t,r){if(e)c(e);else if(r)a&&1!==f&&a(1),s(new Uint8Array(r));else if(a&&t!==f)return f=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(d(e,t,r,n,i,o))}};e.exports=h}()},222:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=o(r(14)),s=r(391),c=r(859),f=r(157),u=r(182),l=r(1),d=r(411),h=r(742),b=function(){function e(e,t,r){if(!e)throw new Error("No Collection ID.");this.collectionId=e,this.signerOrProvider=t,this.isDev=r,this.apps={}}return e.prototype.init=function(){return n(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,e.getCollectionData(this.collectionId,this.isDev)];case 1:return t=r.sent(),[2,this.initWithData(t)]}}))}))},e.prototype.initWithData=function(e){if(this.data=e,!this.data||!this.data.collectionId)throw new Error("Collection is not ready yet.");if(!this.data.address)throw new Error("Smart contract is not deployed yet.");this.chainId=this.data.chainId,this.networkName=this.data.networkName,this.base=f.BaseFacet__factory.connect(this.data.address,this.signerOrProvider);for(var t=0,r=this.data.apps;t<r.length;t++){var n=r[t];n.id===s.ethers.utils.id("drop")&&(this.apps.drop=u.DropFacet__factory.connect(this.data.address,this.signerOrProvider)),n.id===s.ethers.utils.id("edition")&&(this.apps.edition=l.EditionFacet__factory.connect(this.data.address,this.signerOrProvider)),n.id===s.ethers.utils.id("ape")&&(this.apps.ape=d.ApeDropFacet__factory.connect(this.data.address,this.signerOrProvider)),n.id===s.ethers.utils.id("erc20")&&(this.apps.erc20=h.ERC20AppFacet__factory.connect(this.data.address,this.signerOrProvider))}},e.prototype.verify=function(t){return e.verifyWallet(this.collectionId,t,this.isDev)},e.create=function(t,r,o,a){return n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return n=new e(r,t,a),o?(n.initWithData(o),[3,3]):[3,1];case 1:return[4,n.init()];case 2:i.sent(),i.label=3;case 3:return[2,n]}}))}))},e.verifyWallet=function(e,t,r){return n(this,void 0,void 0,(function(){var n,o,s,f;return i(this,(function(i){switch(i.label){case 0:return n=r?c.API_ENDPOINT_DEV:c.API_ENDPOINT,o="".concat(n,"/v3/collections/list/").concat(e),[4,a.default.post(o,{wallet:t},{validateStatus:function(e){return e<500}})];case 1:if((s=i.sent()).status>=400)throw f=s.data.message,new Error(f);return[2,s.data]}}))}))},e.getCollectionData=function(e,t){return n(this,void 0,void 0,(function(){var r,n,o,s;return i(this,(function(i){switch(i.label){case 0:return r=t?c.API_ENDPOINT_DEV:c.API_ENDPOINT,n="".concat(r,"/v3/collections/").concat(e,"/address"),[4,a.default.get(n,{validateStatus:function(e){return e<500}})];case 1:if((o=i.sent()).status>=400)throw s=o.data.message,new Error(s);return[2,o.data]}}))}))},e}();t.default=b},859:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.API_ENDPOINT=t.API_ENDPOINT_DEV=void 0,t.API_ENDPOINT_DEV="https://api-testnet.niftykit.com",t.API_ENDPOINT="https://api.niftykit.com"},368:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(222));t.default=i.default},181:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ApeDropFacet__factory=void 0;var o=r(391),a=[{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{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:"uint256",name:"fromTokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"toTokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"ConsecutiveTransfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"uint256",name:"roles",type:"uint256"}],name:"RolesUpdated",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:[],name:"apeMintFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint64",name:"quantity",type:"uint64"}],name:"apeMintTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"apePresaleActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint64",name:"quantity",type:"uint64"},{internalType:"uint256",name:"allowed",type:"uint256"},{internalType:"bytes32[]",name:"proof",type:"bytes32[]"}],name:"apePresaleMintTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"apePrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"apeRevenue",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"apeSaleActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"newMaxAmount",type:"uint256"},{internalType:"uint256",name:"newMaxPerMint",type:"uint256"},{internalType:"uint256",name:"newMaxPerWallet",type:"uint256"},{internalType:"uint256",name:"newPrice",type:"uint256"},{internalType:"bool",name:"presale",type:"bool"}],name:"apeStartSale",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"apeStopSale",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"apeWithdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"finalizeApeDrop",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress_",type:"address"}],name:"initializeApeDrop",outputs:[],stateMutability:"nonpayable",type:"function"}],s="0x608060405234801561001057600080fd5b506118a3806100206000396000f3fe6080604052600436106100a75760003560e01c80634cbc2233116100645780634cbc223314610153578063629fcbbb146101685780637a3f451e1461019e578063bd0d30e5146101d2578063cb75872a146101fd578063cc3fd3661461021057600080fd5b806303de52b7146100ac578063061a4194146100c357806306af7fa1146100e357806314407faf1461010357806335af1341146101185780633c5f35051461012b575b600080fd5b3480156100b857600080fd5b506100c1610244565b005b3480156100cf57600080fd5b506100c16100de366004611507565b6102dc565b3480156100ef57600080fd5b506100c16100fe366004611569565b6103a0565b34801561010f57600080fd5b506100c161044b565b6100c16101263660046115a2565b610472565b34801561013757600080fd5b506101406106c4565b6040519081526020015b60405180910390f35b34801561015f57600080fd5b506100c1610777565b34801561017457600080fd5b5060008051602061182e83398151915254610100900460ff165b604051901515815260200161014a565b3480156101aa57600080fd5b507fbf52cd849dccc2c223783e1d385704ea86b8dd04290c0a9896c634edf522738754610140565b3480156101de57600080fd5b5060008051602061182e8339815191525462010000900460ff1661018e565b6100c161020b3660046115d7565b610864565b34801561021c57600080fd5b507fbf52cd849dccc2c223783e1d385704ea86b8dd04290c0a9896c634edf522738854610140565b600161024f81610b94565b60008051602061182e8339815191525460ff166102a55760405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081a5b9a5d1a585b1a5e9959608a1b60448201526064015b60405180910390fd5b5060008051602061182e833981519152805460ff1916905560008051602061184e83398151915280546001600160a01b0319169055565b60026102e781610b94565b5060008051602061182e8339815191528054911515620100000262ffff0019909216919091176101001790557fbf52cd849dccc2c223783e1d385704ea86b8dd04290c0a9896c634edf5227387557f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907b929092557f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907c557f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907d55565b60016103ab81610b94565b60008051602061182e8339815191525460ff16156104015760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015260640161029c565b5060008051602061184e83398151915280546001600160a01b0319166001600160a01b039290921691909117905560008051602061182e833981519152805460ff19166001179055565b600261045681610b94565b5060008051602061182e833981519152805462ffff0019169055565b807f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b3815690786001600160401b0382166104da5760405162461bcd60e51b815260206004820152600d60248201526c05175616e74697479206973203609c1b604482015260640161029c565b8060040154826001600160401b0316111561052f5760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b604482015260640161029c565b6000816003015411801561056157508060030154826001600160401b0316610555610bca565b61055f919061168c565b115b156105a45760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b604482015260640161029c565b60008051602061182e8339815191525460008051602061184e8339815191529062010000900460ff161561060b5760405162461bcd60e51b815260206004820152600e60248201526d50726573616c652061637469766560901b604482015260640161029c565b6003810154610100900460ff166106565760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b604482015260640161029c565b7f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907d548461068287610c16565b61068c919061169f565b6001600160401b031611156106b35760405162461bcd60e51b815260040161029c906116c6565b6106bd8486610c53565b5050505050565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a5460408051630317c2dd60e01b81526001600482015281516000936201000090046001600160a01b031692849283928592630317c2dd92602480820193918290030181865afa15801561073c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076091906116fd565b909250905061076f818361168c565b935050505090565b600161078281610b94565b600060008051602061184e83398151915280546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156107e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108049190611721565b9050600081116108425760405162461bcd60e51b8152602060048201526009602482015268302062616c616e636560b81b604482015260640161029c565b61085f61084d610eb8565b83546001600160a01b03169083610efe565b505050565b837f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b3815690786001600160401b0382166108cc5760405162461bcd60e51b815260206004820152600d60248201526c05175616e74697479206973203609c1b604482015260640161029c565b8060040154826001600160401b031611156109215760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b604482015260640161029c565b6000816003015411801561095357508060030154826001600160401b0316610947610bca565b610951919061168c565b115b156109965760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b604482015260640161029c565b7f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907860008051602061184e8339815191526000886109d28b610c16565b6109dc919061169f565b6001600160401b031690508160030160029054906101000a900460ff16610a3a5760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b604482015260640161029c565b8260010154600003610a805760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481b9bdd081cd95d608a1b604482015260640161029c565b8260050154811115610aa45760405162461bcd60e51b815260040161029c906116c6565b87811115610ac45760405162461bcd60e51b815260040161029c906116c6565b610b4087878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050505060018501546040516bffffffffffffffffffffffff1960608f901b166020820152603481018c905260540160405160208183030381529060405280519060200120610f61565b610b7e5760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481a5b9d985b1a59608a1b604482015260640161029c565b610b88898b610c53565b50505050505050505050565b638b78c6d8600c5233600052806020600c205416610bc757638b78c6d819543314610bc7576382b429006000526004601cfd5b50565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c41547f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4054036000190190565b6001600160a01b031660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45602052604090205460c01c90565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a547fbf52cd849dccc2c223783e1d385704ea86b8dd04290c0a9896c634edf52273875460008051602061184e833981519152916201000090046001600160a01b031690600090610cce906001600160401b0387169061173a565b604051630317c2dd60e01b81526001600160401b038716600482015290915060009081906001600160a01b03851690630317c2dd906024016040805180830381865afa158015610d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4691906116fd565b909250905034610d56828461168c565b1115610d965760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b604482015260640161029c565b610da08483610f77565b8015610e1157610e11306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0b9190611751565b82610f77565b600285018054840190558454610e32906001600160a01b0316873086611090565b610e9c8688610e4089610c16565b610e4a919061169f565b6001600160a01b039190911660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c456020526040902080546001600160c01b031660c09290921b919091179055565b610eaf86886001600160401b03166110ce565b50505050505050565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5e546000906001600160a01b03163303610ef9575060131936013560601c90565b503390565b6040516001600160a01b03831660248201526044810182905261085f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611209565b600082610f6e85846112de565b14949350505050565b80471015610fc75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161029c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611014576040519150601f19603f3d011682016040523d82523d6000602084013e611019565b606091505b505090508061085f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161029c565b6040516001600160a01b03808516602483015283166044820152606481018290526110c89085906323b872dd60e01b90608401610f2a565b50505050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405460008290036111095761110963b562e8dd60e01b61132d565b60008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602090815260408083206001600160a01b0387164260a01b6001881460e11b1781179091558084527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4590925282208054680100000000000000018602019055908190036111a5576111a5622e076360e81b61132d565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a48181600101915081036111aa57507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405550505050565b600061125e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113379092919063ffffffff16565b905080516000148061127f57508080602001905181019061127f919061176e565b61085f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161029c565b600081815b84518110156113235761130f828683815181106113025761130261178b565b602002602001015161134e565b91508061131b816117a1565b9150506112e3565b5090505b92915050565b8060005260046000fd5b60606113468484600085611380565b949350505050565b600081831061136a576000828152602084905260409020611379565b60008381526020839052604090205b9392505050565b6060824710156113e15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161029c565b600080866001600160a01b031685876040516113fd91906117de565b60006040518083038185875af1925050503d806000811461143a576040519150601f19603f3d011682016040523d82523d6000602084013e61143f565b606091505b50915091506114508783838761145b565b979650505050505050565b606083156114ca5782516000036114c3576001600160a01b0385163b6114c35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161029c565b5081611346565b61134683838151156114df5781518083602001fd5b8060405162461bcd60e51b815260040161029c91906117fa565b8015158114610bc757600080fd5b600080600080600060a0868803121561151f57600080fd5b853594506020860135935060408601359250606086013591506080860135611546816114f9565b809150509295509295909350565b6001600160a01b0381168114610bc757600080fd5b60006020828403121561157b57600080fd5b813561137981611554565b80356001600160401b038116811461159d57600080fd5b919050565b600080604083850312156115b557600080fd5b82356115c081611554565b91506115ce60208401611586565b90509250929050565b6000806000806000608086880312156115ef57600080fd5b85356115fa81611554565b945061160860208701611586565b93506040860135925060608601356001600160401b038082111561162b57600080fd5b818801915088601f83011261163f57600080fd5b81358181111561164e57600080fd5b8960208260051b850101111561166357600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561132757611327611676565b6001600160401b038181168382160190808211156116bf576116bf611676565b5092915050565b60208082526017908201527f4578636565646564206d6178207065722077616c6c6574000000000000000000604082015260600190565b6000806040838503121561171057600080fd5b505080516020909101519092909150565b60006020828403121561173357600080fd5b5051919050565b808202811582820484141761132757611327611676565b60006020828403121561176357600080fd5b815161137981611554565b60006020828403121561178057600080fd5b8151611379816114f9565b634e487b7160e01b600052603260045260246000fd5b6000600182016117b3576117b3611676565b5060010190565b60005b838110156117d55781810151838201526020016117bd565b50506000910152565b600082516117f08184602087016117ba565b9190910192915050565b60208152600082518060208401526118198160408501602087016117ba565b601f01601f1916919091016040019291505056febf52cd849dccc2c223783e1d385704ea86b8dd04290c0a9896c634edf5227389bf52cd849dccc2c223783e1d385704ea86b8dd04290c0a9896c634edf5227386a264697066735822122017319a8d4e0beb4e8a48a8eb32bd6fc796505e115cb26ab096674ac979bf499364736f6c63430008130033";t.ApeDropFacet__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApeDropFacet__factory=void 0;var n=r(181);Object.defineProperty(t,"ApeDropFacet__factory",{enumerable:!0,get:function(){return n.ApeDropFacet__factory}})},720:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.DropFacet__factory=void 0;var o=r(391),a=[{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{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:"uint256",name:"fromTokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"toTokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"ConsecutiveTransfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"uint256",name:"roles",type:"uint256"}],name:"RolesUpdated",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:[],name:"airdropFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint64[]",name:"quantities",type:"uint64[]"},{internalType:"address[]",name:"recipients",type:"address[]"}],name:"batchAirdrop",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"displayPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"dropRevenue",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxPerMint",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxPerWallet",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"mintFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint64",name:"quantity",type:"uint64"}],name:"mintTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"presaleActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint64",name:"quantity",type:"uint64"},{internalType:"uint256",name:"allowed",type:"uint256"},{internalType:"bytes32[]",name:"proof",type:"bytes32[]"}],name:"presaleMintTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"price",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"saleActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"newRoot",type:"bytes32"}],name:"setMerkleRoot",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"newMaxAmount",type:"uint256"},{internalType:"uint256",name:"newMaxPerMint",type:"uint256"},{internalType:"uint256",name:"newMaxPerWallet",type:"uint256"},{internalType:"uint256",name:"newPrice",type:"uint256"},{internalType:"bool",name:"presale",type:"bool"}],name:"startSale",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"stopSale",outputs:[],stateMutability:"nonpayable",type:"function"}],s="0x608060405234801561001057600080fd5b50611a8e806100206000396000f3fe6080604052600436106100f35760003560e01c8063789e3a551161008a578063a035b1fe11610059578063a035b1fe146102d7578063d53ab501146102ec578063e36b0b37146102ff578063fd51fae81461031457600080fd5b8063789e3a551461026d5780637cb647591461028f57806393d756aa146102af57806398624455146102c257600080fd5b806353135ca0116100c657806353135ca0146101aa5780635541c605146101db5780635f48f3931461020f57806368428a1b1461024357600080fd5b806313966db5146100f857806335b69a3f14610120578063453c231014610142578063507e094f14610176575b600080fd5b34801561010457600080fd5b5061010d610327565b6040519081526020015b60405180910390f35b34801561012c57600080fd5b506000805160206119f98339815191525461010d565b34801561014e57600080fd5b507f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907d5461010d565b34801561018257600080fd5b507f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907c5461010d565b3480156101b657600080fd5b50600080516020611a198339815191525460ff165b6040519015158152602001610117565b3480156101e757600080fd5b507f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907a5461010d565b34801561021b57600080fd5b507f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907b5461010d565b34801561024f57600080fd5b50600080516020611a1983398151915254610100900460ff166101cb565b34801561027957600080fd5b5061028d6102883660046115b2565b6103c8565b005b34801561029b57600080fd5b5061028d6102aa366004611604565b610477565b61028d6102bd36600461164e565b6104a7565b3480156102ce57600080fd5b5061010d6106c9565b3480156102e357600080fd5b5061010d61076f565b61028d6102fa3660046116ce565b61082d565b34801561030b57600080fd5b5061028d610b1b565b61028d610322366004611739565b610b41565b6000805160206119b98339815191525460408051630317c2dd60e01b81526001600482015281516000936201000090046001600160a01b031692849283928592630317c2dd92602480820193918290030181865afa15801561038d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b191906117a9565b90925090506103c081836117e3565b935050505090565b60026103d381610e2b565b50600080516020611a19833981519152805491151561ffff19909216919091176101001790557f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907b939093557f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907c919091557f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907d556000805160206119f983398151915255565b600261048281610e2b565b507f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907955565b80600080516020611a398339815191526001600160401b0382166105025760405162461bcd60e51b815260206004820152600d60248201526c05175616e74697479206973203609c1b60448201526064015b60405180910390fd5b8060040154826001600160401b031611156105575760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b60448201526064016104f9565b6000816003015411801561058957508060030154826001600160401b031661057d610e61565b61058791906117e3565b115b156105cc5760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b60448201526064016104f9565b600080516020611a1983398151915254600080516020611a398339815191529060ff161561062d5760405162461bcd60e51b815260206004820152600e60248201526d50726573616c652061637469766560901b60448201526064016104f9565b6007810154610100900460ff166106785760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b60448201526064016104f9565b80600501548461068787610e9b565b61069191906117f6565b6001600160401b031611156106b85760405162461bcd60e51b81526004016104f99061181d565b6106c28486610ed8565b5050505050565b6000805160206119b98339815191525460408051630317c2dd60e01b81526001600482015281516000936201000090046001600160a01b031692849283928592630317c2dd92602480820193918290030181865afa15801561072f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075391906117a9565b915091506000811161076557816103c0565b6000935050505090565b6000805160206119b9833981519152546000805160206119f98339815191525460408051630317c2dd60e01b81526001600482015281516000946201000090046001600160a01b03169392859283928692630317c2dd92602480820193918290030181865afa1580156107e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080a91906117a9565b90925090508061081a83856117e3565b61082491906117e3565b94505050505090565b600261083881610e2b565b8184811461087c5760405162461bcd60e51b8152602060048201526011602482015270496e76616c696420417267756d656e747360781b60448201526064016104f9565b6000805b8281101561091a576108e786868381811061089d5761089d611854565b90506020020160208101906108b2919061186a565b8989848181106108c4576108c4611854565b90506020020160208101906108d99190611887565b6001600160401b0316611114565b8787828181106108f9576108f9611854565b905060200201602081019061090e9190611887565b90910190600101610880565b5060007f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5660040160029054906101000a90046001600160a01b031690506000816001600160a01b031663788914d0306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca91906118a2565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610a0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3291906118bf565b6bffffffffffffffffffffffff161115610a4e575050506106c2565b604051630317c2dd60e01b81526001600160401b03831660048201526000906001600160a01b03831690630317c2dd906024016040805180830381865afa158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac191906117a9565b50905034811115610b065760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b60448201526064016104f9565b610b108282611132565b505050505050505050565b6002610b2681610e2b565b50600080516020611a19833981519152805461ffff19169055565b83600080516020611a398339815191526001600160401b038216610b975760405162461bcd60e51b815260206004820152600d60248201526c05175616e74697479206973203609c1b60448201526064016104f9565b8060040154826001600160401b03161115610bec5760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b60448201526064016104f9565b60008160030154118015610c1e57508060030154826001600160401b0316610c12610e61565b610c1c91906117e3565b115b15610c615760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b60448201526064016104f9565b600080516020611a39833981519152600087610c7c8a610e9b565b610c8691906117f6565b60078301546001600160401b0391909116915060ff16610cdd5760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b60448201526064016104f9565b8160010154600003610d235760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481b9bdd081cd95d608a1b60448201526064016104f9565b8160050154811115610d475760405162461bcd60e51b81526004016104f99061181d565b86811115610d675760405162461bcd60e51b81526004016104f99061181d565b610de386868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050505060018401546040516bffffffffffffffffffffffff1960608e901b166020820152603481018b905260540160405160208183030381529060405280519060200120611250565b610e215760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481a5b9d985b1a59608a1b60448201526064016104f9565b610b10888a610ed8565b638b78c6d8600c5233600052806020600c205416610e5e57638b78c6d819543314610e5e576382b429006000526004601cfd5b50565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c41546000805160206119d983398151915254036000190190565b6001600160a01b031660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45602052604090205460c01c90565b6000805160206119b9833981519152546000805160206119f983398151915254620100009091046001600160a01b031690600080516020611a3983398151915290600090610f30906001600160401b038716906118ed565b604051630317c2dd60e01b81526001600160401b038716600482015290915060009081906001600160a01b03861690630317c2dd906024016040805180830381865afa158015610f84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa891906117a9565b90925090503481610fb984866117e3565b610fc391906117e3565b11156110035760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b60448201526064016104f9565b6002840180543401839003829003905561101d8583611132565b801561108e5761108e306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611064573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108891906118a2565b82611132565b6110f8868861109c89610e9b565b6110a691906117f6565b6001600160a01b039190911660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c456020526040902080546001600160c01b031660c09290921b919091179055565b61110b86886001600160401b0316611266565b50505050505050565b61112e82826040518060200160405280600081525061137d565b5050565b804710156111825760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016104f9565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146111cf576040519150601f19603f3d011682016040523d82523d6000602084013e6111d4565b606091505b505090508061124b5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016104f9565b505050565b60008261125d85846113f9565b14949350505050565b6000805160206119d983398151915254600082900361128f5761128f63b562e8dd60e01b611448565b60008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602090815260408083206001600160a01b0387164260a01b6001881460e11b1781179091558084527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45909252822080546801000000000000000186020190559081900361132b5761132b622e076360e81b611448565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a481816001019150810361133057506000805160206119d98339815191525550505050565b6113878383611266565b6001600160a01b0383163b1561124b576000805160206119d9833981519152548281035b6113be6000868380600101945086611452565b6113d2576113d26368d2bf6b60e11b611448565b8181106113ab57816000805160206119d983398151915254146106c2576106c26000611448565b600081815b845181101561143e5761142a8286838151811061141d5761141d611854565b602002602001015161153a565b91508061143681611904565b9150506113fe565b5090505b92915050565b8060005260046000fd5b6000836001600160a01b031663150b7a0261146b61156c565b8786866040518563ffffffff1660e01b815260040161148d949392919061191d565b6020604051808303816000875af19250505080156114c8575060408051601f3d908101601f191682019092526114c59181019061198e565b60015b61151d573d8080156114f6576040519150601f19603f3d011682016040523d82523d6000602084013e6114fb565b606091505b508051600003611515576115156368d2bf6b60e11b611448565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6000818310611556576000828152602084905260409020611565565b60008381526020839052604090205b9392505050565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5e546000906001600160a01b031633036115ad575060131936013560601c90565b503390565b600080600080600060a086880312156115ca57600080fd5b85359450602086013593506040860135925060608601359150608086013580151581146115f657600080fd5b809150509295509295909350565b60006020828403121561161657600080fd5b5035919050565b6001600160a01b0381168114610e5e57600080fd5b80356001600160401b038116811461164957600080fd5b919050565b6000806040838503121561166157600080fd5b823561166c8161161d565b915061167a60208401611632565b90509250929050565b60008083601f84011261169557600080fd5b5081356001600160401b038111156116ac57600080fd5b6020830191508360208260051b85010111156116c757600080fd5b9250929050565b600080600080604085870312156116e457600080fd5b84356001600160401b03808211156116fb57600080fd5b61170788838901611683565b9096509450602087013591508082111561172057600080fd5b5061172d87828801611683565b95989497509550505050565b60008060008060006080868803121561175157600080fd5b853561175c8161161d565b945061176a60208701611632565b93506040860135925060608601356001600160401b0381111561178c57600080fd5b61179888828901611683565b969995985093965092949392505050565b600080604083850312156117bc57600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b80820180821115611442576114426117cd565b6001600160401b03818116838216019080821115611816576118166117cd565b5092915050565b60208082526017908201527f4578636565646564206d6178207065722077616c6c6574000000000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561187c57600080fd5b81356115658161161d565b60006020828403121561189957600080fd5b61156582611632565b6000602082840312156118b457600080fd5b81516115658161161d565b6000602082840312156118d157600080fd5b81516bffffffffffffffffffffffff8116811461156557600080fd5b8082028115828204841417611442576114426117cd565b600060018201611916576119166117cd565b5060010190565b600060018060a01b038087168352602081871681850152856040850152608060608501528451915081608085015260005b8281101561196a5785810182015185820160a00152810161194e565b5050600060a0828501015260a0601f19601f83011684010191505095945050505050565b6000602082840312156119a057600080fd5b81516001600160e01b03198116811461156557600080fdfe45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c408463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907e8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b381569078a26469706673582212202adc62a9ecaeaa6d3a506176f2a21c1e432b226a3885dbd152b126f6d44ffc2864736f6c63430008130033";t.DropFacet__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DropFacet__factory=void 0;var n=r(720);Object.defineProperty(t,"DropFacet__factory",{enumerable:!0,get:function(){return n.DropFacet__factory}})},948:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EditionFacet__factory=void 0;var o=r(391),a=[{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{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:"uint256",name:"fromTokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"toTokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"ConsecutiveTransfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"editionId",type:"uint256"}],name:"EditionCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"editionId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantity",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"EditionMinted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"uint256",name:"roles",type:"uint256"}],name:"RolesUpdated",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:"string",name:"tokenURI",type:"string"},{internalType:"uint256",name:"price",type:"uint256"},{internalType:"uint256",name:"maxQuantity",type:"uint256"},{internalType:"uint256",name:"maxPerWallet",type:"uint256"},{internalType:"uint256",name:"maxPerMint",type:"uint256"}],name:"createEdition",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"editionMintFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"editionRevenue",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"editionsCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"}],name:"getEdition",outputs:[{components:[{internalType:"string",name:"tokenURI",type:"string"},{internalType:"bytes32",name:"merkleRoot",type:"bytes32"},{internalType:"uint256",name:"price",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"uint256",name:"maxQuantity",type:"uint256"},{internalType:"uint256",name:"maxPerWallet",type:"uint256"},{internalType:"uint256",name:"maxPerMint",type:"uint256"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"address",name:"signer",type:"address"},{internalType:"bool",name:"active",type:"bool"}],internalType:"struct EditionStorage.Edition",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"}],name:"getEditionPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"editionId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"bytes32[]",name:"proof",type:"bytes32[]"}],name:"mintEdition",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"},{internalType:"bool",name:"active",type:"bool"}],name:"setEditionActive",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"},{internalType:"bytes32",name:"merkleRoot",type:"bytes32"}],name:"setEditionMerkleRoot",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],name:"setEditionSigner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"},{internalType:"string",name:"tokenURI",type:"string"}],name:"setEditionTokenURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"},{internalType:"uint256",name:"price",type:"uint256"},{internalType:"uint256",name:"maxQuantity",type:"uint256"},{internalType:"uint256",name:"maxPerWallet",type:"uint256"},{internalType:"uint256",name:"maxPerMint",type:"uint256"}],name:"updateEdition",outputs:[],stateMutability:"nonpayable",type:"function"}],s="0x608060405234801561001057600080fd5b506118a0806100206000396000f3fe6080604052600436106100a75760003560e01c8063906c012111610064578063906c012114610167578063a619976d14610187578063a642c032146101bb578063c88355b4146101e8578063ca696f4814610208578063fab7ee7b1461022857600080fd5b80631475df11146100ac57806343d7b495146100ce5780635eb30d1c146100e1578063654762ce146101125780638328265714610132578063835f610d14610152575b600080fd5b3480156100b857600080fd5b506100cc6100c7366004611285565b610248565b005b6100cc6100dc3660046112d5565b6102b7565b3480156100ed57600080fd5b5060008051602061184b833981519152545b6040519081526020015b60405180910390f35b34801561011e57600080fd5b506100cc61012d36600461136e565b61057e565b34801561013e57600080fd5b506100cc61014d366004611446565b6105e8565b34801561015e57600080fd5b506100ff610744565b34801561017357600080fd5b506100cc6101823660046114a3565b6107f7565b34801561019357600080fd5b507f0193784bd9621be915feb61a02526941c48cf0476dacde52dea7f0e7110ed0d9546100ff565b3480156101c757600080fd5b506101db6101d63660046114ea565b610852565b6040516101099190611549565b3480156101f457600080fd5b506100ff6102033660046114ea565b6109f4565b34801561021457600080fd5b506100cc6102233660046115e3565b610b03565b34801561023457600080fd5b506100cc610243366004611608565b610b70565b600261025381610bc3565b60008051602061184b8339815191528054871061028b5760405162461bcd60e51b81526004016102829061162a565b60405180910390fd5b600096875260010160205250604090942060028101939093556004830191909155600582015560060155565b60007f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db56600401546201000090046001600160a01b03169050600060008051602061184b83398151915260008781526001820160205260408082209051630317c2dd60e01b8152600481018990529293509181906001600160a01b03861690630317c2dd906024016040805180830381865afa15801561035a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037e9190611652565b91509150888460000154116103a55760405162461bcd60e51b81526004016102829061162a565b6008830154600160a01b900460ff166103ed5760405162461bcd60e51b815260206004820152600a6024820152694e6f742061637469766560b01b6044820152606401610282565b3481838a8660020154610400919061168c565b61040a91906116a3565b61041491906116a3565b11156104545760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b6044820152606401610282565b61046184848b8d8c610bf9565b61046d838b8989610d2e565b60038401805434018390038290039055600089815260028501602090815260408083206001600160a01b038e16845290915290208054890190556104b18583610def565b801561052257610522306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051c91906116b6565b82610def565b61052d838b8a610f0d565b604080518981523460208201528a916001600160a01b038d16917f2974dcc018eac8a0cea38a8688ad4a3cc7686e4edd75be71818e23d62ef2265f910160405180910390a350505050505050505050565b600261058981610bc3565b60008051602061184b833981519152805484106105b85760405162461bcd60e51b81526004016102829061162a565b60009384526001016020525060409091206008018054911515600160a01b0260ff60a01b19909216919091179055565b60026105f381610bc3565b60008051602061184b83398151915280546040805161014081018252898152600060208201819052918101899052606081018290526080810188905260a0810187905260c0810186905260e08101919091526101008101610652611063565b6001600160a01b0316815260006020918201819052838152600185019091526040902081518190610683908261175b565b5060208201516001808301919091556040808401516002840155606084015160038401556080840151600484015560a0840151600584015560c0840151600684015560e0840151600784015561010084015160089093018054610120909501511515600160a01b026001600160a81b03199095166001600160a01b039094169390931793909317909155820183555181907f962bb64b059ad60d491bef43125921210925c52b11ff1cc093409113c8c5fe3790600090a25050505050505050565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a5460408051630317c2dd60e01b81526001600482015281516000936201000090046001600160a01b031692849283928592630317c2dd92602480820193918290030181865afa1580156107bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e09190611652565b90925090506107ef81836116a3565b935050505090565b600261080281610bc3565b60008051602061184b833981519152805484106108315760405162461bcd60e51b81526004016102829061162a565b6000848152600182016020526040902061084b848261175b565b5050505050565b6108b6604051806101400160405280606081526020016000801916815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b031681526020016000151581525090565b60008281527f0193784bd9621be915feb61a02526941c48cf0476dacde52dea7f0e7110ed0d7602052604090819020815161014081019092528054829082906108fe906116d3565b80601f016020809104026020016040519081016040528092919081815260200182805461092a906116d3565b80156109775780601f1061094c57610100808354040283529160200191610977565b820191906000526020600020905b81548152906001019060200180831161095a57829003601f168201915b505050918352505060018201546020820152600282015460408201526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546001600160a01b038116610100830152600160a01b900460ff1615156101209091015292915050565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a5460008051602061184b83398151915280546000926201000090046001600160a01b031691908410610a595760405162461bcd60e51b81526004016102829061162a565b60008481526001828101602052604080832060028101549151630317c2dd60e01b8152600481019390935292909181906001600160a01b03871690630317c2dd906024016040805180830381865afa158015610ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610add9190611652565b909250905080610aed83856116a3565b610af791906116a3565b98975050505050505050565b6002610b0e81610bc3565b60008051602061184b83398151915280548410610b3d5760405162461bcd60e51b81526004016102829061162a565b600093845260010160205250604090912060080180546001600160a01b0319166001600160a01b03909216919091179055565b6002610b7b81610bc3565b60008051602061184b83398151915280548410610baa5760405162461bcd60e51b81526004016102829061162a565b6000938452600190810160205260409093209092015550565b638b78c6d8600c5233600052806020600c205416610bf657638b78c6d819543314610bf6576382b429006000526004601cfd5b50565b6005840154600084815260028701602090815260408083206001600160a01b0387168452909152902054610c2e9083906116a3565b1115610c7c5760405162461bcd60e51b815260206004820152601760248201527f4578636565646564206d6178207065722077616c6c65740000000000000000006044820152606401610282565b8360060154811115610cc85760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b6044820152606401610282565b60048401541580610cec57508360040154818560030154610ce991906116a3565b11155b61084b5760405162461bcd60e51b8152602060048201526013602482015272115e18d959591959081b585e08185b5bdd5b9d606a1b6044820152606401610282565b600184015415610de957610dad82828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050505060018601546040516bffffffffffffffffffffffff19606088901b166020820152603401604051602081830303815290604052805190602001206110a9565b610de95760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610282565b50505050565b80471015610e3f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610282565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610e8c576040519150601f19603f3d011682016040523d82523d6000602084013e610e91565b606091505b5050905080610f085760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610282565b505050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4054805b610f3b82846116a3565b81101561104e576040518060400160405280600115158152602001866000018054610f65906116d3565b80601f0160208091040260200160405190810160405280929190818152602001828054610f91906116d3565b8015610fde5780601f10610fb357610100808354040283529160200191610fde565b820191906000526020600020905b815481529060010190602001808311610fc157829003601f168201915b505050505081525061100d7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5690565b6000838152600391909101602090815260409091208251815460ff1916901515178155908201516001820190611043908261175b565b505050600101610f31565b5060038401805483019055610de983836110bf565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5e546000906001600160a01b031633036110a4575060131936013560601c90565b503390565b6000826110b685846111fa565b14949350505050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405460008290036110fa576110fa63b562e8dd60e01b611249565b60008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602090815260408083206001600160a01b0387164260a01b6001881460e11b1781179091558084527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45909252822080546801000000000000000186020190559081900361119657611196622e076360e81b611249565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a481816001019150810361119b57507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405550505050565b600081815b845181101561123f5761122b8286838151811061121e5761121e61181b565b6020026020010151611253565b91508061123781611831565b9150506111ff565b5090505b92915050565b8060005260046000fd5b600081831061126f57600082815260208490526040902061127e565b60008381526020839052604090205b9392505050565b600080600080600060a0868803121561129d57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6001600160a01b0381168114610bf657600080fd5b6000806000806000608086880312156112ed57600080fd5b85356112f8816112c0565b94506020860135935060408601359250606086013567ffffffffffffffff8082111561132357600080fd5b818801915088601f83011261133757600080fd5b81358181111561134657600080fd5b8960208260051b850101111561135b57600080fd5b9699959850939650602001949392505050565b6000806040838503121561138157600080fd5b823591506020830135801515811461139857600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126113ca57600080fd5b813567ffffffffffffffff808211156113e5576113e56113a3565b604051601f8301601f19908116603f0116810190828211818310171561140d5761140d6113a3565b8160405283815286602085880101111561142657600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a0868803121561145e57600080fd5b853567ffffffffffffffff81111561147557600080fd5b611481888289016113b9565b9860208801359850604088013597606081013597506080013595509350505050565b600080604083850312156114b657600080fd5b82359150602083013567ffffffffffffffff8111156114d457600080fd5b6114e0858286016113b9565b9150509250929050565b6000602082840312156114fc57600080fd5b5035919050565b6000815180845260005b818110156115295760208185018101518683018201520161150d565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260008251610140806020850152611568610160850183611503565b9150602085015160408501526040850151606085015260608501516080850152608085015160a085015260a085015160c085015260c085015160e085015260e08501516101008181870152808701519150506101206115d1818701836001600160a01b03169052565b90950151151593019290925250919050565b600080604083850312156115f657600080fd5b823591506020830135611398816112c0565b6000806040838503121561161b57600080fd5b50508035926020909101359150565b6020808252600e908201526d111bd95cc81b9bdd08195e1a5cdd60921b604082015260600190565b6000806040838503121561166557600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761124357611243611676565b8082018082111561124357611243611676565b6000602082840312156116c857600080fd5b815161127e816112c0565b600181811c908216806116e757607f821691505b60208210810361170757634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610f0857600081815260208120601f850160051c810160208610156117345750805b601f850160051c820191505b8181101561175357828155600101611740565b505050505050565b815167ffffffffffffffff811115611775576117756113a3565b6117898161178384546116d3565b8461170d565b602080601f8311600181146117be57600084156117a65750858301515b600019600386901b1c1916600185901b178555611753565b600085815260208120601f198616915b828110156117ed578886015182559484019460019091019084016117ce565b508582101561180b5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b60006001820161184357611843611676565b506001019056fe0193784bd9621be915feb61a02526941c48cf0476dacde52dea7f0e7110ed0d6a2646970667358221220d55b27b192b0534c0f2f9d6713b623693c32fe9a5beb8021d520ac801733f08e64736f6c63430008130033";t.EditionFacet__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},1:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditionFacet__factory=void 0;var n=r(948);Object.defineProperty(t,"EditionFacet__factory",{enumerable:!0,get:function(){return n.EditionFacet__factory}})},501:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ERC20AppFacet__factory=void 0;var o=r(391),a=[{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{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:"uint256",name:"fromTokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"toTokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"ConsecutiveTransfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"uint256",name:"roles",type:"uint256"}],name:"RolesUpdated",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:[],name:"erc20ActiveCoin",outputs:[{internalType:"contract IERC20Upgradeable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"erc20CoinByIndex",outputs:[{internalType:"contract IERC20Upgradeable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"erc20CoinsCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"erc20MintFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint64",name:"quantity",type:"uint64"}],name:"erc20MintTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"erc20PresaleActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint64",name:"quantity",type:"uint64"},{internalType:"uint256",name:"allowed",type:"uint256"},{internalType:"bytes32[]",name:"proof",type:"bytes32[]"}],name:"erc20PresaleMintTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"erc20Price",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"}],name:"erc20Revenue",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"erc20SaleActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"}],name:"erc20SetActiveCoin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"newMaxAmount",type:"uint256"},{internalType:"uint256",name:"newMaxPerMint",type:"uint256"},{internalType:"uint256",name:"newMaxPerWallet",type:"uint256"},{internalType:"uint256",name:"newPrice",type:"uint256"},{internalType:"bool",name:"presale",type:"bool"}],name:"erc20StartSale",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"erc20StopSale",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"}],name:"erc20Withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}],s="0x608060405234801561001057600080fd5b506119d2806100206000396000f3fe6080604052600436106100dd5760003560e01c8063b694460f1161007f578063d4461d5111610059578063d4461d51146102f4578063f0769c3314610307578063f673e0b71461031a578063fef8ddda1461033a57600080fd5b8063b694460f14610225578063c936b23c1461024a578063d1b022bd1461029f57600080fd5b806356da1506116100bb57806356da15061461017d5780637081ff9b1461019d578063abee801f146101b2578063afab9bb7146101f157600080fd5b806315d11e81146100e25780634adccde5146101045780634fb58bab14610147575b600080fd5b3480156100ee57600080fd5b506101026100fd366004611604565b61034f565b005b34801561011057600080fd5b507fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68aa545b6040519081526020015b60405180910390f35b34801561015357600080fd5b5060008051602061193d83398151915254610100900460ff165b604051901515815260200161013e565b34801561018957600080fd5b50610102610198366004611604565b6104b5565b3480156101a957600080fd5b506101346105a5565b3480156101be57600080fd5b5060008051602061195d833981519152546001600160a01b03165b6040516001600160a01b03909116815260200161013e565b3480156101fd57600080fd5b507fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68a954610134565b34801561023157600080fd5b5060008051602061193d8339815191525460ff1661016d565b34801561025657600080fd5b50610134610265366004611604565b6001600160a01b031660009081527fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68a6602052604090205490565b3480156102ab57600080fd5b506101d96102ba366004611621565b60009081527fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68a860205260409020546001600160a01b031690565b610102610302366004611656565b610658565b61010261031536600461168b565b61088b565b34801561032657600080fd5b50610102610335366004611738565b610b97565b34801561034657600080fd5b50610102610c4e565b600161035a81610c74565b6001600160a01b0382811660009081527fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68a7602052604090205460008051602061195d8339815191529116806103e95760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a590818dbdb9d1c9858dd60821b60448201526064015b60405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610430573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104549190611785565b9050600081116104925760405162461bcd60e51b8152602060048201526009602482015268302062616c616e636560b81b60448201526064016103e0565b6104ae61049d610caa565b6001600160a01b0384169083610cf0565b5050505050565b60026104c081610c74565b6001600160a01b0382811660009081527fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68a7602052604090205460008051602061195d8339815191529116610571576001600160a01b0383166000818152600283016020908152604080832080546001600160a01b03199081168617909155600486018054855260038701909352908320805490911690931790925581548592909161056a836117b4565b9190505550505b6001600160a01b03928316600090815260028201602052604090205481546001600160a01b03191693169290921790915550565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a5460408051630317c2dd60e01b81526001600482015281516000936201000090046001600160a01b031692849283928592630317c2dd92602480820193918290030181865afa15801561061d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064191906117cd565b909250905061065081836117f1565b935050505090565b8060008051602061197d8339815191526001600160401b0382166106ae5760405162461bcd60e51b815260206004820152600d60248201526c05175616e74697479206973203609c1b60448201526064016103e0565b8060040154826001600160401b031611156107035760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b60448201526064016103e0565b6000816003015411801561073557508060030154826001600160401b0316610729610d58565b61073391906117f1565b115b156107785760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b60448201526064016103e0565b60008051602061193d8339815191525460008051602061195d83398151915290610100900460ff16156107de5760405162461bcd60e51b815260206004820152600e60248201526d50726573616c652061637469766560901b60448201526064016103e0565b600681015460ff166108245760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b60448201526064016103e0565b7f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907d548461085087610da4565b61085a9190611804565b6001600160401b031611156108815760405162461bcd60e51b81526004016103e09061182b565b6104ae8486610de1565b8360008051602061197d8339815191526001600160401b0382166108e15760405162461bcd60e51b815260206004820152600d60248201526c05175616e74697479206973203609c1b60448201526064016103e0565b8060040154826001600160401b031611156109365760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b60448201526064016103e0565b6000816003015411801561096857508060030154826001600160401b031661095c610d58565b61096691906117f1565b115b156109ab5760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b60448201526064016103e0565b60008051602061197d83398151915260008051602061195d8339815191526000886109d58b610da4565b6109df9190611804565b6001600160401b031690508160060160019054906101000a900460ff16610a3d5760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b60448201526064016103e0565b8260010154600003610a835760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481b9bdd081cd95d608a1b60448201526064016103e0565b8260050154811115610aa75760405162461bcd60e51b81526004016103e09061182b565b87811115610ac75760405162461bcd60e51b81526004016103e09061182b565b610b4387878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050505060018501546040516bffffffffffffffffffffffff1960608f901b166020820152603481018c905260540160405160208183030381529060405280519060200120611057565b610b815760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481a5b9d985b1a59608a1b60448201526064016103e0565b610b8b898b610de1565b50505050505050505050565b6002610ba281610c74565b60008051602061195d833981519152805460008051602061197d833981519152906001600160a01b0316610c115760405162461bcd60e51b8152602060048201526016602482015275151bdad95b8810dbdb9d1c9858dd081b9bdd081cd95d60521b60448201526064016103e0565b6006820180549415156101000261ffff19909516949094176001179093556005908101939093555060038101949094556004840192909255910155565b6002610c5981610c74565b5060008051602061193d833981519152805461ffff19169055565b638b78c6d8600c5233600052806020600c205416610ca757638b78c6d819543314610ca7576382b429006000526004601cfd5b50565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5e546000906001600160a01b03163303610ceb575060131936013560601c90565b503390565b6040516001600160a01b038316602482015260448101829052610d5390849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261106d565b505050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c41547f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4054036000190190565b6001600160a01b031660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45602052604090205460c01c90565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a547fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68aa5460008051602061195d833981519152916201000090046001600160a01b031690600090610e5c906001600160401b03871690611862565b604051630317c2dd60e01b81526001600160401b038716600482015290915060009081906001600160a01b03851690630317c2dd906024016040805180830381865afa158015610eb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed491906117cd565b909250905034610ee482846117f1565b1115610f245760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b60448201526064016103e0565b610f2e8483611142565b8015610f9f57610f9f306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f999190611879565b82611142565b84546001600160a01b03908116600090815260018701602052604090208054850190558554610fd1911687308661125b565b61103b8688610fdf89610da4565b610fe99190611804565b6001600160a01b039190911660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c456020526040902080546001600160c01b031660c09290921b919091179055565b61104e86886001600160401b0316611299565b50505050505050565b60008261106485846113d4565b14949350505050565b60006110c2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114239092919063ffffffff16565b90508051600014806110e35750808060200190518101906110e39190611896565b610d535760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103e0565b804710156111925760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016103e0565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146111df576040519150601f19603f3d011682016040523d82523d6000602084013e6111e4565b606091505b5050905080610d535760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016103e0565b6040516001600160a01b03808516602483015283166044820152606481018290526112939085906323b872dd60e01b90608401610d1c565b50505050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405460008290036112d4576112d463b562e8dd60e01b61143a565b60008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602090815260408083206001600160a01b0387164260a01b6001881460e11b1781179091558084527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45909252822080546801000000000000000186020190559081900361137057611370622e076360e81b61143a565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a481816001019150810361137557507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405550505050565b600081815b845181101561141957611405828683815181106113f8576113f86118b3565b6020026020010151611444565b915080611411816117b4565b9150506113d9565b5090505b92915050565b60606114328484600085611476565b949350505050565b8060005260046000fd5b600081831061146057600082815260208490526040902061146f565b60008381526020839052604090205b9392505050565b6060824710156114d75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103e0565b600080866001600160a01b031685876040516114f391906118ed565b60006040518083038185875af1925050503d8060008114611530576040519150601f19603f3d011682016040523d82523d6000602084013e611535565b606091505b509150915061154687838387611551565b979650505050505050565b606083156115c05782516000036115b9576001600160a01b0385163b6115b95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103e0565b5081611432565b61143283838151156115d55781518083602001fd5b8060405162461bcd60e51b81526004016103e09190611909565b6001600160a01b0381168114610ca757600080fd5b60006020828403121561161657600080fd5b813561146f816115ef565b60006020828403121561163357600080fd5b5035919050565b80356001600160401b038116811461165157600080fd5b919050565b6000806040838503121561166957600080fd5b8235611674816115ef565b91506116826020840161163a565b90509250929050565b6000806000806000608086880312156116a357600080fd5b85356116ae816115ef565b94506116bc6020870161163a565b93506040860135925060608601356001600160401b03808211156116df57600080fd5b818801915088601f8301126116f357600080fd5b81358181111561170257600080fd5b8960208260051b850101111561171757600080fd5b9699959850939650602001949392505050565b8015158114610ca757600080fd5b600080600080600060a0868803121561175057600080fd5b8535945060208601359350604086013592506060860135915060808601356117778161172a565b809150509295509295909350565b60006020828403121561179757600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000600182016117c6576117c661179e565b5060010190565b600080604083850312156117e057600080fd5b505080516020909101519092909150565b8082018082111561141d5761141d61179e565b6001600160401b038181168382160190808211156118245761182461179e565b5092915050565b60208082526017908201527f4578636565646564206d6178207065722077616c6c6574000000000000000000604082015260600190565b808202811582820484141761141d5761141d61179e565b60006020828403121561188b57600080fd5b815161146f816115ef565b6000602082840312156118a857600080fd5b815161146f8161172a565b634e487b7160e01b600052603260045260246000fd5b60005b838110156118e45781810151838201526020016118cc565b50506000910152565b600082516118ff8184602087016118c9565b9190910192915050565b60208152600082518060208401526119288160408501602087016118c9565b601f01601f1916919091016040019291505056feef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68abef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68a58463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b381569078a26469706673582212204ecf113b072f424189c1f34398dfb9b7c697c88536ce7d43c2576b950ae8141f64736f6c63430008130033";t.ERC20AppFacet__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},742:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERC20AppFacet__factory=void 0;var n=r(501);Object.defineProperty(t,"ERC20AppFacet__factory",{enumerable:!0,get:function(){return n.ERC20AppFacet__factory}})},744:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BaseFacet__factory=void 0;var o=r(391),a=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ApprovalCallerNotOwnerNorApproved",type:"error"},{inputs:[],name:"ApprovalQueryForNonexistentToken",type:"error"},{inputs:[],name:"BalanceQueryForZeroAddress",type:"error"},{inputs:[{internalType:"address",name:"_initializationContractAddress",type:"address"},{internalType:"bytes",name:"_calldata",type:"bytes"}],name:"InitializationFunctionReverted",type:"error"},{inputs:[],name:"MintERC2309QuantityExceedsLimit",type:"error"},{inputs:[],name:"MintToZeroAddress",type:"error"},{inputs:[],name:"MintZeroQuantity",type:"error"},{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"OwnerQueryForNonexistentToken",type:"error"},{inputs:[],name:"OwnershipNotInitializedForExtraData",type:"error"},{inputs:[],name:"TransferCallerNotOwnerNorApproved",type:"error"},{inputs:[],name:"TransferFromIncorrectOwner",type:"error"},{inputs:[],name:"TransferToNonERC721ReceiverImplementer",type:"error"},{inputs:[],name:"TransferToZeroAddress",type:"error"},{inputs:[],name:"URIQueryForNonexistentToken",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{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:"uint256",name:"fromTokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"toTokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"ConsecutiveTransfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"uint256",name:"roles",type:"uint256"}],name:"RolesUpdated",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:"owner_",type:"address"},{internalType:"address",name:"admin_",type:"address"},{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"address",name:"royalty_",type:"address"},{internalType:"uint16",name:"royaltyBps_",type:"uint16"}],name:"_initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"_functionSelector",type:"bytes4"}],name:"facetAddress",outputs:[{internalType:"address",name:"facetAddress_",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"facetAddresses",outputs:[{internalType:"address[]",name:"facetAddresses_",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_facet",type:"address"}],name:"facetFunctionSelectors",outputs:[{internalType:"bytes4[]",name:"_facetFunctionSelectors",type:"bytes4[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"facets",outputs:[{components:[{internalType:"address",name:"facetAddress",type:"address"},{internalType:"bytes4[]",name:"functionSelectors",type:"bytes4[]"}],internalType:"struct IDiamondLoupe.Facet[]",name:"facets_",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"name",type:"bytes32"}],name:"getApp",outputs:[{components:[{internalType:"address",name:"implementation",type:"address"},{internalType:"bytes4",name:"interfaceId",type:"bytes4"},{internalType:"bytes4[]",name:"selectors",type:"bytes4[]"},{internalType:"uint8",name:"version",type:"uint8"}],internalType:"struct INiftyKitAppRegistry.App",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getMintSigner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"roles",type:"uint256"}],name:"grantRoles",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"bytes",name:"data",type:"bytes"}],name:"installApp",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"name",type:"bytes32"}],name:"installApp",outputs:[],stateMutability:"nonpayable",type:"function"},{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:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"result",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"name",type:"bytes32"}],name:"removeApp",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"bytes",name:"data",type:"bytes"}],name:"removeApp",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"roles",type:"uint256"}],name:"renounceRoles",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"roles",type:"uint256"}],name:"revokeRoles",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"rolesOf",outputs:[{internalType:"uint256",name:"roles",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"salePrice",type:"uint256"}],name:"royaltyInfo",outputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",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:"payable",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:"payable",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:"newBaseURI",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"signer_",type:"address"}],name:"setMintSigner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newTreasury",type:"address"}],name:"setTreasury",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"trustedForwarder",type:"address"}],name:"setTrustedForwarder",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:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",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:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"treasury",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}],s="0x60806040523480156200001157600080fd5b506000805160206200474183398151915254610100900460ff166200004b57600080516020620047418339815191525460ff16156200004f565b303b155b620000c65760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a6564000000000000000000606482015260840160405180910390fd5b6000805160206200474183398151915254610100900460ff16158015620001055760008051602062004741833981519152805461ffff19166101011790555b8015620001265760008051602062004741833981519152805461ff00191690555b5061460a80620001376000396000f3fe6080604052600436106102305760003560e01c806361d027b31161012e578063adfca15e116100ab578063da7422281161006f578063da742228146106b3578063e84a9728146106d3578063e985e9c5146106f3578063f0f4426014610713578063f2fde38b1461073357600080fd5b8063adfca15e146105ec578063b88d4fde14610619578063c00cf3ab1461062c578063c87b56dd1461064c578063cdffacc61461066c57600080fd5b80637a0ed627116100f25780637a0ed6271461055c5780638aebc3531461057e5780638da5cb5b1461059e57806395d89b41146105b7578063a22cb465146105cc57600080fd5b806361d027b3146104ea5780636352211e146104ff57806370a082311461051f578063715018a61461053f57806373e996531461054757600080fd5b806323b872dd116101bc57806342842e0e1161018057806342842e0e1461045557806342c71f1d146104685780634a4ee7b11461049557806352ef6b2c146104a857806355f804b3146104ca57600080fd5b806323b872dd1461039b5780632a55205a146103ae5780632de94807146103ed5780632fa8374b146104205780633ccfd60b1461044057600080fd5b806318160ddd1161020357806318160ddd14610312578063183a4f6e146103355780631c10893f146103485780631f1bf78b1461035b5780632099ba841461037b57600080fd5b806301ffc9a71461023557806306fdde03146102a3578063081812fc146102c5578063095ea7b3146102fd575b600080fd5b34801561024157600080fd5b5061028e610250366004613967565b6001600160e01b03191660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f602052604090205460ff1690565b60405190151581526020015b60405180910390f35b3480156102af57600080fd5b506102b8610746565b60405161029a91906139db565b3480156102d157600080fd5b506102e56102e03660046139ee565b6107e1565b6040516001600160a01b03909116815260200161029a565b61031061030b366004613a1c565b61082e565b005b34801561031e57600080fd5b5061032761093e565b60405190815260200161029a565b6103106103433660046139ee565b61095e565b610310610356366004613a1c565b61096b565b34801561036757600080fd5b506103106103763660046139ee565b610981565b34801561038757600080fd5b50610310610396366004613b2d565b6109a7565b6103106103a9366004613b73565b6109c2565b3480156103ba57600080fd5b506103ce6103c9366004613bb4565b610adb565b604080516001600160a01b03909316835260208301919091520161029a565b3480156103f957600080fd5b50610327610408366004613bd6565b638b78c6d8600c908152600091909152602090205490565b34801561042c57600080fd5b5061031061043b3660046139ee565b610af4565b34801561044c57600080fd5b50610310610b1a565b610310610463366004613b73565b610b83565b34801561047457600080fd5b506104886104833660046139ee565b610c92565b60405161029a9190613c38565b6103106104a3366004613a1c565b610d92565b3480156104b457600080fd5b506104bd610da4565b60405161029a9190613c95565b3480156104d657600080fd5b506103106104e5366004613ce2565b610f55565b3480156104f657600080fd5b506102e5610f77565b34801561050b57600080fd5b506102e561051a3660046139ee565b610f93565b34801561052b57600080fd5b5061032761053a366004613bd6565b610fa4565b61031061100c565b34801561055357600080fd5b506102e5611020565b34801561056857600080fd5b5061057161103c565b60405161029a9190613d2a565b34801561058a57600080fd5b50610310610599366004613b2d565b611475565b3480156105aa57600080fd5b50638b78c6d819546102e5565b3480156105c357600080fd5b506102b861148b565b3480156105d857600080fd5b506103106105e7366004613da7565b6114a3565b3480156105f857600080fd5b5061060c610607366004613bd6565b6115a1565b60405161029a9190613de5565b610310610627366004613df8565b611700565b34801561063857600080fd5b50610310610647366004613ea4565b61181b565b34801561065857600080fd5b506102b86106673660046139ee565b611a97565b34801561067857600080fd5b506102e5610687366004613967565b6001600160e01b0319166000908152600080516020614501833981519152602052604090205460601c90565b3480156106bf57600080fd5b506103106106ce366004613bd6565b611bf9565b3480156106df57600080fd5b506103106106ee366004613bd6565b611c32565b3480156106ff57600080fd5b5061028e61070e366004613f65565b611c6b565b34801561071f57600080fd5b5061031061072e366004613bd6565b611ccd565b610310610741366004613bd6565b611d06565b6060610750611d2d565b600201805461075e90613f93565b80601f016020809104026020016040519081016040528092919081815260200182805461078a90613f93565b80156107d75780601f106107ac576101008083540402835291602001916107d7565b820191906000526020600020905b8154815290600101906020018083116107ba57829003601f168201915b5050505050905090565b60006107ec82611d51565b610809576040516333d1c03960e21b815260040160405180910390fd5b610811611d2d565b60009283526006016020525060409020546001600160a01b031690565b8181600061083a611d9a565b6004810154909150610100900460ff16600281600281111561085e5761085e613fc7565b14806108c65750600181600281111561087957610879613fc7565b1480156108a157506001600160a01b038416600090815260018301602052604090205460ff16155b80156108c657506108b0611dbe565b6001600160a01b0316846001600160a01b031614155b806108e15750600083815260028301602052604090205460ff165b156109075760405162461bcd60e51b81526004016108fe90613fdd565b60405180910390fd5b8561091181611de0565b61092b5761091d611e0f565b1561092b5761092b81611e25565b6109358787611e69565b50505050505050565b6000600161094a611d2d565b60010154610956611d2d565b540303919050565b6109683382611e75565b50565b610973611ec4565b61097d8282611edf565b5050565b600161098c81611f2a565b61097d82600060405180602001604052806000815250611f5d565b60016109b281611f2a565b6109bd8330846121ac565b505050565b828160006109ce611d9a565b6004810154909150610100900460ff1660028160028111156109f2576109f2613fc7565b1480610a5a57506001816002811115610a0d57610a0d613fc7565b148015610a3557506001600160a01b038416600090815260018301602052604090205460ff16155b8015610a5a5750610a44611dbe565b6001600160a01b0316846001600160a01b031614155b80610a755750600083815260028301602052604090205460ff165b15610a925760405162461bcd60e51b81526004016108fe90613fdd565b866001600160a01b0381163314610ac657610aac33611de0565b610ac657610ab8611e0f565b15610ac657610ac633611e25565b610ad1888888612454565b5050505050505050565b600080610ae8848461264e565b915091505b9250929050565b6001610aff81611f2a565b61097d826000604051806020016040528060008152506121ac565b6001610b2581611f2a565b6000610b2f611d9a565b90504780610b6b5760405162461bcd60e51b8152602060048201526009602482015268302062616c616e636560b81b60448201526064016108fe565b60058201546109bd906001600160a01b03168261268e565b82816000610b8f611d9a565b6004810154909150610100900460ff166002816002811115610bb357610bb3613fc7565b1480610c1b57506001816002811115610bce57610bce613fc7565b148015610bf657506001600160a01b038416600090815260018301602052604090205460ff16155b8015610c1b5750610c05611dbe565b6001600160a01b0316846001600160a01b031614155b80610c365750600083815260028301602052604090205460ff165b15610c535760405162461bcd60e51b81526004016108fe90613fdd565b866001600160a01b0381163314610c8757610c6d33611de0565b610c8757610c79611e0f565b15610c8757610c8733611e25565b610ad18888886127a7565b60408051608081018252600080825260208201819052606092820183905291810191909152610cbf611d9a565b60008381526020918252604090819020815160808101835281546001600160a01b0381168252600160a01b900460e01b6001600160e01b03191681850152600182018054845181870281018701865281815292959394860193830182828015610d7457602002820191906000526020600020906000905b82829054906101000a900460e01b6001600160e01b03191681526020019060040190602082600301049283019260010382029150808411610d365790505b50505091835250506002919091015460ff1660209091015292915050565b610d9a611ec4565b61097d8282611e75565b60008051602061456d833981519152546060906000805160206145018339815191529061ffff166001600160401b03811115610de257610de2613a48565b604051908082528060200260200182016040528015610e0b578160200160208202803683370190505b50915060008060005b600284015461ffff16821015610f4d576000818152600185016020526040812054905b6008811015610f385783610e4a81614022565b600288015490955061ffff1685119050610f3857600581901b82901b6001600160e01b0319811660009081526020889052604081205460601c90805b88811015610edb578a8181518110610ea057610ea061403b565b60200260200101516001600160a01b0316836001600160a01b031603610ec95760019150610edb565b80610ed381614022565b915050610e86565b508015610eea57505050610f26565b818a8981518110610efd57610efd61403b565b6001600160a01b039092166020928302919091019091015287610f1f81614022565b9850505050505b80610f3081614022565b915050610e37565b50508080610f4590614022565b915050610e14565b505082525090565b6002610f6081611f2a565b81610f69611d9a565b600601906109bd9082614097565b6000610f81611d9a565b600501546001600160a01b0316919050565b6000610f9e826127c2565b92915050565b60006001600160a01b038216610fcd576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b03610fdd611d2d565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b611014611ec4565b61101e600061286f565b565b600061102a611d9a565b600701546001600160a01b0316919050565b60008051602061456d833981519152546060906000805160206145018339815191529061ffff166001600160401b0381111561107a5761107a613a48565b6040519080825280602002602001820160405280156110c057816020015b6040805180820190915260008152606060208201528152602001906001900390816110985790505b50600282015490925060009061ffff166001600160401b038111156110e7576110e7613a48565b604051908082528060200260200182016040528015611110578160200160208202803683370190505b50905060008060005b600285015461ffff16821015611402576000818152600186016020526040812054905b60088110156113ed578361114f81614022565b600289015490955061ffff16851190506113ed57600581901b82901b6001600160e01b0319811660009081526020899052604081205460601c90805b888110156112ab57826001600160a01b03168c82815181106111af576111af61403b565b6020026020010151600001516001600160a01b03160361129957838c82815181106111dc576111dc61403b565b6020026020010151602001518b83815181106111fa576111fa61403b565b602002602001015161ffff16815181106112165761121661403b565b60200260200101906001600160e01b03191690816001600160e01b0319168152505060ff8a828151811061124c5761124c61403b565b602002602001015161ffff161061126257600080fd5b8981815181106112745761127461403b565b60200260200101805180919061128990614156565b61ffff16905250600191506112ab565b806112a381614022565b91505061118b565b5080156112ba575050506113db565b818b89815181106112cd576112cd61403b565b60209081029190910101516001600160a01b03909116905260028a015461ffff166001600160401b0381111561130557611305613a48565b60405190808252806020026020018201604052801561132e578160200160208202803683370190505b508b89815181106113415761134161403b565b602002602001015160200181905250828b89815181106113635761136361403b565b6020026020010151602001516000815181106113815761138161403b565b60200260200101906001600160e01b03191690816001600160e01b0319168152505060018989815181106113b7576113b761403b565b61ffff90921660209283029190910190910152876113d481614022565b9850505050505b806113e581614022565b91505061113c565b505080806113fa90614022565b915050611119565b5060005b8281101561146a5760008482815181106114225761142261403b565b602002602001015161ffff16905060008783815181106114445761144461403b565b60200260200101516020015190508181525050808061146290614022565b915050611406565b508185525050505090565b600161148081611f2a565b6109bd833084611f5d565b6060611495611d2d565b600301805461075e90613f93565b816000806114af611d9a565b6004810154909150610100900460ff1660028160028111156114d3576114d3613fc7565b148061153b575060018160028111156114ee576114ee613fc7565b14801561151657506001600160a01b038416600090815260018301602052604090205460ff16155b801561153b5750611525611dbe565b6001600160a01b0316846001600160a01b031614155b806115565750600083815260028301602052604090205460ff165b156115735760405162461bcd60e51b81526004016108fe90613fdd565b8561157d81611de0565b61159757611589611e0f565b156115975761159781611e25565b61093587876128ad565b60008051602061456d833981519152546060906000805160206145018339815191529060009061ffff166001600160401b038111156115e2576115e2613a48565b60405190808252806020026020018201604052801561160b578160200160208202803683370190505b5092506000805b600284015461ffff168210156116f6576000818152600185016020526040812054905b60088110156116e1578361164881614022565b600288015490955061ffff16851190506116e157600581901b82901b6001600160e01b0319811660009081526020889052604090205460601c6001600160a01b038a168190036116cc57818988815181106116a5576116a561403b565b6001600160e01b031990921660209283029190910190910152866116c881614022565b9750505b505080806116d990614022565b915050611635565b505080806116ee90614022565b915050611612565b5050825250919050565b8382600061170c611d9a565b6004810154909150610100900460ff16600281600281111561173057611730613fc7565b14806117985750600181600281111561174b5761174b613fc7565b14801561177357506001600160a01b038416600090815260018301602052604090205460ff16155b80156117985750611782611dbe565b6001600160a01b0316846001600160a01b031614155b806117b35750600083815260028301602052604090205460ff165b156117d05760405162461bcd60e51b81526004016108fe90613fdd565b876001600160a01b0381163314611804576117ea33611de0565b611804576117f6611e0f565b156118045761180433611e25565b6118108989898961294f565b505050505050505050565b6000805160206145b583398151915254610100900460ff16611850576000805160206145b58339815191525460ff1615611854565b303b155b6118c65760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a656400000000000000000060648201526084016108fe565b6000805160206145b583398151915254610100900460ff16158015611902576000805160206145b5833981519152805461ffff19166101011790555b61197587878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b01819004810282018101909252898152925089915088908190840183828082843760009201919091525061299992505050565b61197e896129d7565b611986612a13565b6000611990611d9a565b7ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b2820805461ffff191661ffff86161790557ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b282280546001600160a01b0319166001600160a01b038781169190911790915560048201805460ff191660011790559091507ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b281f908a1615611a6c576007820180546001600160a01b0319166001600160a01b038c16179055611a6c8a611a6760026001614177565b611edf565b505080156118105750506000805160206145b5833981519152805461ff001916905550505050505050565b6060611aa282611d51565b611abf57604051630a14c4b560e41b815260040160405180910390fd5b6000611ac9611d9a565b600084815260039190910160209081526040918290208251808401909352805460ff16151583526001810180549192840191611b0490613f93565b80601f0160208091040260200160405190810160405280929190818152602001828054611b3090613f93565b8015611b7d5780601f10611b5257610100808354040283529160200191611b7d565b820191906000526020600020905b815481529060010190602001808311611b6057829003601f168201915b5050505050815250509050806000015115611b9c576020015192915050565b6000611ba6612a32565b90508051600003611bc65760405180602001604052806000815250611bf1565b80611bd085612a4a565b604051602001611be192919061418a565b6040516020818303038152906040525b949350505050565b6001611c0481611f2a565b81611c0d611d9a565b60080180546001600160a01b0319166001600160a01b03929092169190911790555050565b6001611c3d81611f2a565b81611c46611d9a565b60070180546001600160a01b0319166001600160a01b03929092169190911790555050565b600080611c76611d9a565b905060016004820154610100900460ff166002811115611c9857611c98613fc7565b03611cc3576001600160a01b03831660009081526001909101602052604090205460ff169050610f9e565b611bf18484612a8e565b6001611cd881611f2a565b81611ce1611d9a565b60050180546001600160a01b0319166001600160a01b03929092169190911790555050565b611d0e611ec4565b8060601b611d2457637448fbae6000526004601cfd5b6109688161286f565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b600081600111158015611d6b5750611d67611d2d565b5482105b8015610f9e5750600160e01b611d7f611d2d565b60008481526004919091016020526040902054161592915050565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5690565b6000611dc933612acb565b15611ddb575060131936013560601c90565b503390565b6000611dea611d9a565b6001600160a01b03909216600090815260019290920160205250604090205460ff1690565b6000611e19611d9a565b6004015460ff16919050565b69c617113400112233445560005230601a5280603a52600080604460166daaeb6d7670e522a718067333cd4e5afa611e61573d6000803e3d6000fd5b6000603a5250565b61097d82826001612af3565b638b78c6d8600c52816000526020600c20805482811681189250508181555080600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a35050565b638b78c6d81954331461101e576382b429006000526004601cfd5b638b78c6d8600c52816000526020600c208181541791508181555080600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a35050565b638b78c6d8600c5233600052806020600c20541661096857638b78c6d819543314610968576382b429006000526004601cfd5b6000611f67611d9a565b600085815260208281526040808320815160808101835281546001600160a01b0381168252600160a01b900460e01b6001600160e01b031916818501526001820180548451818702810187018652818152979850600080516020614501833981519152979295939486019383018282801561202e57602002820191906000526020600020906000905b82829054906101000a900460e01b6001600160e01b03191681526020019060040190602082600301049283019260010382029150808411611ff05790505b50505091835250506002919091015460ff9081166020909201919091526060820151919250166120955760405162461bcd60e51b8152602060048201526012602482015271105c1c08191bd95cc81b9bdd08195e1a5cdd60721b60448201526064016108fe565b604080516001808252818301909252600091816020015b604080516060808201835260008083526020830152918101919091528152602001906001900390816120ac5790505060408051606081019091526000815290915060208101600281526020018360400151815250816000815181106121135761211361403b565b602090810291909101810191909152828101516001600160e01b03191660009081526003850190915260409020805460ff191690556121528686612bba565b61216d81600060405180602001604052806000815250612c80565b600087815260208590526040812080546001600160c01b031916815590612197600183018261386b565b50600201805460ff1916905550505050505050565b60006121b6611d9a565b90506000600080516020614501833981519152905060008260040160029054906101000a90046001600160a01b03166001600160a01b031663bb4fceb96040518163ffffffff1660e01b81526004016020604051808303816000875af1158015612224573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061224891906141b9565b6040516342c71f1d60e01b8152600481018890529091506000906001600160a01b038316906342c71f1d90602401600060405180830381865afa158015612293573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122bb91908101906141e7565b90506000816060015160ff16116123095760405162461bcd60e51b8152602060048201526012602482015271105c1c08191bd95cc81b9bdd08195e1a5cdd60721b60448201526064016108fe565b604080516001808252818301909252600091816020015b6040805160608082018352600080835260208301529181019190915281526020019060019003908161232057905050604080516060810190915283516001600160a01b0316815290915060208101600081526020018360400151815250816000815181106123905761239061403b565b602090810291909101810191909152828101516001600160e01b03191660009081526003860190915260409020805460ff191660011790556123d3818888612c80565b60008881526020868152604091829020845181548387015160e01c600160a01b026001600160c01b03199091166001600160a01b039092169190911717815591840151805185939261242c926001850192910190613890565b50606091909101516002909101805460ff191660ff9092169190911790555050505050505050565b600061245f826127c2565b9050836001600160a01b0316816001600160a01b0316146124925760405162a1148160e81b815260040160405180910390fd5b60008061249e84612dcb565b915091506124c481876124af611dbe565b6001600160a01b039081169116811491141790565b6124f1576124d48661070e611dbe565b6124f157604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661251857604051633a954ecd60e21b815260040160405180910390fd5b801561252357600082555b61252b611d2d565b6001600160a01b0387166000908152600591909101602052604090208054600019019055612557611d2d565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b1761258e611d2d565b60008681526004919091016020526040812091909155600160e11b8416900361260457600184016125bd611d2d565b600082815260049190910160205260408120549003612602576125de611d2d565b54811461260257836125ee611d2d565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b600080600061265c85612df3565b61ffff16905061266b85612e41565b61271061267886846142f9565b6126829190614310565b92509250509250929050565b804710156126de5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016108fe565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461272b576040519150601f19603f3d011682016040523d82523d6000602084013e612730565b606091505b50509050806109bd5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016108fe565b6109bd83838360405180602001604052806000815250611700565b600081600111612856576127d4611d2d565b600083815260049190910160205260408120549150600160e01b82169003612856578060000361285157612806611d2d565b54821061282657604051636f96cda160e11b815260040160405180910390fd5b61282e611d2d565b600019909201600081815260049390930160205260409092205490508015612826575b919050565b604051636f96cda160e11b815260040160405180910390fd5b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a355565b806128b6611d2d565b60070160006128c3611dbe565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155612907611dbe565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051612943911515815260200190565b60405180910390a35050565b61295a8484846109c2565b6001600160a01b0383163b156129935761297684848484612eb1565b612993576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6000805160206145b583398151915254610100900460ff166129cd5760405162461bcd60e51b81526004016108fe90614332565b61097d8282612fa2565b6001600160a01b0316638b78c6d8198190558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b61101e733cc6cdda760b79bafa08df41ecfa224f810dceb66001613015565b6060612a3c611d9a565b600601805461075e90613f93565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480612a645750819003601f19909101908152919050565b6000612a98611d2d565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b6000816001600160a01b0316612adf611d9a565b600801546001600160a01b03161492915050565b6000612afe83610f93565b90508115612b4f57806001600160a01b0316612b18611dbe565b6001600160a01b031614612b4f57612b328161070e611dbe565b612b4f576040516367d9dca160e11b815260040160405180910390fd5b83612b58611d2d565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b6001600160a01b038216612bcc575050565b612bee826040518060600160405280602881526020016145456028913961308a565b600080836001600160a01b031683604051612c099190614386565b600060405180830381855af49150503d8060008114612c44576040519150601f19603f3d011682016040523d82523d6000602084013e612c49565b606091505b50915091508161299357805115612c635780518082602001fd5b838360405163192105d760e01b81526004016108fe9291906143a2565b60008051602061456d833981519152546000805160206145018339815191529061ffff811690819060009060071615612ccb5750600381901c60009081526001840160205260409020545b60005b8751811015612d4857612d3b83838a8481518110612cee57612cee61403b565b6020026020010151600001518b8581518110612d0c57612d0c61403b565b6020026020010151602001518c8681518110612d2a57612d2a61403b565b6020026020010151604001516130ab565b9093509150600101612cce565b50828214612d645760028401805461ffff191661ffff84161790555b6007821615612d8657600382901c600090815260018501602052604090208190555b7f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673878787604051612db9939291906143c6565b60405180910390a16109358686612bba565b6000806000612dd8611d2d565b60009485526006016020525050604090912080549092909150565b60008181527ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b281f6020819052604082205461ffff1691829003612e3b57600181015461ffff1691505b50919050565b60008181527ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b282160205260409020546001600160a01b03167ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b281f81612e3b57600301546001600160a01b031692915050565b6000836001600160a01b031663150b7a02612eca611dbe565b8786866040518563ffffffff1660e01b8152600401612eec949392919061448f565b6020604051808303816000875af1925050508015612f27575060408051601f3d908101601f19168201909252612f24918101906144cc565b60015b612f85573d808015612f55576040519150601f19603f3d011682016040523d82523d6000602084013e612f5a565b606091505b508051600003612f7d576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6000805160206145b583398151915254610100900460ff16612fd65760405162461bcd60e51b81526004016108fe90614332565b81612fdf611d2d565b60020190612fed9082614097565b5080612ff7611d2d565b600301906130059082614097565b506001613010611d2d565b555050565b6001600160a01b0390911690637d3e3dbe81613042578261303b5750634420e486613042565b5063a0af29035b8060e01b60005230600452826024526004600060446000806daaeb6d7670e522a718067333cd4e5af1613080578060005160e01c0361308057600080fd5b5060006024525050565b813b81816129935760405162461bcd60e51b81526004016108fe91906139db565b60008080600080516020614501833981519152905060008451116131255760405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201526a1858d95d081d1bc818dd5d60aa1b60648201526084016108fe565b600085600281111561313957613139613fc7565b0361329f57613160866040518060600160405280602481526020016145216024913961308a565b60005b84518110156132995760008582815181106131805761318061403b565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c156132195760405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f6044820152746e207468617420616c72656164792065786973747360581b60648201526084016108fe565b6001600160e01b031980831660008181526020879052604090206001600160601b031960608d901b168e17905560e060058e901b811692831c199c909c1690821c179a81900361327d5760038c901c600090815260018601602052604081209b909b555b8b61328781614022565b9c505060019093019250613163915050565b5061385f565b60018560028111156132b3576132b3613fc7565b036134d8576132da8660405180606001604052806028815260200161458d6028913961308a565b60005b84518110156132995760008582815181106132fa576132fa61403b565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c30810361338f5760405162461bcd60e51b815260206004820152602f60248201527f4c69624469616d6f6e644375743a2043616e2774207265706c61636520696d6d60448201526e3aba30b1363290333ab731ba34b7b760891b60648201526084016108fe565b896001600160a01b0316816001600160a01b0316036134165760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e000000000000000060648201526084016108fe565b6001600160a01b0381166134925760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e207468617420646f65736e2774206578697374000000000000000060648201526084016108fe565b506001600160e01b031990911660009081526020849052604090206bffffffffffffffffffffffff919091166001600160601b031960608a901b161790556001016132dd565b60028560028111156134ec576134ec613fc7565b03613807576001600160a01b038616156135675760405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f76652066616365742061646472604482015275657373206d757374206265206164647265737328302960501b60648201526084016108fe565b600388901c6007891660005b86518110156137e75760008a90036135af578261358f816144e9565b60008181526001870160205260409020549b509350600792506135bd9050565b816135b9816144e9565b9250505b6000806000808a85815181106135d5576135d561403b565b6020908102919091018101516001600160e01b031981166000908152918a9052604090912054909150606081901c6136755760405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e277420657869737400000000000000000060648201526084016108fe565b30606082901c036136df5760405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201526d3a30b1363290333ab731ba34b7b760911b60648201526084016108fe565b600587901b8f901b94506001600160e01b031980861690831614613735576001600160e01b03198516600090815260208a90526040902080546001600160601b0319166bffffffffffffffffffffffff83161790555b6001600160e01b031991909116600090815260208990526040812055600381901c611fff16925060051b60e016905085821461379a576000828152600188016020526040902080546001600160e01b031980841c19909116908516831c1790556137be565b80836001600160e01b031916901c816001600160e01b031960001b901c198e16179c505b846000036137dc57600086815260018801602052604081208190559c505b505050600101613573565b50806137f48360086142f9565b6137fe9190614177565b9950505061385f565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f727265637420466163657443756044820152663a20b1ba34b7b760c91b60648201526084016108fe565b50959694955050505050565b508054600082556007016008900490600052602060002090810190610968919061393c565b8280548282559060005260206000209060070160089004810192821561392c5791602002820160005b838211156138fa57835183826101000a81548163ffffffff021916908360e01c021790555092602001926004016020816003010492830192600103026138b9565b801561392a5782816101000a81549063ffffffff02191690556004016020816003010492830192600103026138fa565b505b5061393892915061393c565b5090565b5b80821115613938576000815560010161393d565b6001600160e01b03198116811461096857600080fd5b60006020828403121561397957600080fd5b813561398481613951565b9392505050565b60005b838110156139a657818101518382015260200161398e565b50506000910152565b600081518084526139c781602086016020860161398b565b601f01601f19169290920160200192915050565b60208152600061398460208301846139af565b600060208284031215613a0057600080fd5b5035919050565b6001600160a01b038116811461096857600080fd5b60008060408385031215613a2f57600080fd5b8235613a3a81613a07565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715613a8057613a80613a48565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613aae57613aae613a48565b604052919050565b60006001600160401b03831115613acf57613acf613a48565b613ae2601f8401601f1916602001613a86565b9050828152838383011115613af657600080fd5b828260208301376000602084830101529392505050565b600082601f830112613b1e57600080fd5b61398483833560208501613ab6565b60008060408385031215613b4057600080fd5b8235915060208301356001600160401b03811115613b5d57600080fd5b613b6985828601613b0d565b9150509250929050565b600080600060608486031215613b8857600080fd5b8335613b9381613a07565b92506020840135613ba381613a07565b929592945050506040919091013590565b60008060408385031215613bc757600080fd5b50508035926020909101359150565b600060208284031215613be857600080fd5b813561398481613a07565b600081518084526020808501945080840160005b83811015613c2d5781516001600160e01b03191687529582019590820190600101613c07565b509495945050505050565b602080825282516001600160a01b0316828201528201516001600160e01b03191660408083019190915282015160806060830152600090613c7c60a0840182613bf3565b905060ff60608501511660808401528091505092915050565b6020808252825182820181905260009190848201906040850190845b81811015613cd65783516001600160a01b031683529284019291840191600101613cb1565b50909695505050505050565b600060208284031215613cf457600080fd5b81356001600160401b03811115613d0a57600080fd5b8201601f81018413613d1b57600080fd5b611bf184823560208401613ab6565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015613d9957888303603f19018552815180516001600160a01b03168452870151878401879052613d8687850182613bf3565b9588019593505090860190600101613d51565b509098975050505050505050565b60008060408385031215613dba57600080fd5b8235613dc581613a07565b915060208301358015158114613dda57600080fd5b809150509250929050565b6020815260006139846020830184613bf3565b60008060008060808587031215613e0e57600080fd5b8435613e1981613a07565b93506020850135613e2981613a07565b92506040850135915060608501356001600160401b03811115613e4b57600080fd5b613e5787828801613b0d565b91505092959194509250565b60008083601f840112613e7557600080fd5b5081356001600160401b03811115613e8c57600080fd5b602083019150836020828501011115610aed57600080fd5b60008060008060008060008060c0898b031215613ec057600080fd5b8835613ecb81613a07565b97506020890135613edb81613a07565b965060408901356001600160401b0380821115613ef757600080fd5b613f038c838d01613e63565b909850965060608b0135915080821115613f1c57600080fd5b50613f298b828c01613e63565b9095509350506080890135613f3d81613a07565b915060a089013561ffff81168114613f5457600080fd5b809150509295985092959890939650565b60008060408385031215613f7857600080fd5b8235613f8381613a07565b91506020830135613dda81613a07565b600181811c90821680613fa757607f821691505b602082108103612e3b57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b602080825260159082015274151c985b9cd9995c9cc81b9bdd08185b1b1bddd959605a1b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000600182016140345761403461400c565b5060010190565b634e487b7160e01b600052603260045260246000fd5b601f8211156109bd57600081815260208120601f850160051c810160208610156140785750805b601f850160051c820191505b8181101561264657828155600101614084565b81516001600160401b038111156140b0576140b0613a48565b6140c4816140be8454613f93565b84614051565b602080601f8311600181146140f957600084156140e15750858301515b600019600386901b1c1916600185901b178555612646565b600085815260208120601f198616915b8281101561412857888601518255948401946001909101908401614109565b50858210156141465787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600061ffff80831681810361416d5761416d61400c565b6001019392505050565b80820180821115610f9e57610f9e61400c565b6000835161419c81846020880161398b565b8351908301906141b081836020880161398b565b01949350505050565b6000602082840312156141cb57600080fd5b815161398481613a07565b805160ff8116811461285157600080fd5b600060208083850312156141fa57600080fd5b82516001600160401b038082111561421157600080fd5b908401906080828703121561422557600080fd5b61422d613a5e565b825161423881613a07565b81528284015161424781613951565b8185015260408301518281111561425d57600080fd5b8301601f8101881361426e57600080fd5b80518381111561428057614280613a48565b8060051b9350614291868501613a86565b818152938201860193868101908a8611156142ab57600080fd5b928701925b858410156142d557835192506142c583613951565b82825292870192908701906142b0565b6040850152506142ea915050606084016141d6565b60608201529695505050505050565b8082028115828204841417610f9e57610f9e61400c565b60008261432d57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6000825161439881846020870161398b565b9190910192915050565b6001600160a01b0383168152604060208201819052600090611bf1908301846139af565b6000606080830181845280875180835260808601915060808160051b87010192506020808a016000805b8481101561445f57898703607f19018652825180516001600160a01b03168852848101516003811061443057634e487b7160e01b84526021600452602484fd5b8886015260409081015190880189905261444c89890182613bf3565b97505094830194918301916001016143f0565b5050506001600160a01b038916908701525050838103604085015261448481866139af565b979650505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906144c2908301846139af565b9695505050505050565b6000602082840312156144de57600080fd5b815161398481613951565b6000816144f8576144f861400c565b50600019019056fec8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c4c69624469616d6f6e644375743a2041646420666163657420686173206e6f20636f64654c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f6465c8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e4c69624469616d6f6e644375743a205265706c61636520666163657420686173206e6f20636f6465ee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa2646970667358221220ad794a6fa7c6eab9bf4e825fb8d4739bdf27139916010b993bd91f6e79f2592b64736f6c63430008130033ee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f";t.BaseFacet__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},652:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStorage__factory=void 0;var o=r(391),a=[{inputs:[],name:"ADMIN_ROLE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"API_ROLE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MANAGER_ROLE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}],s="0x60a9610039600b82828239805160001a60731461002c57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361060475760003560e01c806311fc806514604c57806375b238fc146065578063ec87621c14606c575b600080fd5b6053600481565b60405190815260200160405180910390f35b6053600181565b605360028156fea2646970667358221220a3e79d6cb793be0c59eddff0225722fd63aca37acb75c5f5c4704af30daef9e264736f6c63430008130033";t.BaseStorage__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},194:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.DiamondCollection__factory=void 0;var o=r(391),a=[{inputs:[{components:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"admin",type:"address"},{internalType:"address",name:"treasury",type:"address"},{internalType:"address",name:"royalty",type:"address"},{internalType:"address",name:"trustedForwarder",type:"address"},{internalType:"uint16",name:"royaltyBps",type:"uint16"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"baseURI",type:"string"},{internalType:"bytes32[]",name:"apps",type:"bytes32[]"}],internalType:"struct INiftyKitV3.DiamondArgs",name:"args",type:"tuple"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"_initializationContractAddress",type:"address"},{internalType:"bytes",name:"_calldata",type:"bytes"}],name:"InitializationFunctionReverted",type:"error"},{stateMutability:"payable",type:"fallback"},{stateMutability:"payable",type:"receive"}],s="0x60806040523480156200001157600080fd5b5060405162001c9438038062001c9483398101604081905262000034916200137b565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a805462010000600160b01b031916336201000090810291909117918290556040805163bb4fceb960e01b815290517f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db56936000936001600160a01b039104169163bb4fceb9916004828101926020929190829003018187875af1158015620000e0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001069190620014dd565b90506000816001600160a01b031663d104a1366040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000149573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000173919081019062001598565b905060008461012001515160016200018c91906200166f565b6001600160401b03811115620001a657620001a66200117e565b604051908082528060200260200182016040528015620001f557816020015b60408051606080820183526000808352602083015291810191909152815260200190600190039081620001c55790505b5060408601516005860180546001600160a01b0319166001600160a01b03909216919091179055606083015160048601805460ff60b01b1916600160b01b60ff9093169290920291909117905561010086015190915060068501906200025c908262001714565b5060808501516008850180546001600160a01b0319166001600160a01b039092169190911790556101208501516200029a9082908690869062000328565b9050620002a8818362000562565b90506200031d818360000151876000015188602001518960c001518a60e001518b606001518c60a00151604051602401620002e9969594939291906200180e565b60408051601f198184030181529190526020810180516001600160e01b0390811663c00cf3ab60e01b179091526200064e16565b505050505062001add565b805160609060008051602062001c008339815191529060005b8181101562000556576000866001600160a01b03166342c71f1d8784815181106200037057620003706200186e565b60200260200101516040518263ffffffff1660e01b81526004016200039791815260200190565b600060405180830381865afa158015620003b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620003df919081019062001884565b9050806060015160ff16600003620004335760405162461bcd60e51b8152602060048201526012602482015271105c1c08191bd95cc81b9bdd08195e1a5cdd60721b60448201526064015b60405180910390fd5b604080516060810190915281516001600160a01b03168152602081016000815260200182604001518152508983815181106200047357620004736200186e565b602090810291909101810191909152818101516001600160e01b03191660009081526003860190915260408120805460ff19166001179055865182918a91899086908110620004c657620004c66200186e565b6020908102919091018101518252818101929092526040908101600020835181548585015160e01c600160a01b026001600160c01b03199091166001600160a01b039092169190911717815590830151805191926200052e92600185019290910190620010b4565b50606091909101516002909101805460ff191660ff9092169190911790555060010162000341565b50959695505050505050565b604080516060818101835283516001600160a01b03168252600060208301528383015192820192909252835160008051602062001c0083398151915291908590620005b09060019062001917565b81518110620005c357620005c36200186e565b60200260200101819052506000836020015151905060005b8181101562000641576001836003016000876020015184815181106200060557620006056200186e565b6020908102919091018101516001600160e01b0319168252810191909152604001600020805460ff1916911515919091179055600101620005db565b5084925050505b92915050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e5460008051602062001c008339815191529061ffff811690819060009060071615620006ad5750600381901c60009081526001840160205260409020545b60005b87518110156200073d576200072f83838a8481518110620006d557620006d56200186e565b6020026020010151600001518b8581518110620006f657620006f66200186e565b6020026020010151602001518c86815181106200071757620007176200186e565b602002602001015160400151620007cf60201b60201c565b9093509150600101620006b0565b508282146200075a5760028401805461ffff191661ffff84161790555b60078216156200077d57600382901c600090815260018501602052604090208190555b7f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673878787604051620007b2939291906200192d565b60405180910390a1620007c6868662000fb8565b50505050505050565b6000808060008051602062001c00833981519152905060008451116200084c5760405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201526a1858d95d081d1bc818dd5d60aa1b60648201526084016200042a565b600085600281111562000863576200086362001901565b03620009e0576200088e8660405180606001604052806024815260200162001c206024913962001090565b60005b8451811015620009d9576000858281518110620008b257620008b26200186e565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c15620009555760405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c726561647920657869737473000000000000000000000060648201526084016200042a565b6001600160e01b031980831660008181526020879052604090206001600160601b031960608d901b168e17905560e060058e901b811692831c199c909c1690821c179a819003620009ba5760038c901c600090815260018601602052604081209b909b555b8b620009c68162001a34565b9c50506001909301925062000891915050565b5062000fac565b6001856002811115620009f757620009f762001901565b0362000c045762000a228660405180606001604052806028815260200162001c6c6028913962001090565b60005b8451811015620009d957600085828151811062000a465762000a466200186e565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c30810362000add5760405162461bcd60e51b815260206004820152602f60248201527f4c69624469616d6f6e644375743a2043616e2774207265706c61636520696d6d60448201526e3aba30b1363290333ab731ba34b7b760891b60648201526084016200042a565b896001600160a01b0316816001600160a01b03160362000b555760405162461bcd60e51b8152602060048201526038602482015260008051602062001be083398151915260448201527f6374696f6e20776974682073616d652066756e6374696f6e000000000000000060648201526084016200042a565b6001600160a01b03811662000bc25760405162461bcd60e51b8152602060048201526038602482015260008051602062001be083398151915260448201527f6374696f6e207468617420646f65736e2774206578697374000000000000000060648201526084016200042a565b506001600160e01b031990911660009081526020849052604090206001600160601b03919091166001600160601b031960608a901b1617905560010162000a25565b600285600281111562000c1b5762000c1b62001901565b0362000f53576001600160a01b0386161562000ca05760405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f7665206661636574206164647260448201527f657373206d75737420626520616464726573732830290000000000000000000060648201526084016200042a565b600388901c6007891660005b865181101562000f2e5760008a900362000ced578262000ccc8162001a50565b60008181526001870160205260409020549b5093506007925062000cfd9050565b8162000cf98162001a50565b9250505b6000806000808a858151811062000d185762000d186200186e565b6020908102919091018101516001600160e01b031981166000908152918a9052604090912054909150606081901c62000dba5760405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e277420657869737400000000000000000060648201526084016200042a565b30606082901c0362000e265760405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201526d3a30b1363290333ab731ba34b7b760911b60648201526084016200042a565b600587901b8f901b94506001600160e01b03198086169083161462000e78576001600160e01b03198516600090815260208a90526040902080546001600160601b0319166001600160601b0383161790555b6001600160e01b031991909116600090815260208990526040812055600381901c611fff16925060051b60e016905085821462000edf576000828152600188016020526040902080546001600160e01b031980841c19909116908516831c17905562000f03565b80836001600160e01b031916901c816001600160e01b031960001b901c198e16179c505b8460000362000f2257600086815260018801602052604081208190559c505b50505060010162000cac565b508062000f3d83600862001a6a565b62000f4991906200166f565b9950505062000fac565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f727265637420466163657443756044820152663a20b1ba34b7b760c91b60648201526084016200042a565b50959694955050505050565b6001600160a01b03821662000fcb575050565b62000ff08260405180606001604052806028815260200162001c446028913962001090565b600080836001600160a01b0316836040516200100d919062001a84565b600060405180830381855af49150503d80600081146200104a576040519150601f19603f3d011682016040523d82523d6000602084013e6200104f565b606091505b5091509150816200108a578051156200106b5780518082602001fd5b838360405163192105d760e01b81526004016200042a92919062001aa2565b50505050565b813b81816200108a5760405162461bcd60e51b81526004016200042a919062001ac8565b82805482825590600052602060002090600701600890048101928215620011555791602002820160005b838211156200112157835183826101000a81548163ffffffff021916908360e01c02179055509260200192600401602081600301049283019260010302620010de565b8015620011535782816101000a81549063ffffffff021916905560040160208160030104928301926001030262001121565b505b506200116392915062001167565b5090565b5b8082111562001163576000815560010162001168565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b0381118282101715620011ba57620011ba6200117e565b60405290565b604051608081016001600160401b0381118282101715620011ba57620011ba6200117e565b604051601f8201601f191681016001600160401b03811182821017156200121057620012106200117e565b604052919050565b80516001600160a01b03811681146200123057600080fd5b919050565b805161ffff811681146200123057600080fd5b60005b83811015620012655781810151838201526020016200124b565b50506000910152565b600082601f8301126200128057600080fd5b81516001600160401b038111156200129c576200129c6200117e565b620012b1601f8201601f1916602001620011e5565b818152846020838601011115620012c757600080fd5b620012da82602083016020870162001248565b949350505050565b60006001600160401b03821115620012fe57620012fe6200117e565b5060051b60200190565b600082601f8301126200131a57600080fd5b81516020620013336200132d83620012e2565b620011e5565b82815260059290921b840181019181810190868411156200135357600080fd5b8286015b8481101562001370578051835291830191830162001357565b509695505050505050565b6000602082840312156200138e57600080fd5b81516001600160401b0380821115620013a657600080fd5b908301906101408286031215620013bc57600080fd5b620013c662001194565b620013d18362001218565b8152620013e16020840162001218565b6020820152620013f46040840162001218565b6040820152620014076060840162001218565b60608201526200141a6080840162001218565b60808201526200142d60a0840162001235565b60a082015260c0830151828111156200144557600080fd5b62001453878286016200126e565b60c08301525060e0830151828111156200146c57600080fd5b6200147a878286016200126e565b60e08301525061010080840151838111156200149557600080fd5b620014a3888287016200126e565b8284015250506101208084015183811115620014be57600080fd5b620014cc8882870162001308565b918301919091525095945050505050565b600060208284031215620014f057600080fd5b620014fb8262001218565b9392505050565b80516001600160e01b0319811681146200123057600080fd5b600082601f8301126200152d57600080fd5b81516020620015406200132d83620012e2565b82815260059290921b840181019181810190868411156200156057600080fd5b8286015b848110156200137057620015788162001502565b835291830191830162001564565b805160ff811681146200123057600080fd5b600060208284031215620015ab57600080fd5b81516001600160401b0380821115620015c357600080fd5b9083019060808286031215620015d857600080fd5b620015e2620011c0565b620015ed8362001218565b81526020830151828111156200160257600080fd5b62001610878286016200151b565b6020830152506040830151828111156200162957600080fd5b62001637878286016200151b565b6040830152506200164b6060840162001586565b606082015295945050505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000648576200064862001659565b600181811c908216806200169a57607f821691505b602082108103620016bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200170f57600081815260208120601f850160051c81016020861015620016ea5750805b601f850160051c820191505b818110156200170b57828155600101620016f6565b5050505b505050565b81516001600160401b038111156200173057620017306200117e565b620017488162001741845462001685565b84620016c1565b602080601f831160018114620017805760008415620017675750858301515b600019600386901b1c1916600185901b1785556200170b565b600085815260208120601f198616915b82811015620017b15788860151825594840194600190910190840162001790565b5085821015620017d05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008151808452620017fa81602086016020860162001248565b601f01601f19169290920160200192915050565b600060018060a01b038089168352808816602084015260c060408401526200183a60c0840188620017e0565b83810360608501526200184e8188620017e0565b959091166080840152505061ffff9190911660a090910152949350505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156200189757600080fd5b81516001600160401b0380821115620018af57600080fd5b9083019060808286031215620018c457600080fd5b620018ce620011c0565b620018d98362001218565b8152620018e96020840162001502565b60208201526040830151828111156200162957600080fd5b634e487b7160e01b600052602160045260246000fd5b8181038181111562000648576200064862001659565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b8481101562001a0257898403607f19018652815180516001600160a01b031685528381015189860190600381106200199e57634e487b7160e01b600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b80831015620019ec5783516001600160e01b0319168252928601926001929092019190860190620019c0565b5097850197955050509082019060010162001956565b50506001600160a01b038a1690880152868103604088015262001a268189620017e0565b9a9950505050505050505050565b60006001820162001a495762001a4962001659565b5060010190565b60008162001a625762001a6262001659565b506000190190565b808202811582820484141762000648576200064862001659565b6000825162001a9881846020870162001248565b9190910192915050565b6001600160a01b0383168152604060208201819052600090620012da90830184620017e0565b602081526000620014fb6020830184620017e0565b60f48062001aec6000396000f3fe608060405236600a57005b600080356001600160e01b03191681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020819052604090912054819060601c80609b5760405162461bcd60e51b815260206004820181905260248201527f4469616d6f6e643a2046756e6374696f6e20646f6573206e6f74206578697374604482015260640160405180910390fd5b3660008037600080366000845af43d6000803e80801560b9573d6000f35b3d6000fdfea26469706673582212204b2e85355e1937888a78adb1bf744ba88839710c17cc2e5676456a66b46bb8ab64736f6c634300081300334c69624469616d6f6e644375743a2043616e2774207265706c6163652066756ec8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c4c69624469616d6f6e644375743a2041646420666163657420686173206e6f20636f64654c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a205265706c61636520666163657420686173206e6f20636f6465";t.DiamondCollection__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t,r){return e.prototype.deploy.call(this,t,r||{})},t.prototype.getDeployTransaction=function(t,r){return e.prototype.getDeployTransaction.call(this,t,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},520:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.DiamondLoupeFacet__factory=void 0;var o=r(391),a=[{inputs:[{internalType:"bytes4",name:"_functionSelector",type:"bytes4"}],name:"facetAddress",outputs:[{internalType:"address",name:"facetAddress_",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"facetAddresses",outputs:[{internalType:"address[]",name:"facetAddresses_",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_facet",type:"address"}],name:"facetFunctionSelectors",outputs:[{internalType:"bytes4[]",name:"_facetFunctionSelectors",type:"bytes4[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"facets",outputs:[{components:[{internalType:"address",name:"facetAddress",type:"address"},{internalType:"bytes4[]",name:"functionSelectors",type:"bytes4[]"}],internalType:"struct IDiamondLoupe.Facet[]",name:"facets_",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"_interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}],s="0x608060405234801561001057600080fd5b50610b2b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806301ffc9a71461005c57806352ef6b2c146100bd5780637a0ed627146100d2578063adfca15e146100e7578063cdffacc614610107575b600080fd5b6100a861006a3660046108dd565b6001600160e01b03191660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6100c5610159565b6040516100b4919061090e565b6100da61031d565b6040516100b491906109a0565b6100fa6100f5366004610a1d565b61076b565b6040516100b49190610a46565b6101416101153660046108dd565b6001600160e01b0319166000908152600080516020610ad6833981519152602052604090205460601c90565b6040516001600160a01b0390911681526020016100b4565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e54606090600080516020610ad68339815191529061ffff1667ffffffffffffffff8111156101aa576101aa610a59565b6040519080825280602002602001820160405280156101d3578160200160208202803683370190505b50915060008060005b600284015461ffff16821015610315576000818152600185016020526040812054905b6008811015610300578361021281610a85565b600288015490955061ffff168511905061030057600581901b82901b6001600160e01b0319811660009081526020889052604081205460601c90805b888110156102a3578a818151811061026857610268610a9e565b60200260200101516001600160a01b0316836001600160a01b03160361029157600191506102a3565b8061029b81610a85565b91505061024e565b5080156102b2575050506102ee565b818a89815181106102c5576102c5610a9e565b6001600160a01b0390921660209283029190910190910152876102e781610a85565b9850505050505b806102f881610a85565b9150506101ff565b5050808061030d90610a85565b9150506101dc565b505082525090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e54606090600080516020610ad68339815191529061ffff1667ffffffffffffffff81111561036e5761036e610a59565b6040519080825280602002602001820160405280156103b457816020015b60408051808201909152600081526060602082015281526020019060019003908161038c5790505b50600282015490925060009061ffff1667ffffffffffffffff8111156103dc576103dc610a59565b604051908082528060200260200182016040528015610405578160200160208202803683370190505b50905060008060005b600285015461ffff168210156106f8576000818152600186016020526040812054905b60088110156106e3578361044481610a85565b600289015490955061ffff16851190506106e357600581901b82901b6001600160e01b0319811660009081526020899052604081205460601c90805b888110156105a057826001600160a01b03168c82815181106104a4576104a4610a9e565b6020026020010151600001516001600160a01b03160361058e57838c82815181106104d1576104d1610a9e565b6020026020010151602001518b83815181106104ef576104ef610a9e565b602002602001015161ffff168151811061050b5761050b610a9e565b60200260200101906001600160e01b03191690816001600160e01b0319168152505060ff8a828151811061054157610541610a9e565b602002602001015161ffff161061055757600080fd5b89818151811061056957610569610a9e565b60200260200101805180919061057e90610ab4565b61ffff16905250600191506105a0565b8061059881610a85565b915050610480565b5080156105af575050506106d1565b818b89815181106105c2576105c2610a9e565b60209081029190910101516001600160a01b03909116905260028a015461ffff1667ffffffffffffffff8111156105fb576105fb610a59565b604051908082528060200260200182016040528015610624578160200160208202803683370190505b508b898151811061063757610637610a9e565b602002602001015160200181905250828b898151811061065957610659610a9e565b60200260200101516020015160008151811061067757610677610a9e565b60200260200101906001600160e01b03191690816001600160e01b0319168152505060018989815181106106ad576106ad610a9e565b61ffff90921660209283029190910190910152876106ca81610a85565b9850505050505b806106db81610a85565b915050610431565b505080806106f090610a85565b91505061040e565b5060005b8281101561076057600084828151811061071857610718610a9e565b602002602001015161ffff169050600087838151811061073a5761073a610a9e565b60200260200101516020015190508181525050808061075890610a85565b9150506106fc565b508185525050505090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e54606090600080516020610ad68339815191529060009061ffff1667ffffffffffffffff8111156107bf576107bf610a59565b6040519080825280602002602001820160405280156107e8578160200160208202803683370190505b5092506000805b600284015461ffff168210156108d3576000818152600185016020526040812054905b60088110156108be578361082581610a85565b600288015490955061ffff16851190506108be57600581901b82901b6001600160e01b0319811660009081526020889052604090205460601c6001600160a01b038a168190036108a9578189888151811061088257610882610a9e565b6001600160e01b031990921660209283029190910190910152866108a581610a85565b9750505b505080806108b690610a85565b915050610812565b505080806108cb90610a85565b9150506107ef565b5050825250919050565b6000602082840312156108ef57600080fd5b81356001600160e01b03198116811461090757600080fd5b9392505050565b6020808252825182820181905260009190848201906040850190845b8181101561094f5783516001600160a01b03168352928401929184019160010161092a565b50909695505050505050565b600081518084526020808501945080840160005b838110156109955781516001600160e01b0319168752958201959082019060010161096f565b509495945050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610a0f57888303603f19018552815180516001600160a01b031684528701518784018790526109fc8785018261095b565b95880195935050908601906001016109c7565b509098975050505050505050565b600060208284031215610a2f57600080fd5b81356001600160a01b038116811461090757600080fd5b602081526000610907602083018461095b565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201610a9757610a97610a6f565b5060010190565b634e487b7160e01b600052603260045260246000fd5b600061ffff808316818103610acb57610acb610a6f565b600101939250505056fec8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131ca2646970667358221220143b424e99baf3f66a7fb20c8ed8ac6c2b482af7c8f35c51091fa35b7b4bae5264736f6c63430008130033";t.DiamondLoupeFacet__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},157:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiamondLoupeFacet__factory=t.DiamondCollection__factory=t.BaseStorage__factory=t.BaseFacet__factory=void 0;var n=r(744);Object.defineProperty(t,"BaseFacet__factory",{enumerable:!0,get:function(){return n.BaseFacet__factory}});var i=r(652);Object.defineProperty(t,"BaseStorage__factory",{enumerable:!0,get:function(){return i.BaseStorage__factory}});var o=r(194);Object.defineProperty(t,"DiamondCollection__factory",{enumerable:!0,get:function(){return o.DiamondCollection__factory}});var a=r(520);Object.defineProperty(t,"DiamondLoupeFacet__factory",{enumerable:!0,get:function(){return a.DiamondLoupeFacet__factory}})},196:()=>{},14:(e,t,r)=>{"use strict";function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:o}=Object,a=(s=Object.create(null),e=>{const t=i.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())});var s;const c=e=>(e=e.toLowerCase(),t=>a(t)===e),f=e=>t=>typeof t===e,{isArray:u}=Array,l=f("undefined"),d=c("ArrayBuffer"),h=f("string"),b=f("function"),p=f("number"),m=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==a(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},g=c("Date"),v=c("File"),w=c("Blob"),A=c("FileList"),E=c("URLSearchParams");function _(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),u(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(n=0;n<o;n++)a=i[n],t.call(null,e[a],a,e)}}function T(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,S=e=>!l(e)&&e!==k,P=(x="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>x&&e instanceof x);var x;const N=c("HTMLFormElement"),M=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),C=c("RegExp"),R=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};_(r,((r,i)=>{let o;!1!==(o=t(r,i,e))&&(n[i]=o||r)})),Object.defineProperties(e,n)},I="abcdefghijklmnopqrstuvwxyz",O="0123456789",B={DIGIT:O,ALPHA:I,ALPHA_DIGIT:I+I.toUpperCase()+O},F=c("AsyncFunction");var D={isArray:u,isArrayBuffer:d,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||b(e.append)&&("formdata"===(t=a(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer),t},isString:h,isNumber:p,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:y,isUndefined:l,isDate:g,isFile:v,isBlob:w,isRegExp:C,isFunction:b,isStream:e=>m(e)&&b(e.pipe),isURLSearchParams:E,isTypedArray:P,isFileList:A,forEach:_,merge:function e(){const{caseless:t}=S(this)&&this||{},r={},n=(n,i)=>{const o=t&&T(r,i)||i;y(r[o])&&y(n)?r[o]=e(r[o],n):y(n)?r[o]=e({},n):u(n)?r[o]=n.slice():r[o]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&_(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:i}={})=>(_(t,((t,i)=>{r&&b(t)?e[i]=n(t,r):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,a,s;const c={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],n&&!n(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==r&&o(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:c,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!p(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:N,hasOwnProperty:M,hasOwnProp:M,reduceDescriptors:R,freezeMethods:e=>{R(e,((t,r)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];b(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return u(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:T,global:k,isContextDefined:S,ALPHABET:B,generateString:(e=16,t=B.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=u(e)?[]:{};return _(e,((e,t)=>{const o=r(e,n+1);!l(o)&&(i[t]=o)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:F,isThenable:e=>e&&(m(e)||b(e))&&b(e.then)&&b(e.catch)};function U(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}D.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:D.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const L=U.prototype,j={};function z(e){return D.isPlainObject(e)||D.isArray(e)}function G(e){return D.endsWith(e,"[]")?e.slice(0,-2):e}function q(e,t,r){return e?e.concat(t).map((function(e,t){return e=G(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{j[e]={value:e}})),Object.defineProperties(U,j),Object.defineProperty(L,"isAxiosError",{value:!0}),U.from=(e,t,r,n,i,o)=>{const a=Object.create(L);return D.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(a,e.message,t,r,n,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const K=D.toFlatObject(D,{},null,(function(e){return/^is[A-Z]/.test(e)}));function H(e,t,r){if(!D.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=D.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!D.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,o=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(D.isDate(e))return e.toISOString();if(!s&&D.isBlob(e))throw new U("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(e)||D.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(D.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(D.isArray(e)&&function(e){return D.isArray(e)&&!e.some(z)}(e)||(D.isFileList(e)||D.endsWith(r,"[]"))&&(s=D.toArray(e)))return r=G(r),s.forEach((function(e,n){!D.isUndefined(e)&&null!==e&&t.append(!0===a?q([r],n,o):null===a?r:r+"[]",c(e))})),!1;return!!z(e)||(t.append(q(i,r,o),c(e)),!1)}const u=[],l=Object.assign(K,{defaultVisitor:f,convertValue:c,isVisitable:z});if(!D.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!D.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),D.forEach(r,(function(r,o){!0===(!(D.isUndefined(r)||null===r)&&i.call(t,r,D.isString(o)?o.trim():o,n,l))&&e(r,n?n.concat(o):[o])})),u.pop()}}(e),t}function J(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function W(e,t){this._pairs=[],e&&H(e,this,t)}const V=W.prototype;function Q(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Y(e,t,r){if(!t)return e;const n=r&&r.encode||Q,i=r&&r.serialize;let o;if(o=i?i(t,r):D.isURLSearchParams(t)?t.toString():new W(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}V.append=function(e,t){this._pairs.push([e,t])},V.toString=function(e){const t=e?function(t){return e.call(this,t,J)}:J;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var X=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){D.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:W,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function ee(e){function t(e,r,n,i){let o=e[i++];const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&D.isArray(n)?n.length:o,s?(D.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!a):(n[o]&&D.isObject(n[o])||(n[o]=[]),t(e,r,n[o],i)&&D.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],t[o]=e[o];return t}(n[o])),!a)}if(D.isFormData(e)&&D.isFunction(e.entries)){const r={};return D.forEachEntry(e,((e,n)=>{t(function(e){return D.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const te={transitional:Z,adapter:$.isNode?"http":"xhr",transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=D.isObject(e);if(i&&D.isHTMLForm(e)&&(e=new FormData(e)),D.isFormData(e))return n&&n?JSON.stringify(ee(e)):e;if(D.isArrayBuffer(e)||D.isBuffer(e)||D.isStream(e)||D.isFile(e)||D.isBlob(e))return e;if(D.isArrayBufferView(e))return e.buffer;if(D.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return H(e,new $.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return $.isNode&&D.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=D.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return H(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(D.isString(e))try{return(0,JSON.parse)(e),D.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||te.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&D.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw U.from(e,U.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$.classes.FormData,Blob:$.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],(e=>{te.headers[e]={}}));var re=te;const ne=D.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ie=Symbol("internals");function oe(e){return e&&String(e).trim().toLowerCase()}function ae(e){return!1===e||null==e?e:D.isArray(e)?e.map(ae):String(e)}function se(e,t,r,n,i){return D.isFunction(n)?n.call(this,t,r):(i&&(t=r),D.isString(t)?D.isString(n)?-1!==t.indexOf(n):D.isRegExp(n)?n.test(t):void 0:void 0)}class ce{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=oe(t);if(!i)throw new Error("header name must be a non-empty string");const o=D.findKey(n,i);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=ae(e))}const o=(e,t)=>D.forEach(e,((e,r)=>i(e,r,t)));return D.isPlainObject(e)||e instanceof this.constructor?o(e,t):D.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?o((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&ne[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=oe(e)){const r=D.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(D.isFunction(t))return t.call(this,e,r);if(D.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=oe(e)){const r=D.findKey(this,e);return!(!r||void 0===this[r]||t&&!se(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=oe(e)){const i=D.findKey(r,e);!i||t&&!se(0,r[i],i,t)||(delete r[i],n=!0)}}return D.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!se(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return D.forEach(this,((n,i)=>{const o=D.findKey(r,i);if(o)return t[o]=ae(n),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();a!==i&&delete t[i],t[a]=ae(n),r[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return D.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&D.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[ie]=this[ie]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=oe(e);t[n]||(function(e,t){const r=D.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return D.isArray(e)?e.forEach(n):n(e),this}}ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.reduceDescriptors(ce.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),D.freezeMethods(ce);var fe=ce;function ue(e,t){const r=this||re,n=t||r,i=fe.from(n.headers);let o=n.data;return D.forEach(e,(function(e){o=e.call(r,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function le(e){return!(!e||!e.__CANCEL__)}function de(e,t,r){U.call(this,null==e?"canceled":e,U.ERR_CANCELED,t,r),this.name="CanceledError"}D.inherits(de,U,{__CANCEL__:!0});var he=$.isStandardBrowserEnv?{write:function(e,t,r,n,i,o){const a=[];a.push(e+"="+encodeURIComponent(t)),D.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),D.isString(n)&&a.push("path="+n),D.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function be(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var pe=$.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=D.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function me(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),f=n[a];i||(i=c),r[o]=s,n[o]=c;let u=a,l=0;for(;u!==o;)l+=r[u++],u%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),c-i<t)return;const d=f&&c-f;return d?Math.round(1e3*l/d):void 0}}(50,250);return i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-r,c=n(s);r=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&o<=a?(a-o)/c:void 0,event:i};f[t?"download":"upload"]=!0,e(f)}}const ye={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=fe.from(e.headers).normalize(),o=e.responseType;let a;function s(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}D.isFormData(n)&&($.isStandardBrowserEnv||$.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const f=be(e.baseURL,e.url);function u(){if(!c)return;const n=fe.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new U("Request failed with status code "+r.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),s()}),(function(e){r(e),s()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Y(f,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=u:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(u)},c.onabort=function(){c&&(r(new U("Request aborted",U.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new U("Network Error",U.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new U(t,n.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,c)),c=null},$.isStandardBrowserEnv){const t=(e.withCredentials||pe(f))&&e.xsrfCookieName&&he.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in c&&D.forEach(i.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),D.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",me(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",me(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(r(!t||t.type?new de(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const l=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(f);l&&-1===$.protocols.indexOf(l)?r(new U("Unsupported protocol "+l+":",U.ERR_BAD_REQUEST,e)):c.send(n||null)}))}};D.forEach(ye,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var ge=e=>{e=D.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let i=0;i<t&&(r=e[i],!(n=D.isString(r)?ye[r.toLowerCase()]:r));i++);if(!n){if(!1===n)throw new U(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(D.hasOwnProp(ye,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!D.isFunction(n))throw new TypeError("adapter is not a function");return n};function ve(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new de(null,e)}function we(e){return ve(e),e.headers=fe.from(e.headers),e.data=ue.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ge(e.adapter||re.adapter)(e).then((function(t){return ve(e),t.data=ue.call(e,e.transformResponse,t),t.headers=fe.from(t.headers),t}),(function(t){return le(t)||(ve(e),t&&t.response&&(t.response.data=ue.call(e,e.transformResponse,t.response),t.response.headers=fe.from(t.response.headers))),Promise.reject(t)}))}const Ae=e=>e instanceof fe?e.toJSON():e;function Ee(e,t){t=t||{};const r={};function n(e,t,r){return D.isPlainObject(e)&&D.isPlainObject(t)?D.merge.call({caseless:r},e,t):D.isPlainObject(t)?D.merge({},t):D.isArray(t)?t.slice():t}function i(e,t,r){return D.isUndefined(t)?D.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function o(e,t){if(!D.isUndefined(t))return n(void 0,t)}function a(e,t){return D.isUndefined(t)?D.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,o){return o in t?n(r,i):o in e?n(void 0,r):void 0}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>i(Ae(e),Ae(t),!0)};return D.forEach(Object.keys(Object.assign({},e,t)),(function(n){const o=c[n]||i,a=o(e[n],t[n],n);D.isUndefined(a)&&o!==s||(r[n]=a)})),r}const _e={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{_e[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Te={};_e.transitional=function(e,t,r){function n(e,t){return"[Axios v1.5.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,o)=>{if(!1===e)throw new U(n(i," has been removed"+(t?" in "+t:"")),U.ERR_DEPRECATED);return t&&!Te[i]&&(Te[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,o)}};var ke={assertOptions:function(e,t,r){if("object"!=typeof e)throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],a=t[o];if(a){const t=e[o],r=void 0===t||a(t,o,e);if(!0!==r)throw new U("option "+o+" must be "+r,U.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new U("Unknown option "+o,U.ERR_BAD_OPTION)}},validators:_e};const Se=ke.validators;class Pe{constructor(e){this.defaults=e,this.interceptors={request:new X,response:new X}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ee(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&ke.assertOptions(r,{silentJSONParsing:Se.transitional(Se.boolean),forcedJSONParsing:Se.transitional(Se.boolean),clarifyTimeoutError:Se.transitional(Se.boolean)},!1),null!=n&&(D.isFunction(n)?t.paramsSerializer={serialize:n}:ke.assertOptions(n,{encode:Se.function,serialize:Se.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&D.merge(i.common,i[t.method]);i&&D.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=fe.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let f;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,l=0;if(!s){const e=[we.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),u=e.length,f=Promise.resolve(t);l<u;)f=f.then(e[l++],e[l++]);return f}u=a.length;let d=t;for(l=0;l<u;){const e=a[l++],t=a[l++];try{d=e(d)}catch(e){t.call(this,e);break}}try{f=we.call(this,d)}catch(e){return Promise.reject(e)}for(l=0,u=c.length;l<u;)f=f.then(c[l++],c[l++]);return f}getUri(e){return Y(be((e=Ee(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}D.forEach(["delete","get","head","options"],(function(e){Pe.prototype[e]=function(t,r){return this.request(Ee(r||{},{method:e,url:t,data:(r||{}).data}))}})),D.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(Ee(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Pe.prototype[e]=t(),Pe.prototype[e+"Form"]=t(!0)}));var xe=Pe;class Ne{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new de(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ne((function(t){e=t})),cancel:e}}}var Me=Ne;const Ce={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ce).forEach((([e,t])=>{Ce[t]=e}));var Re=Ce;const Ie=function e(t){const r=new xe(t),i=n(xe.prototype.request,r);return D.extend(i,xe.prototype,r,{allOwnKeys:!0}),D.extend(i,r,null,{allOwnKeys:!0}),i.create=function(r){return e(Ee(t,r))},i}(re);Ie.Axios=xe,Ie.CanceledError=de,Ie.CancelToken=Me,Ie.isCancel=le,Ie.VERSION="1.5.0",Ie.toFormData=H,Ie.AxiosError=U,Ie.Cancel=Ie.CanceledError,Ie.all=function(e){return Promise.all(e)},Ie.spread=function(e){return function(t){return e.apply(null,t)}},Ie.isAxiosError=function(e){return D.isObject(e)&&!0===e.isAxiosError},Ie.mergeConfig=Ee,Ie.AxiosHeaders=fe,Ie.formToJSON=e=>ee(D.isHTMLForm(e)?new FormData(e):e),Ie.getAdapter=ge,Ie.HttpStatusCode=Re,Ie.default=Ie,e.exports=Ie}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n=r(368);return n.default})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Diamond=t():e.Diamond=t()}(this,(()=>(()=>{var e={202:function(e){"use strict";!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 o(e){return new Uint8Array(e)}function a(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 s,c={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("")}},f=(s="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(s[(240&n)>>4]+s[15&n])}return t.join("")}}),u={16:10,24:12,32:14},l=[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],h=[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],b=[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],p=[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],y=[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],A=[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],E=[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],_=[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],T=[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],k=[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 S(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 P=function(e){if(!(this instanceof P))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(e,!0)}),this._prepare()};P.prototype._prepare=function(){var e=u[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,o=S(this.key);for(t=0;t<i;t++)r=t>>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,c=i;c<n;){if(a=o[i-1],o[0]^=d[a>>16&255]<<24^d[a>>8&255]<<16^d[255&a]<<8^d[a>>24&255]^l[s]<<24,s+=1,8!=i)for(t=1;t<i;t++)o[t]^=o[t-1];else{for(t=1;t<i/2;t++)o[t]^=o[t-1];for(a=o[i/2-1],o[i/2]^=d[255&a]^d[a>>8&255]<<8^d[a>>16&255]<<16^d[a>>24&255]<<24,t=i/2+1;t<i;t++)o[t]^=o[t-1]}for(t=0;t<i&&c<n;)f=c>>2,h=c%4,this._Ke[f][h]=o[t],this._Kd[e-f][h]=o[t++],c++}for(var f=1;f<e;f++)for(var h=0;h<4;h++)a=this._Kd[f][h],this._Kd[f][h]=E[a>>24&255]^_[a>>16&255]^T[a>>8&255]^k[255&a]},P.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=S(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a<t;a++){for(i=0;i<4;i++)r[i]=b[n[i]>>24&255]^p[n[(i+1)%4]>>16&255]^m[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],c[4*i]=255&(d[n[i]>>24&255]^s>>24),c[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(d[255&n[(i+3)%4]]^s);return c},P.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=S(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a<t;a++){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]^A[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],c[4*i]=255&(h[n[i]>>24&255]^s>>24),c[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(h[255&n[(i+1)%4]]^s);return c};var x=function(e){if(!(this instanceof x))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new P(e)};x.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=o(e.length),r=o(16),n=0;n<e.length;n+=16)a(e,r,0,n,n+16),a(r=this._aes.encrypt(r),t,n);return t},x.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=o(e.length),r=o(16),n=0;n<e.length;n+=16)a(e,r,0,n,n+16),a(r=this._aes.decrypt(r),t,n);return t};var N=function(e,t){if(!(this instanceof N))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=o(16);this._lastCipherblock=i(t,!0),this._aes=new P(e)};N.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=o(e.length),r=o(16),n=0;n<e.length;n+=16){a(e,r,0,n,n+16);for(var s=0;s<16;s++)r[s]^=this._lastCipherblock[s];this._lastCipherblock=this._aes.encrypt(r),a(this._lastCipherblock,t,n)}return t},N.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=o(e.length),r=o(16),n=0;n<e.length;n+=16){a(e,r,0,n,n+16),r=this._aes.decrypt(r);for(var s=0;s<16;s++)t[n+s]=r[s]^this._lastCipherblock[s];a(e,this._lastCipherblock,0,n,n+16)}return t};var M=function(e,t,r){if(!(this instanceof M))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=o(16);r||(r=1),this.segmentSize=r,this._shiftRegister=i(t,!0),this._aes=new P(e)};M.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 o=0;o<this.segmentSize;o++)r[n+o]^=t[o];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},M.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 o=0;o<this.segmentSize;o++)r[n+o]^=t[o];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var C=function(e,t){if(!(this instanceof C))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=o(16);this._lastPrecipher=i(t,!0),this._lastPrecipherIndex=16,this._aes=new P(e)};C.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},C.prototype.decrypt=C.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=o(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 I=function(e,t){if(!(this instanceof I))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 P(e)};I.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},I.prototype.decrypt=I.prototype.encrypt;var O={AES:P,Counter:R,ModeOfOperation:{ecb:x,cbc:N,cfb:M,ofb:C,ctr:I},utils:{hex:f,utf8:c},padding:{pkcs7:{pad:function(e){var t=16-(e=i(e,!0)).length%16,r=o(e.length+t);a(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 s=o(r);return a(e,s,0,0,r),s}}},_arrayTest:{coerceArray:i,createArray:o,copyArray:a}};e.exports=O}()},273:e=>{"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<32;n++){var i=t.charAt(n);if(void 0!==r[i])throw new TypeError(i+" is ambiguous");r[i]=n}function o(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 a(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=o(t)^n>>5}for(t=o(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=o(t)^31&i}return t}function s(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 s=(e=n).lastIndexOf("1");if(-1===s)return"No separator character for "+e;if(0===s)return"Missing prefix for "+e;var c=e.slice(0,s),f=e.slice(s+1);if(f.length<6)return"Data too short";var u=a(c);if("string"==typeof u)return u;for(var l=[],d=0;d<f.length;++d){var h=f.charAt(d),b=r[h];if(void 0===b)return"Unknown character "+h;u=o(u)^b,d+6>=f.length||l.push(b)}return 1!==u?"Invalid checksum for "+e:{prefix:c,words:l}}function c(e,t,r,n){for(var i=0,o=0,a=(1<<r)-1,s=[],c=0;c<e.length;++c)for(i=i<<t|e[c],o+=t;o>=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<<r-o&a);else{if(o>=t)return"Excess padding";if(i<<r-o&a)return"Non-zero padding"}return s}e.exports={decodeUnsafe:function(){var e=s.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=s.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=a(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var s=e+"1",c=0;c<r.length;++c){var f=r[c];if(f>>5!=0)throw new Error("Non 5-bit word");i=o(i)^f,s+=t.charAt(f)}for(c=0;c<6;++c)i=o(i);for(i^=1,c=0;c<6;++c)s+=t.charAt(i>>5*(5-c)&31);return s},toWordsUnsafe:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},197:function(e,t,r){!function(e,t){"use strict";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 o(e,t,r){if(o.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 a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(196).Buffer}catch(e){}function s(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 c(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function f(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),c=t;c<s;c++){var f=e.charCodeAt(c)-48;o*=i,a=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&a<i,"Invalid character"),o+=a}return o}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.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)))},o.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)},o.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 o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.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,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=c(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=c(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.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 o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,u=r;u<s;u+=n)c=f(e,u,u+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var l=1;for(c=f(e,u,e.length,t),u=0;u<a;u++)l*=t;this.imuln(l),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},o.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},o.prototype._move=function(e){u(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){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"],h=[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],b=[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 p(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],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var f=1;f<n;f++){for(var u=c>>>26,l=67108863&c,d=Math.min(f,t.length-1),h=Math.max(0,f-e.length+1);h<=d;h++){var b=f-h|0;u+=(a=(i=0|e.words[b])*(o=0|t.words[h])+l)/67108864|0,l=67108863&a}r.words[f]=0|l,c=0|u}return 0!==c?r.words[f]=0|c:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],c=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-c.length]+c+r:c+r}for(0!==o&&(r=o.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 f=h[e],u=b[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var p=l.modrn(u).toString(e);r=(l=l.idivn(u)).isZero()?p+r:d[f-p.length]+p+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")},o.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},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.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},o.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},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.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},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.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()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.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()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.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()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.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()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.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()},o.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,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.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)},o.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 o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,i,o,a=e.words,s=t.words,c=r.words,f=0,u=0|a[0],l=8191&u,d=u>>>13,h=0|a[1],b=8191&h,p=h>>>13,m=0|a[2],y=8191&m,g=m>>>13,v=0|a[3],w=8191&v,A=v>>>13,E=0|a[4],_=8191&E,T=E>>>13,k=0|a[5],S=8191&k,P=k>>>13,x=0|a[6],N=8191&x,M=x>>>13,C=0|a[7],R=8191&C,I=C>>>13,O=0|a[8],B=8191&O,F=O>>>13,D=0|a[9],U=8191&D,L=D>>>13,j=0|s[0],z=8191&j,G=j>>>13,q=0|s[1],K=8191&q,H=q>>>13,J=0|s[2],W=8191&J,V=J>>>13,Q=0|s[3],Y=8191&Q,X=Q>>>13,Z=0|s[4],$=8191&Z,ee=Z>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,fe=se>>>13,ue=0|s[8],le=8191&ue,de=ue>>>13,he=0|s[9],be=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(l,z))|0)+((8191&(i=(i=Math.imul(l,G))+Math.imul(d,z)|0))<<13)|0;f=((o=Math.imul(d,G))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(b,z),i=(i=Math.imul(b,G))+Math.imul(p,z)|0,o=Math.imul(p,G);var ye=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(d,K)|0))<<13)|0;f=((o=o+Math.imul(d,H)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,z),i=(i=Math.imul(y,G))+Math.imul(g,z)|0,o=Math.imul(g,G),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(p,K)|0,o=o+Math.imul(p,H)|0;var ge=(f+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(d,W)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,z),i=(i=Math.imul(w,G))+Math.imul(A,z)|0,o=Math.imul(A,G),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,H)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(p,W)|0,o=o+Math.imul(p,V)|0;var ve=(f+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(d,Y)|0))<<13)|0;f=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,z),i=(i=Math.imul(_,G))+Math.imul(T,z)|0,o=Math.imul(T,G),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,H)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,V)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(p,Y)|0,o=o+Math.imul(p,X)|0;var we=(f+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(d,$)|0))<<13)|0;f=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(S,z),i=(i=Math.imul(S,G))+Math.imul(P,z)|0,o=Math.imul(P,G),n=n+Math.imul(_,K)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(p,$)|0,o=o+Math.imul(p,ee)|0;var Ae=(f+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(d,re)|0))<<13)|0;f=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(N,z),i=(i=Math.imul(N,G))+Math.imul(M,z)|0,o=Math.imul(M,G),n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,V)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(p,re)|0,o=o+Math.imul(p,ne)|0;var Ee=(f+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ae)|0)+Math.imul(d,oe)|0))<<13)|0;f=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(R,z),i=(i=Math.imul(R,G))+Math.imul(I,z)|0,o=Math.imul(I,G),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,ae)|0)+Math.imul(p,oe)|0,o=o+Math.imul(p,ae)|0;var _e=(f+(n=n+Math.imul(l,ce)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(d,ce)|0))<<13)|0;f=((o=o+Math.imul(d,fe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,z),i=(i=Math.imul(B,G))+Math.imul(F,z)|0,o=Math.imul(F,G),n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,n=n+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,fe)|0)+Math.imul(p,ce)|0,o=o+Math.imul(p,fe)|0;var Te=(f+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;f=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,z),i=(i=Math.imul(U,G))+Math.imul(L,z)|0,o=Math.imul(L,G),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(F,K)|0,o=o+Math.imul(F,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,fe)|0)+Math.imul(g,ce)|0,o=o+Math.imul(g,fe)|0,n=n+Math.imul(b,le)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(p,le)|0,o=o+Math.imul(p,de)|0;var ke=(f+(n=n+Math.imul(l,be)|0)|0)+((8191&(i=(i=i+Math.imul(l,pe)|0)+Math.imul(d,be)|0))<<13)|0;f=((o=o+Math.imul(d,pe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,H))+Math.imul(L,K)|0,o=Math.imul(L,H),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(F,W)|0,o=o+Math.imul(F,V)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,fe)|0,n=n+Math.imul(y,le)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(g,le)|0,o=o+Math.imul(g,de)|0;var Se=(f+(n=n+Math.imul(b,be)|0)|0)+((8191&(i=(i=i+Math.imul(b,pe)|0)+Math.imul(p,be)|0))<<13)|0;f=((o=o+Math.imul(p,pe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,V))+Math.imul(L,W)|0,o=Math.imul(L,V),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(F,Y)|0,o=o+Math.imul(F,X)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(_,ce)|0,i=(i=i+Math.imul(_,fe)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,fe)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(A,le)|0,o=o+Math.imul(A,de)|0;var Pe=(f+(n=n+Math.imul(y,be)|0)|0)+((8191&(i=(i=i+Math.imul(y,pe)|0)+Math.imul(g,be)|0))<<13)|0;f=((o=o+Math.imul(g,pe)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,X))+Math.imul(L,Y)|0,o=Math.imul(L,X),n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,fe)|0,n=n+Math.imul(_,le)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(T,le)|0,o=o+Math.imul(T,de)|0;var xe=(f+(n=n+Math.imul(w,be)|0)|0)+((8191&(i=(i=i+Math.imul(w,pe)|0)+Math.imul(A,be)|0))<<13)|0;f=((o=o+Math.imul(A,pe)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,ee))+Math.imul(L,$)|0,o=Math.imul(L,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(F,re)|0,o=o+Math.imul(F,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,fe)|0)+Math.imul(M,ce)|0,o=o+Math.imul(M,fe)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,de)|0;var Ne=(f+(n=n+Math.imul(_,be)|0)|0)+((8191&(i=(i=i+Math.imul(_,pe)|0)+Math.imul(T,be)|0))<<13)|0;f=((o=o+Math.imul(T,pe)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(L,re)|0,o=Math.imul(L,ne),n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(F,oe)|0,o=o+Math.imul(F,ae)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,fe)|0,n=n+Math.imul(N,le)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,de)|0;var Me=(f+(n=n+Math.imul(S,be)|0)|0)+((8191&(i=(i=i+Math.imul(S,pe)|0)+Math.imul(P,be)|0))<<13)|0;f=((o=o+Math.imul(P,pe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,ae))+Math.imul(L,oe)|0,o=Math.imul(L,ae),n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,fe)|0)+Math.imul(F,ce)|0,o=o+Math.imul(F,fe)|0,n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(I,le)|0,o=o+Math.imul(I,de)|0;var Ce=(f+(n=n+Math.imul(N,be)|0)|0)+((8191&(i=(i=i+Math.imul(N,pe)|0)+Math.imul(M,be)|0))<<13)|0;f=((o=o+Math.imul(M,pe)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(U,ce),i=(i=Math.imul(U,fe))+Math.imul(L,ce)|0,o=Math.imul(L,fe),n=n+Math.imul(B,le)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(F,le)|0,o=o+Math.imul(F,de)|0;var Re=(f+(n=n+Math.imul(R,be)|0)|0)+((8191&(i=(i=i+Math.imul(R,pe)|0)+Math.imul(I,be)|0))<<13)|0;f=((o=o+Math.imul(I,pe)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,le),i=(i=Math.imul(U,de))+Math.imul(L,le)|0,o=Math.imul(L,de);var Ie=(f+(n=n+Math.imul(B,be)|0)|0)+((8191&(i=(i=i+Math.imul(B,pe)|0)+Math.imul(F,be)|0))<<13)|0;f=((o=o+Math.imul(F,pe)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863;var Oe=(f+(n=Math.imul(U,be))|0)+((8191&(i=(i=Math.imul(U,pe))+Math.imul(L,be)|0))<<13)|0;return f=((o=Math.imul(L,pe))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=me,c[1]=ye,c[2]=ge,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=Ee,c[7]=_e,c[8]=Te,c[9]=ke,c[10]=Se,c[11]=Pe,c[12]=xe,c[13]=Ne,c[14]=Me,c[15]=Ce,c[16]=Re,c[17]=Ie,c[18]=Oe,0!==f&&(c[19]=f,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,c=Math.min(o,t.length-1),f=Math.max(0,o-e.length+1);f<=c;f++){var u=o-f,l=(0|e.words[u])*(0|t.words[f]),d=67108863&l;s=67108863&(d=d+s|0),i+=(a=(a=a+(l/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function g(e,t,r){return y(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=p),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?y(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.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,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},v.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,c=Math.cos(2*Math.PI/s),f=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var l=c,d=f,h=0;h<a;h++){var b=r[u+h],p=n[u+h],m=r[u+h+a],y=n[u+h+a],g=l*m-d*y;y=l*y+d*m,m=g,r[u+h]=b+m,n[u+h]=p+y,r[u+h+a]=b-m,n[u+h+a]=p-y,h!==s&&(g=c*l-f*d,d=c*d+f*l,l=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 o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},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),o=this.stub(n),a=new Array(n),s=new Array(n),c=new Array(n),f=new Array(n),u=new Array(n),l=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,f,n),this.transform(a,o,s,c,n,i),this.transform(f,o,u,l,n,i);for(var h=0;h<n;h++){var b=s[h]*u[h]-c[h]*l[h];c[h]=s[h]*l[h]+c[h]*u[h],s[h]=b}return this.conjugate(s,c,n),this.transform(s,c,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),g(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.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 o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.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 o(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},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,c=(0|this.words[t])-s<<r;this.words[t]=c|a,a=s>>>26-r}a&&(this.words[t]=a,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()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,c=r;if(i-=a,i=Math.max(0,i),c){for(var f=0;f<a;f++)c.words[f]=this.words[f];c.length=a}if(0===a);else if(this.length>a)for(this.length-=a,f=0;f<this.length;f++)this.words[f]=this.words[f+a];else this.words[0]=0,this.length=1;var u=0;for(f=this.length-1;f>=0&&(0!==u||f>=i);f--){var l=0|this.words[f];this.words[f]=u<<26-o|l>>>o,u=l&s}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.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))},o.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()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.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)},o.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},o.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()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var c=(0|e.words[i])*t;s=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,c=n.length-i.length;if("mod"!==t){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var f=0;f<s.length;f++)s.words[f]=0}var u=n.clone()._ishlnsubmul(i,1,c);0===u.negative&&(n=u,s&&(s.words[c]=1));for(var l=c-1;l>=0;l--){var d=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.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),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.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 o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.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 o(1),a=new o(0),s=new o(0),c=new o(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var u=r.clone(),l=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(u),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var b=0,p=1;0==(r.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(c)):(r.isub(t),s.isub(i),c.isub(a))}return{a:s,b:c,gcd:r.iushln(f)}},o.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,a=new o(1),s=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,u=1;0==(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var l=0,d=1;0==(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.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 o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.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 o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.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},o.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},o.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},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.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)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.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 A(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function T(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._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 P(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}A.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},A.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},A.prototype.split=function(e,t){e.iushrn(this.n,0,t)},A.prototype.imulK=function(e){return e.imul(this.k)},i(E,A),E.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 o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},E.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(_,A),i(T,A),i(k,A),k.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},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new E;else if("p224"===e)t=new _;else if("p192"===e)t=new T;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return w[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.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")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.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)},S.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},S.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)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.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 o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),c=s.redNeg(),f=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);0!==this.pow(u,f).cmp(c);)u.redIAdd(c);for(var l=this.pow(u,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),b=a;0!==h.cmp(s);){for(var p=h,m=0;0!==p.cmp(s);m++)p=p.redSqr();n(m<b);var y=this.pow(l,new o(1).iushln(b-m-1));d=d.redMul(y),l=y.redSqr(),h=h.redMul(l),b=m}return d},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(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],a=0,s=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var f=t.words[n],u=c-1;u>=0;u--){var l=f>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4==++s||0===n&&0===u)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}c=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new P(e)},i(P,S),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.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),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},P.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(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),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)},P.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},391:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BaseContract:()=>In,BigNumber:()=>V,Contract:()=>On,ContractFactory:()=>Bn,FixedNumber:()=>Jn,Signer:()=>fr,VoidSigner:()=>ur,Wallet:()=>Ao,Wordlist:()=>_i,constants:()=>i,errors:()=>m,ethers:()=>c,getDefaultProvider:()=>hc,logger:()=>Kc,providers:()=>o,utils:()=>s,version:()=>qc,wordlists:()=>Pi});var n={};r.r(n),r.d(n,{decode:()=>Pe,encode:()=>Te});var i={};r.r(i),r.d(i,{AddressZero:()=>To,EtherSymbol:()=>So,HashZero:()=>ko,MaxInt256:()=>mt,MaxUint256:()=>bt,MinInt256:()=>pt,NegativeOne:()=>ft,One:()=>lt,Two:()=>dt,WeiPerEther:()=>ht,Zero:()=>ut});var o={};r.r(o),r.d(o,{AlchemyProvider:()=>As,AlchemyWebSocketProvider:()=>ws,AnkrProvider:()=>ks,BaseProvider:()=>Ya,CloudflareProvider:()=>Ps,EtherscanProvider:()=>Bs,FallbackProvider:()=>Ys,Formatter:()=>Ea,InfuraProvider:()=>tc,InfuraWebSocketProvider:()=>ec,IpcProvider:()=>Xs,JsonRpcBatchProvider:()=>rc,JsonRpcProvider:()=>fs,JsonRpcSigner:()=>as,NodesmithProvider:()=>ic,PocketProvider:()=>sc,Provider:()=>ir,Resolver:()=>Wa,StaticJsonRpcProvider:()=>ms,UrlJsonRpcProvider:()=>ys,Web3Provider:()=>lc,WebSocketProvider:()=>bs,getDefaultProvider:()=>hc,getNetwork:()=>Oo,isCommunityResourcable:()=>_a,isCommunityResource:()=>Ta,showThrottleMessage:()=>Sa});var a={};r.r(a),r.d(a,{decode:()=>Bo,encode:()=>Fo});var s={};r.r(s),r.d(s,{AbiCoder:()=>Jt,ConstructorFragment:()=>Bt,ErrorFragment:()=>Ut,EventFragment:()=>Ct,FormatTypes:()=>St,Fragment:()=>Mt,FunctionFragment:()=>Ft,HDNode:()=>Ui,Indexed:()=>Zt,Interface:()=>tr,LogDescription:()=>Qt,Logger:()=>g,ParamType:()=>xt,RLP:()=>n,SigningKey:()=>Zr,SupportedAlgorithm:()=>pi,TransactionDescription:()=>Yt,TransactionTypes:()=>rn,UnicodeNormalizationForm:()=>je,Utf8ErrorFuncs:()=>qe,Utf8ErrorReason:()=>ze,_TypedDataEncoder:()=>di,_fetchData:()=>pa,_toEscapedUtf8String:()=>We,accessListify:()=>dn,arrayify:()=>k,base58:()=>bi,base64:()=>a,checkProperties:()=>ie,checkResultErrors:()=>he,commify:()=>Uc,computeAddress:()=>cn,computeHmac:()=>wi,computePublicKey:()=>en,concat:()=>S,deepCopy:()=>fe,defaultAbiCoder:()=>Wt,defaultPath:()=>Di,defineReadOnly:()=>te,dnsEncode:()=>ca,entropyToMnemonic:()=>zi,fetchJson:()=>ma,formatBytes32String:()=>Oc,formatEther:()=>zc,formatUnits:()=>Lc,getAccountPath:()=>qi,getAddress:()=>Oe,getContractAddress:()=>De,getCreate2Address:()=>Ue,getIcapAddress:()=>Fe,getJsonWalletAddress:()=>yo,getStatic:()=>re,hashMessage:()=>Yn,hexConcat:()=>O,hexDataLength:()=>R,hexDataSlice:()=>I,hexStripZeros:()=>F,hexValue:()=>B,hexZeroPad:()=>D,hexlify:()=>C,id:()=>Xe,isAddress:()=>Be,isBytes:()=>T,isBytesLike:()=>E,isHexString:()=>N,isValidMnemonic:()=>Gi,isValidName:()=>aa,joinSignature:()=>L,keccak256:()=>ve,mnemonicToEntropy:()=>ji,mnemonicToSeed:()=>Li,namehash:()=>sa,nameprep:()=>Ic,parseBytes32String:()=>Bc,parseEther:()=>Gc,parseTransaction:()=>gn,parseUnits:()=>jc,poll:()=>ya,randomBytes:()=>Wi,recoverAddress:()=>fn,recoverPublicKey:()=>$r,resolveProperties:()=>ne,ripemd160:()=>yi,serializeTransaction:()=>mn,sha256:()=>gi,sha512:()=>vi,shallowCopy:()=>oe,shuffled:()=>Fs,solidityKeccak256:()=>Ac,solidityPack:()=>wc,soliditySha256:()=>Ec,splitSignature:()=>U,stripZeros:()=>P,toUtf8Bytes:()=>He,toUtf8CodePoints:()=>Ye,toUtf8String:()=>Qe,verifyMessage:()=>Eo,verifyTypedData:()=>_o,zeroPad:()=>x});var c={};r.r(c),r.d(c,{BaseContract:()=>In,BigNumber:()=>V,Contract:()=>On,ContractFactory:()=>Bn,FixedNumber:()=>Jn,Signer:()=>fr,VoidSigner:()=>ur,Wallet:()=>Ao,Wordlist:()=>_i,constants:()=>i,errors:()=>m,getDefaultProvider:()=>hc,logger:()=>Kc,providers:()=>o,utils:()=>s,version:()=>qc,wordlists:()=>Pi});let f=!1,u=!1;const l={debug:1,default:2,info:2,warning:3,error:4,off:5};let d=l.default,h=null;const b=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 p,m;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(p||(p={})),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"}(m||(m={}));const y="0123456789abcdef";class g{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==l[r]&&this.throwArgumentError("invalid log level name","logLevel",e),d>l[r]||console.log.apply(console,t)}debug(...e){this._log(g.levels.DEBUG,e)}info(...e){this._log(g.levels.INFO,e)}warn(...e){this._log(g.levels.WARNING,e)}makeError(e,t,r){if(u)return this.makeError("censored error",t,{});t||(t=g.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+=y[t[e]>>4],r+=y[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 o="";switch(t){case m.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case m.CALL_EXCEPTION:case m.INSUFFICIENT_FUNDS:case m.MISSING_NEW:case m.NONCE_EXPIRED:case m.REPLACEMENT_UNDERPRICED:case m.TRANSACTION_REPLACED:case m.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const a=new Error(e);return a.reason=i,a.code=t,Object.keys(r).forEach((function(e){a[e]=r[e]})),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,g.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"),b&&this.throwError("platform missing String.prototype.normalize",g.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:b})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,g.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,g.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,g.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,g.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",g.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",g.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",g.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return h||(h=new g("logger/5.7.0")),h}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",g.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),f){if(!e)return;this.globalLogger().throwError("error censorship permanent",g.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}u=!!e,f=!!t}static setLogLevel(e){const t=l[e.toLowerCase()];null!=t?d=t:g.globalLogger().warn("invalid log level - "+e)}static from(e){return new g(e)}}g.errors=m,g.levels=p;const v=new g("bytes/5.7.0");function w(e){return!!e.toHexString}function A(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return A(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function E(e){return N(e)&&!(e.length%2)||T(e)}function _(e){return"number"==typeof e&&e==e&&e%1==0}function T(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!_(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!_(r)||r<0||r>=256)return!1}return!0}function k(e,t){if(t||(t={}),"number"==typeof e){v.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),A(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),w(e)&&(e=e.toHexString()),N(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":v.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 A(new Uint8Array(n))}return T(e)?A(new Uint8Array(e)):v.throwArgumentError("invalid arrayify value","value",e)}function S(e){const t=e.map((e=>k(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),A(n)}function P(e){let t=k(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 x(e,t){(e=k(e)).length>t&&v.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),A(r)}function N(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const M="0123456789abcdef";function C(e,t){if(t||(t={}),"number"==typeof e){v.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=M[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),w(e))return e.toHexString();if(N(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":v.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(T(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+=M[(240&n)>>4]+M[15&n]}return t}return v.throwArgumentError("invalid hexlify value","value",e)}function R(e){if("string"!=typeof e)e=C(e);else if(!N(e)||e.length%2)return null;return(e.length-2)/2}function I(e,t,r){return"string"!=typeof e?e=C(e):(!N(e)||e.length%2)&&v.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function O(e){let t="0x";return e.forEach((e=>{t+=C(e).substring(2)})),t}function B(e){const t=F(C(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function F(e){"string"!=typeof e&&(e=C(e)),N(e)||v.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)}function D(e,t){for("string"!=typeof e?e=C(e):N(e)||v.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&v.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function U(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(E(e)){let r=k(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=C(r.slice(0,32)),t.s=C(r.slice(32,64))):65===r.length?(t.r=C(r.slice(0,32)),t.s=C(r.slice(32,64)),t.v=r[64]):v.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:v.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=C(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=x(k(t._vs),32);t._vs=C(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&v.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=C(r);null==t.s?t.s=i:t.s!==i&&v.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?v.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&&v.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&N(t.r)?t.r=D(t.r,32):v.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&N(t.s)?t.s=D(t.s,32):v.throwArgumentError("signature missing or invalid s","signature",e);const r=k(t.s);r[0]>=128&&v.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=C(r);t._vs&&(N(t._vs)||v.throwArgumentError("signature invalid _vs","signature",e),t._vs=D(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&v.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function L(e){return C(S([(e=U(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var j=r(197),z=r.n(j);const G="bignumber/5.7.0";var q=z().BN;const K=new g(G),H={},J=9007199254740991;let W=!1;class V{constructor(e,t){e!==H&&K.throwError("cannot call constructor directly; use BigNumber.from",g.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Y(X(this).fromTwos(e))}toTwos(e){return Y(X(this).toTwos(e))}abs(){return"-"===this._hex[0]?V.from(this._hex.substring(1)):this}add(e){return Y(X(this).add(X(e)))}sub(e){return Y(X(this).sub(X(e)))}div(e){return V.from(e).isZero()&&Z("division-by-zero","div"),Y(X(this).div(X(e)))}mul(e){return Y(X(this).mul(X(e)))}mod(e){const t=X(e);return t.isNeg()&&Z("division-by-zero","mod"),Y(X(this).umod(t))}pow(e){const t=X(e);return t.isNeg()&&Z("negative-power","pow"),Y(X(this).pow(t))}and(e){const t=X(e);return(this.isNegative()||t.isNeg())&&Z("unbound-bitwise-result","and"),Y(X(this).and(t))}or(e){const t=X(e);return(this.isNegative()||t.isNeg())&&Z("unbound-bitwise-result","or"),Y(X(this).or(t))}xor(e){const t=X(e);return(this.isNegative()||t.isNeg())&&Z("unbound-bitwise-result","xor"),Y(X(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Z("negative-width","mask"),Y(X(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Z("negative-width","shl"),Y(X(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Z("negative-width","shr"),Y(X(this).shrn(e))}eq(e){return X(this).eq(X(e))}lt(e){return X(this).lt(X(e))}lte(e){return X(this).lte(X(e))}gt(e){return X(this).gt(X(e))}gte(e){return X(this).gte(X(e))}isNegative(){return"-"===this._hex[0]}isZero(){return X(this).isZero()}toNumber(){try{return X(this).toNumber()}catch(e){Z("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return K.throwError("this platform does not support BigInt",g.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?W||(W=!0,K.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?K.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",g.errors.UNEXPECTED_ARGUMENT,{}):K.throwError("BigNumber.toString does not accept parameters",g.errors.UNEXPECTED_ARGUMENT,{})),X(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof V)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new V(H,Q(e)):e.match(/^-?[0-9]+$/)?new V(H,Q(new q(e))):K.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&Z("underflow","BigNumber.from",e),(e>=J||e<=-J)&&Z("overflow","BigNumber.from",e),V.from(String(e));const t=e;if("bigint"==typeof t)return V.from(t.toString());if(T(t))return V.from(C(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return V.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(N(e)||"-"===e[0]&&N(e.substring(1))))return V.from(e)}return K.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Q(e){if("string"!=typeof e)return Q(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&K.throwArgumentError("invalid hex","value",e),"0x00"===(e=Q(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 Y(e){return V.from(Q(e))}function X(e){const t=V.from(e).toHexString();return"-"===t[0]?new q("-"+t.substring(3),16):new q(t.substring(2),16)}function Z(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),K.throwError(e,g.errors.NUMERIC_FAULT,n)}var $=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ee=new g("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 $(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 oe(e){const t={};for(const r in e)t[r]=e[r];return t}const ae={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function se(e){if(null==e||ae[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(!se(n))return!1}return!0}return ee.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ce(e){if(se(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>fe(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&te(t,r,fe(n))}return t}return ee.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function fe(e){return ce(e)}class ue{constructor(e){for(const t in e)this[t]=fe(e[t])}}const le="abi/5.7.0",de=new g(le);function he(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const o=e.slice();o.push(i);try{r(o,n[i])}catch(e){t.push({path:o,error:e})}}};return r([],e),t}class be{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){de.throwArgumentError(e,this.localName,t)}}class pe{constructor(e){te(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return O(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(S(e._data))}writeBytes(e){let t=k(e);const r=t.length%this.wordSize;return r&&(t=S([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=k(V.from(e));return t.length>this.wordSize&&de.throwError("value out-of-bounds",g.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=S([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 me{constructor(e,t,r,n){te(this,"_data",k(e)),te(this,"wordSize",t||32),te(this,"_coerceFunc",r),te(this,"allowLoose",n),this._offset=0}get data(){return C(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):me.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:de.throwError("data out-of-bounds",g.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new me(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 V.from(this.readBytes(this.wordSize))}}var ye=r(669),ge=r.n(ye);function ve(e){return"0x"+ge().keccak_256(k(e))}const we=new g("rlp/5.7.0");function Ae(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function Ee(e,t,r){let n=0;for(let i=0;i<r;i++)n=256*n+e[t+i];return n}function _e(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(_e(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=Ae(t.length);return r.unshift(247+r.length),r.concat(t)}E(e)||we.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(k(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=Ae(t.length);return r.unshift(183+r.length),r.concat(t)}function Te(e){return C(_e(e))}function ke(e,t,r,n){const i=[];for(;r<t+1+n;){const o=Se(e,r);i.push(o.result),(r+=o.consumed)>t+1+n&&we.throwError("child data too short",g.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function Se(e,t){if(0===e.length&&we.throwError("data too short",g.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&we.throwError("data short segment too short",g.errors.BUFFER_OVERRUN,{});const n=Ee(e,t+1,r);return t+1+r+n>e.length&&we.throwError("data long segment too short",g.errors.BUFFER_OVERRUN,{}),ke(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&we.throwError("data array too short",g.errors.BUFFER_OVERRUN,{}),ke(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&we.throwError("data array too short",g.errors.BUFFER_OVERRUN,{});const n=Ee(e,t+1,r);return t+1+r+n>e.length&&we.throwError("data array too short",g.errors.BUFFER_OVERRUN,{}),{consumed:1+r+n,result:C(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;return t+1+r>e.length&&we.throwError("data too short",g.errors.BUFFER_OVERRUN,{}),{consumed:1+r,result:C(e.slice(t+1,t+1+r))}}return{consumed:1,result:C(e[t])}}function Pe(e){const t=k(e),r=Se(t,0);return r.consumed!==t.length&&we.throwArgumentError("invalid rlp data","data",e),r.result}const xe=new g("address/5.7.0");function Ne(e){N(e,20)||xe.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=k(ve(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 Me={};for(let e=0;e<10;e++)Me[String(e)]=String(e);for(let e=0;e<26;e++)Me[String.fromCharCode(65+e)]=String(10+e);const Ce=Math.floor((Re=9007199254740991,Math.log10?Math.log10(Re):Math.log(Re)/Math.LN10));var Re;function Ie(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>Me[e])).join("");for(;t.length>=Ce;){let e=t.substring(0,Ce);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}function Oe(e){let t=null;if("string"!=typeof e&&xe.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=Ne(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&xe.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)!==Ie(e)&&xe.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new q(r,36).toString(16);t.length<40;)t="0"+t;t=Ne("0x"+t)}else xe.throwArgumentError("invalid address","address",e);var r;return t}function Be(e){try{return Oe(e),!0}catch(e){}return!1}function Fe(e){let t=(r=Oe(e).substring(2),new q(r,16).toString(36)).toUpperCase();for(var r;t.length<30;)t="0"+t;return"XE"+Ie("XE00"+t)+t}function De(e){let t=null;try{t=Oe(e.from)}catch(t){xe.throwArgumentError("missing from address","transaction",e)}return Oe(I(ve(Te([t,P(k(V.from(e.nonce).toHexString()))])),12))}function Ue(e,t,r){return 32!==R(t)&&xe.throwArgumentError("salt must be 32 bytes","salt",t),32!==R(r)&&xe.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Oe(I(ve(S(["0xff",Oe(e),t,r])),12))}const Le=new g("strings/5.7.0");var je,ze;function Ge(e,t,r,n,i){if(e===ze.BAD_PREFIX||e===ze.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===ze.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(je||(je={})),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"}(ze||(ze={}));const qe=Object.freeze({error:function(e,t,r,n,i){return Le.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Ge,replace:function(e,t,r,n,i){return e===ze.OVERLONG?(n.push(i),0):(n.push(65533),Ge(e,t,r))}});function Ke(e,t){null==t&&(t=qe.error),e=k(e);const r=[];let n=0;for(;n<e.length;){const i=e[n++];if(i>>7==0){r.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?ze.UNEXPECTED_CONTINUE:ze.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length){n+=t(ze.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i<o;i++){let i=e[n];if(128!=(192&i)){n+=t(ze.MISSING_CONTINUE,n,e,r),s=null;break}s=s<<6|63&i,n++}null!==s&&(s>1114111?n+=t(ze.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(ze.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(ze.OVERLONG,n-1-o,e,r,s):r.push(s))}return r}function He(e,t=je.current){t!=je.current&&(Le.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 o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return k(r)}function Je(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function We(e,t){return'"'+Ke(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Je(e):Je(55296+((e-=65536)>>10&1023))+Je(56320+(1023&e))})).join("")+'"'}function Ve(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Qe(e,t){return Ve(Ke(e,t))}function Ye(e,t=je.current){return Ke(He(e,t))}function Xe(e){return ve(He(e))}class Ze extends be{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=Oe(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return Oe(D(e.readValue().toHexString(),20))}}class $e extends be{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 et=new g(le);function tt(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||et.throwError("cannot encode object for signature with missing names",g.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&et.throwError("cannot encode object for signature with duplicate names",g.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else et.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&et.throwArgumentError("types/value length mismatch","tuple",r);let i=new pe(e.wordSize),o=new pe(e.wordSize),a=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=o.length;e.encode(o,r);let n=i.writeUpdatableValue();a.push((e=>{n(e+t)}))}else e.encode(i,r)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function rt(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),o=n.subReader(r.toNumber());try{i=t.decode(o)}catch(e){if(e.code===g.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===g.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 o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));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 nt extends be{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)),et.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 tt(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&et.throwError("insufficient data length",g.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e<t;e++)r.push(new $e(this.coder));return e.coerce(this.name,rt(e,r))}}class it extends be{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 ot extends be{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=k(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class at extends ot{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,C(super.decode(e)))}}class st extends be{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=k(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,C(e.readBytes(this.size)))}}class ct extends be{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 ft=V.from(-1),ut=V.from(0),lt=V.from(1),dt=V.from(2),ht=V.from("1000000000000000000"),bt=V.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),pt=V.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),mt=V.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class yt extends be{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=V.from(t),n=bt.mask(8*e.wordSize);if(this.signed){let e=n.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(lt).mul(ft)))&&this._throwError("value out-of-bounds",t)}else(r.lt(ut)||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)}}class gt extends ot{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,He(t))}decode(e){return Qe(super.decode(e))}}class vt extends be{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 tt(e,this.coders,t)}decode(e){return e.coerce(this.name,rt(e,this.coders))}}const wt=new g(le),At={};let Et={calldata:!0,memory:!0,storage:!0},_t={calldata:!0,memory:!0};function Tt(e,t){if("bytes"===e||"string"===e){if(Et[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&_t[t])return!0;return(Et[t]||"payable"===t)&&wt.throwArgumentError("invalid modifier","name",t),!1}function kt(e,t){for(let r in t)te(e,r,t[r])}const St=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Pt=new RegExp(/^(.*)\[([0-9]*)\]$/);class xt{constructor(e,t){e!==At&&wt.throwError("use fromString",g.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),kt(this,t);let r=this.type.match(Pt);kt(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=St.sighash),St[e]||wt.throwArgumentError("invalid format type","format",e),e===St.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!==St.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===St.full?", ":",")+")"):t+=this.type,e!==St.sighash&&(!0===this.indexed&&(t+=" indexed"),e===St.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(At,{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){wt.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 o={type:"",name:"",state:{allowType:!0}},a=o;for(let r=0;r<e.length;r++){let o=e[r];switch(o){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||n(r),a.state.allowType=!1,a.type=Lt(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(t||n(r),a.indexed=!0,a.name=""),Tt(a.type,a.name)&&(a.name=""),a.type=Lt(a.type);let e=a;a=a.parent,a||n(r),delete e.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(t||n(r),a.indexed=!0,a.name=""),Tt(a.type,a.name)&&(a.name=""),a.type=Lt(a.type);let s=i(a.parent);a.parent.components.push(s),delete a.parent,a=s;break;case" ":a.state.allowType&&""!==a.type&&(a.type=Lt(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(t||n(r),a.indexed&&n(r),a.indexed=!0,a.name=""):Tt(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||n(r),a.type+=o,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||n(r),a.type+=o,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=o,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=o,delete a.state.allowArray):a.state.readArray?a.type+=o:n(r)}}return a.parent&&wt.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===a.name?(t||n(r.length-7),a.indexed&&n(r.length-7),a.indexed=!0,a.name=""):Tt(a.type,a.name)&&(a.name=""),o.type=Lt(o.type),o}(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 Nt(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let i=0;i<e.length;i++){let o=e[i];","===o&&0===n?(t.push(r),r=""):(r+=o,"("===o?n++:")"===o&&(n--,-1===n&&wt.throwArgumentError("unbalanced parenthesis","value",e)))}return r&&t.push(r),t}(e).map((e=>xt.fromString(e,t)))}class Mt{constructor(e,t){e!==At&&wt.throwError("use a static from method",g.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),kt(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Mt.isFragment(e)?e:"string"==typeof e?Mt.fromString(e):Mt.fromObject(e)}static fromObject(e){if(Mt.isFragment(e))return e;switch(e.type){case"function":return Ft.fromObject(e);case"event":return Ct.fromObject(e);case"constructor":return Bt.fromObject(e);case"error":return Ut.fromObject(e);case"fallback":case"receive":return null}return wt.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]?Ct.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Ft.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Bt.fromString(e.trim()):"error"===e.split(" ")[0]?Ut.fromString(e.substring(5).trim()):wt.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Ct extends Mt{format(e){if(e||(e=St.sighash),St[e]||wt.throwArgumentError("invalid format type","format",e),e===St.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!==St.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===St.full?", ":",")+") ",e!==St.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Ct.fromString(e):Ct.fromObject(e)}static fromObject(e){if(Ct.isEventFragment(e))return e;"event"!==e.type&&wt.throwArgumentError("invalid event object","value",e);const t={name:zt(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(xt.fromObject):[],type:"event"};return new Ct(At,t)}static fromString(e){let t=e.match(Gt);t||wt.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:wt.warn("unknown modifier: "+e)}})),Ct.fromObject({name:t[1].trim(),anonymous:r,inputs:Nt(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Rt(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&wt.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||wt.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=V.from(r[1]),r[0]):e}function It(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 Ot(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&&wt.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&wt.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||wt.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&&wt.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&&wt.throwArgumentError("unable to determine stateMutability","value",e),t}class Bt extends Mt{format(e){if(e||(e=St.sighash),St[e]||wt.throwArgumentError("invalid format type","format",e),e===St.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===St.sighash&&wt.throwError("cannot format a constructor for sighash",g.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===St.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?Bt.fromString(e):Bt.fromObject(e)}static fromObject(e){if(Bt.isConstructorFragment(e))return e;"constructor"!==e.type&&wt.throwArgumentError("invalid constructor object","value",e);let t=Ot(e);t.constant&&wt.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?V.from(e.gas):null};return new Bt(At,r)}static fromString(e){let t={type:"constructor"},r=(e=Rt(e,t)).match(Gt);return r&&"constructor"===r[1].trim()||wt.throwArgumentError("invalid constructor string","value",e),t.inputs=Nt(r[2].trim(),!1),It(r[3].trim(),t),Bt.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Ft extends Bt{format(e){if(e||(e=St.sighash),St[e]||wt.throwArgumentError("invalid format type","format",e),e===St.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!==St.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===St.full?", ":",")+") ",e!==St.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?Ft.fromString(e):Ft.fromObject(e)}static fromObject(e){if(Ft.isFunctionFragment(e))return e;"function"!==e.type&&wt.throwArgumentError("invalid function object","value",e);let t=Ot(e);const r={type:e.type,name:zt(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?V.from(e.gas):null};return new Ft(At,r)}static fromString(e){let t={type:"function"},r=(e=Rt(e,t)).split(" returns ");r.length>2&&wt.throwArgumentError("invalid function string","value",e);let n=r[0].match(Gt);if(n||wt.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&zt(t.name),t.inputs=Nt(n[2],!1),It(n[3].trim(),t),r.length>1){let n=r[1].match(Gt);""==n[1].trim()&&""==n[3].trim()||wt.throwArgumentError("unexpected tokens","value",e),t.outputs=Nt(n[2],!1)}else t.outputs=[];return Ft.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function Dt(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||wt.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Ut extends Mt{format(e){if(e||(e=St.sighash),St[e]||wt.throwArgumentError("invalid format type","format",e),e===St.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==St.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===St.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Ut.fromString(e):Ut.fromObject(e)}static fromObject(e){if(Ut.isErrorFragment(e))return e;"error"!==e.type&&wt.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:zt(e.name),inputs:e.inputs?e.inputs.map(xt.fromObject):[]};return Dt(new Ut(At,t))}static fromString(e){let t={type:"error"},r=e.match(Gt);return r||wt.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&zt(t.name),t.inputs=Nt(r[2],!1),Dt(Ut.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 jt=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function zt(e){return e&&e.match(jt)||wt.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Gt=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),qt=new g(le),Kt=new RegExp(/^bytes([0-9]*)$/),Ht=new RegExp(/^(u?int)([0-9]*)$/);class Jt{constructor(e){te(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Ze(e.name);case"bool":return new it(e.name);case"string":return new gt(e.name);case"bytes":return new at(e.name);case"array":return new nt(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new vt((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new ct(e.name)}let t=e.type.match(Ht);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 yt(r/8,"int"===t[1],e.name)}if(t=e.type.match(Kt),t){let r=parseInt(t[1]);return(0===r||r>32)&&qt.throwArgumentError("invalid bytes length","param",e),new st(r,e.name)}return qt.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new me(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new pe(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(xt.from(e))));return new vt(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&qt.throwError("types/values length mismatch",g.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 vt(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 vt(n,"_").decode(this._getReader(k(t),r))}}const Wt=new Jt,Vt=new g(le);class Qt extends ue{}class Yt extends ue{}class Xt extends ue{}class Zt extends ue{static isIndexed(e){return!(!e||!e._isIndexed)}}const $t={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function er(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class tr{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,te(this,"fragments",t.map((e=>Mt.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 Vt.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]?Vt.warn("duplicate definition - "+r):t[r]=e})),this.deploy||te(this,"deploy",Bt.from({payable:!1,type:"constructor"})),te(this,"_isInterface",!0)}format(e){e||(e=St.full),e===St.sighash&&Vt.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===St.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return Wt}static getAddress(e){return Oe(e)}static getSighash(e){return I(Xe(e.format()),0,4)}static getEventTopic(e){return Xe(e.format())}getFunction(e){if(N(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];Vt.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?Vt.throwArgumentError("no matching function","name",t):r.length>1&&Vt.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Ft.fromString(e).format()];return t||Vt.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(N(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];Vt.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?Vt.throwArgumentError("no matching event","name",t):r.length>1&&Vt.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[Ct.fromString(e).format()];return t||Vt.throwArgumentError("no matching event","signature",e),t}getError(e){if(N(e)){const t=re(this.constructor,"getSighash");for(const r in this.errors)if(e===t(this.errors[r]))return this.errors[r];Vt.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?Vt.throwArgumentError("no matching error","name",t):r.length>1&&Vt.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Ft.fromString(e).format()];return t||Vt.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=k(t);return C(r.slice(0,4))!==this.getSighash(e)&&Vt.throwArgumentError(`data signature does not match error ${e.name}.`,"data",C(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),C(S([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=k(t);return C(r.slice(0,4))!==this.getSighash(e)&&Vt.throwArgumentError(`data signature does not match function ${e.name}.`,"data",C(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),C(S([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=k(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=C(r.slice(0,4)),t=$t[e];if(t)o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.signature,t.reason&&(n=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return Vt.throwError("call revert exception"+i,g.errors.CALL_EXCEPTION,{method:e.format(),data:C(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),C(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Vt.throwError("too many arguments for "+e.format(),g.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?Xe(t):"bytes"===e.type?ve(C(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=V.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),D(C(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?Vt.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map((e=>n(o,e)))):r.push(n(o,t)):null!=t&&Vt.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.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&&Vt.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)r.push(Xe(a));else if("bytes"===e.type)r.push(ve(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[a]))}else n.push(e),i.push(a)})),{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);N(r[0],32)&&r[0].toLowerCase()===t||Vt.throwError("fragment/topic mismatch",g.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];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})),o.push(!0)):(n.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=r?this._abiCoder.decode(n,S(r)):null,s=this._abiCoder.decode(i,t,!0),c=[],f=0,u=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)c[t]=new Zt({_isIndexed:!0,hash:null});else if(o[t])c[t]=new Zt({_isIndexed:!0,hash:a[u++]});else try{c[t]=a[u++]}catch(e){c[t]=e}else try{c[t]=s[f++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw er(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e<c.length;e++){const t=c[e];t instanceof Error&&Object.defineProperty(c,e,{enumerable:!0,get:()=>{throw er(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Yt({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:V.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Qt({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=C(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new Xt({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)}}const rr=new g("abstract-provider/5.7.0");class nr extends ue{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class ir{constructor(){rr.checkAbstract(new.target,ir),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=V.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,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((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)}}var or=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ar=new g("abstract-signer/5.7.0"),sr=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],cr=[g.errors.INSUFFICIENT_FUNDS,g.errors.NONCE_EXPIRED,g.errors.REPLACEMENT_UNDERPRICED];class fr{constructor(){ar.checkAbstract(new.target,fr),te(this,"_isSigner",!0)}getBalance(e){return or(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return or(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return or(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 or(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 or(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 or(this,void 0,void 0,(function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return or(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return or(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return or(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===sr.indexOf(t)&&ar.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=oe(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()&&ar.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return or(this,void 0,void 0,(function*(){const t=yield ne(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>or(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&ar.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||ar.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):ar.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&&ar.throwError("network does not support EIP-1559",g.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):ar.throwError("failed to get consistent fee data",g.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(cr.indexOf(e.code)>=0)throw e;return ar.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",g.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]&&ar.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield ne(t)}))}_checkProvider(e){this.provider||ar.throwError("missing provider",g.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class ur extends fr{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((()=>{ar.throwError(e,g.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 ur(this.address,e)}}var lr=r(485),dr=r.n(lr);function hr(e,t,r){return 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)}},e(r,r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var br=pr;function pr(e,t){if(!e)throw new Error(t||"Assertion failed")}pr.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var mr=hr((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),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),yr=hr((function(e,t){var r=t;r.assert=br,r.toArray=mr.toArray,r.zero2=mr.zero2,r.toHex=mr.toHex,r.encode=mr.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,o=e.clone(),a=0;a<n.length;a++){var s,c=o.andln(i-1);o.isOdd()?(s=c>(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,f=t.andln(3)+o&3;3===c&&(c=-1),3===f&&(f=-1),a=0==(1&c)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==f?c:-c,r[0].push(a),s=0==(1&f)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==c?f:-f,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),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(z())(e,"hex","le")}})),gr=yr.getNAF,vr=yr.getJSF,wr=yr.assert;function Ar(e,t){this.type=e,this.p=new(z())(t.p,16),this.red=t.prime?z().red(t.prime):z().mont(this.p),this.zero=new(z())(0).toRed(this.red),this.one=new(z())(1).toRed(this.red),this.two=new(z())(2).toRed(this.red),this.n=t.n&&new(z())(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 Er=Ar;function _r(e,t){this.curve=e,this.type=t,this.precomputed=null}Ar.prototype.point=function(){throw new Error("Not implemented")},Ar.prototype.validate=function(){throw new Error("Not implemented")},Ar.prototype._fixedNafMul=function(e,t){wr(e.precomputed);var r=e._getDoubles(),n=gr(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<n.length;o+=r.step){a=0;for(var c=o+r.step-1;c>=o;c--)a=(a<<1)+n[c];s.push(a)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=i;l>0;l--){for(o=0;o<s.length;o++)(a=s[o])===l?u=u.mixedAdd(r.points[o]):a===-l&&(u=u.mixedAdd(r.points[o].neg()));f=f.add(u)}return f.toP()},Ar.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=gr(t,r,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var f=o[s];wr(0!==f),a="affine"===e.type?f>0?a.mixedAdd(i[f-1>>1]):a.mixedAdd(i[-f-1>>1].neg()):f>0?a.add(i[f-1>>1]):a.add(i[-f-1>>1].neg())}return"affine"===e.type?a.toP():a},Ar.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,f=this._wnafT2,u=this._wnafT3,l=0;for(o=0;o<n;o++){var d=(s=t[o])._getNAFPoints(e);c[o]=d.wnd,f[o]=d.points}for(o=n-1;o>=1;o-=2){var h=o-1,b=o;if(1===c[h]&&1===c[b]){var p=[t[h],null,null,t[b]];0===t[h].y.cmp(t[b].y)?(p[1]=t[h].add(t[b]),p[2]=t[h].toJ().mixedAdd(t[b].neg())):0===t[h].y.cmp(t[b].y.redNeg())?(p[1]=t[h].toJ().mixedAdd(t[b]),p[2]=t[h].add(t[b].neg())):(p[1]=t[h].toJ().mixedAdd(t[b]),p[2]=t[h].toJ().mixedAdd(t[b].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=vr(r[h],r[b]);for(l=Math.max(y[0].length,l),u[h]=new Array(l),u[b]=new Array(l),a=0;a<l;a++){var g=0|y[0][a],v=0|y[1][a];u[h][a]=m[3*(g+1)+(v+1)],u[b][a]=0,f[h]=p}}else u[h]=gr(r[h],c[h],this._bitLength),u[b]=gr(r[b],c[b],this._bitLength),l=Math.max(u[h].length,l),l=Math.max(u[b].length,l)}var w=this.jpoint(null,null,null),A=this._wnafT4;for(o=l;o>=0;o--){for(var E=0;o>=0;){var _=!0;for(a=0;a<n;a++)A[a]=0|u[a][o],0!==A[a]&&(_=!1);if(!_)break;E++,o--}if(o>=0&&E++,w=w.dblp(E),o<0)break;for(a=0;a<n;a++){var T=A[a];0!==T&&(T>0?s=f[a][T-1>>1]:T<0&&(s=f[a][-T-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o<n;o++)f[o]=null;return i?w:w.toP()},Ar.BasePoint=_r,_r.prototype.eq=function(){throw new Error("Not implemented")},_r.prototype.validate=function(){return this.curve.validate(this)},Ar.prototype.decodePoint=function(e,t){e=yr.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]?wr(e[e.length-1]%2==0):7===e[0]&&wr(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")},_r.prototype.encodeCompressed=function(e){return this.encode(e,!0)},_r.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))},_r.prototype.encode=function(e,t){return yr.encode(this._encode(t),e)},_r.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},_r.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)},_r.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 o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},_r.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}},_r.prototype._getBeta=function(){return null},_r.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var Tr=hr((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}}})),kr=yr.assert;function Sr(e){Er.call(this,"short",e),this.a=new(z())(e.a,16).toRed(this.red),this.b=new(z())(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)}Tr(Sr,Er);var Pr=Sr;function xr(e,t,r,n){Er.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(z())(t,16),this.y=new(z())(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 Nr(e,t,r,n){Er.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(z())(0)):(this.x=new(z())(t,16),this.y=new(z())(r,16),this.z=new(z())(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}Sr.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new(z())(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(z())(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],kr(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(z())(e.a,16),b:new(z())(e.b,16)}})):this._getEndoBasis(r)}}},Sr.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:z().mont(e),r=new(z())(2).toRed(t).redInvm(),n=r.redNeg(),i=new(z())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},Sr.prototype._getEndoBasis=function(e){for(var t,r,n,i,o,a,s,c,f,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,d=this.n.clone(),h=new(z())(1),b=new(z())(0),p=new(z())(0),m=new(z())(1),y=0;0!==l.cmpn(0);){var g=d.div(l);c=d.sub(g.mul(l)),f=p.sub(g.mul(h));var v=m.sub(g.mul(b));if(!n&&c.cmp(u)<0)t=s.neg(),r=h,n=c.neg(),i=f;else if(n&&2==++y)break;s=c,d=l,l=c,p=h,h=f,m=b,b=v}o=c.neg(),a=f;var w=n.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},Sr.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),f=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(f).neg()}},Sr.prototype.pointFromX=function(e,t){(e=new(z())(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)},Sr.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)},Sr.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],c=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),c=c.neg(!0)),n[2*o]=s,n[2*o+1]=c,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var f=this._wnafMulAdd(1,n,i,2*o,r),u=0;u<2*o;u++)n[u]=null,i[u]=null;return f},Tr(xr,Er.BasePoint),Sr.prototype.point=function(e,t,r){return new xr(this,e,t,r)},Sr.prototype.pointFromJSON=function(e,t){return xr.fromJSON(this,e,t)},xr.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}},xr.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]},xr.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 o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},xr.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)+">"},xr.prototype.isInfinity=function(){return this.inf},xr.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)},xr.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),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},xr.prototype.getX=function(){return this.x.fromRed()},xr.prototype.getY=function(){return this.y.fromRed()},xr.prototype.mul=function(e){return e=new(z())(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)},xr.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)},xr.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)},xr.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))},xr.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},xr.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Tr(Nr,Er.BasePoint),Sr.prototype.jpoint=function(e,t,r){return new Nr(this,e,t,r)},Nr.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)},Nr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Nr.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),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),u=f.redMul(s),l=n.redMul(f),d=c.redSqr().redIAdd(u).redISub(l).redISub(l),h=c.redMul(l.redISub(d)).redISub(o.redMul(u)),b=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,b)},Nr.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,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),f=c.redMul(a),u=r.redMul(c),l=s.redSqr().redIAdd(f).redISub(u).redISub(u),d=s.redMul(u.redISub(l)).redISub(i.redMul(f)),h=this.z.redMul(a);return this.curve.jpoint(l,d,h)},Nr.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,o=this.x,a=this.y,s=this.z,c=s.redSqr().redSqr(),f=a.redAdd(a);for(t=0;t<e;t++){var u=o.redSqr(),l=f.redSqr(),d=l.redSqr(),h=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(c)),b=o.redMul(l),p=h.redSqr().redISub(b.redAdd(b)),m=b.redISub(p),y=h.redMul(m);y=y.redIAdd(y).redISub(d);var g=f.redMul(s);t+1<e&&(c=c.redMul(d)),o=p,s=g,f=y}return this.curve.jpoint(o,f.redMul(i),s)},Nr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Nr.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),c=s.redSqr().redISub(a).redISub(a),f=o.redIAdd(o);f=(f=f.redIAdd(f)).redIAdd(f),e=c,t=s.redMul(a.redISub(c)).redISub(f),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),l=this.y.redSqr(),d=l.redSqr(),h=this.x.redAdd(l).redSqr().redISub(u).redISub(d);h=h.redIAdd(h);var b=u.redAdd(u).redIAdd(u),p=b.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=p.redISub(h).redISub(h),t=b.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},Nr.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=s.redSqr().redISub(a).redISub(a);e=c;var f=o.redIAdd(o);f=(f=f.redIAdd(f)).redIAdd(f),t=s.redMul(a.redISub(c)).redISub(f),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),l=this.y.redSqr(),d=this.x.redMul(l),h=this.x.redSub(u).redMul(this.x.redAdd(u));h=h.redAdd(h).redIAdd(h);var b=d.redIAdd(d),p=(b=b.redIAdd(b)).redAdd(b);e=h.redSqr().redISub(p),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(u);var m=l.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(b.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},Nr.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),f=(c=c.redIAdd(c)).redMul(a),u=s.redSqr().redISub(f.redAdd(f)),l=f.redISub(u),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=s.redMul(l).redISub(d),b=r.redAdd(r).redMul(n);return this.curve.jpoint(u,h,b)},Nr.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),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var f=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(c),u=t.redMul(f);u=(u=u.redIAdd(u)).redIAdd(u);var l=this.x.redMul(s).redISub(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.y.redMul(f.redMul(c.redISub(f)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(l,d,h)},Nr.prototype.mul=function(e,t){return e=new(z())(e,t),this.curve._wnafMul(this,e)},Nr.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)},Nr.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}},Nr.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)+">"},Nr.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Mr=hr((function(e,t){var r=t;r.base=Er,r.short=Pr,r.mont=null,r.edwards=null})),Cr=hr((function(e,t){var r,n=t,i=yr.assert;function o(e){"short"===e.type?this.curve=new Mr.short(e):"edwards"===e.type?this.curve=new Mr.edwards(e):this.curve=new Mr.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 a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:dr().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:dr().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:dr().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:dr().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"]}),a("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:dr().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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:dr().sha256,gRed:!1,g:["9"]}),a("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:dr().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}a("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:dr().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Rr(e){if(!(this instanceof Rr))return new Rr(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=mr.toArray(e.entropy,e.entropyEnc||"hex"),r=mr.toArray(e.nonce,e.nonceEnc||"hex"),n=mr.toArray(e.pers,e.persEnc||"hex");br(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Ir=Rr;Rr.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},Rr.prototype._hmac=function(){return new(dr().hmac)(this.hash,this.K)},Rr.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())},Rr.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=mr.toArray(e,t),r=mr.toArray(r,n),br(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Rr.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=mr.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 o=i.slice(0,e);return this._update(r),this._reseed++,mr.encode(o,t)};var Or=yr.assert;function Br(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 Fr=Br;Br.fromPublic=function(e,t,r){return t instanceof Br?t:new Br(e,{pub:t,pubEnc:r})},Br.fromPrivate=function(e,t,r){return t instanceof Br?t:new Br(e,{priv:t,privEnc:r})},Br.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"}},Br.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},Br.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},Br.prototype._importPrivate=function(e,t){this.priv=new(z())(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Br.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?Or(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Or(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)},Br.prototype.derive=function(e){return e.validate()||Or(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Br.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},Br.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},Br.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Dr=yr.assert;function Ur(e,t){if(e instanceof Ur)return e;this._importDER(e,t)||(Dr(e.r&&e.s,"Signature without r or s"),this.r=new(z())(e.r,16),this.s=new(z())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Lr=Ur;function jr(){this.place=0}function zr(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,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function Gr(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 qr(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)}}Ur.prototype._importDER=function(e,t){e=yr.toArray(e,t);var r=new jr;if(48!==e[r.place++])return!1;var n=zr(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=zr(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=zr(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new(z())(o),this.s=new(z())(s),this.recoveryParam=null,!0},Ur.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=Gr(t),r=Gr(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];qr(n,t.length),(n=n.concat(t)).push(2),qr(n,r.length);var i=n.concat(r),o=[48];return qr(o,i.length),o=o.concat(i),yr.encode(o,e)};var Kr=function(){throw new Error("unsupported")},Hr=yr.assert;function Jr(e){if(!(this instanceof Jr))return new Jr(e);"string"==typeof e&&(Hr(Object.prototype.hasOwnProperty.call(Cr,e),"Unknown curve "+e),e=Cr[e]),e instanceof Cr.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 Wr=Jr;Jr.prototype.keyPair=function(e){return new Fr(this,e)},Jr.prototype.keyFromPrivate=function(e,t){return Fr.fromPrivate(this,e,t)},Jr.prototype.keyFromPublic=function(e,t){return Fr.fromPublic(this,e,t)},Jr.prototype.genKeyPair=function(e){e||(e={});for(var t=new Ir({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Kr(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(z())(2));;){var i=new(z())(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Jr.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},Jr.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(z())(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Ir({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new(z())(1)),f=0;;f++){var u=n.k?n.k(f):new(z())(s.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(c)>=0)){var l=this.g.mul(u);if(!l.isInfinity()){var d=l.getX(),h=d.umod(this.n);if(0!==h.cmpn(0)){var b=u.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var p=(l.getY().isOdd()?1:0)|(0!==d.cmp(h)?2:0);return n.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),p^=1),new Lr({r:h,s:b,recoveryParam:p})}}}}}},Jr.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(z())(e,16)),r=this.keyFromPublic(r,n);var i=(t=new Lr(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),f=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),f)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Jr.prototype.recoverPubKey=function(e,t,r,n){Hr((3&r)===r,"The recovery param is more than two bits"),t=new Lr(t,n);var i=this.n,o=new(z())(e),a=t.r,s=t.s,c=1&r,f=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var u=t.r.invm(i),l=i.sub(o).mul(u).umod(i),d=s.mul(u).umod(i);return this.g.mulAdd(l,a,d)},Jr.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Lr(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Vr=hr((function(e,t){var r=t;r.version="6.5.4",r.utils=yr,r.rand=function(){throw new Error("unsupported")},r.curve=Mr,r.curves=Cr,r.ec=Wr,r.eddsa=null})).ec;const Qr=new g("signing-key/5.7.0");let Yr=null;function Xr(){return Yr||(Yr=new Vr("secp256k1")),Yr}class Zr{constructor(e){te(this,"curve","secp256k1"),te(this,"privateKey",C(e)),32!==R(this.privateKey)&&Qr.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=Xr().keyFromPrivate(k(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=Xr().keyFromPublic(k(this.publicKey)),r=Xr().keyFromPublic(k(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=Xr().keyFromPrivate(k(this.privateKey)),r=k(e);32!==r.length&&Qr.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return U({recoveryParam:n.recoveryParam,r:D("0x"+n.r.toString(16),32),s:D("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=Xr().keyFromPrivate(k(this.privateKey)),r=Xr().keyFromPublic(k(en(e)));return D("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function $r(e,t){const r=U(t),n={r:k(r.r),s:k(r.s)};return"0x"+Xr().recoverPubKey(k(e),n,r.recoveryParam).encode("hex",!1)}function en(e,t){const r=k(e);if(32===r.length){const e=new Zr(r);return t?"0x"+Xr().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?C(r):"0x"+Xr().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+Xr().keyFromPublic(r).getPublic(!0,"hex"):C(r):Qr.throwArgumentError("invalid public or private key","key","[REDACTED]")}const tn=new g("transactions/5.7.0");var rn;function nn(e){return"0x"===e?null:Oe(e)}function on(e){return"0x"===e?ut:V.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(rn||(rn={}));const an=[{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"}],sn={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function cn(e){return Oe(I(ve(I(en(e),1)),12))}function fn(e,t){return cn($r(k(e),t))}function un(e,t){const r=P(V.from(e).toHexString());return r.length>32&&tn.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function ln(e,t){return{address:Oe(e),storageKeys:(t||[]).map(((t,r)=>(32!==R(t)&&tn.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function dn(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&tn.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),ln(e[0],e[1])):ln(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return ln(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function hn(e){return dn(e).map((e=>[e.address,e.storageKeys]))}function bn(e,t){if(null!=e.gasPrice){const t=V.from(e.gasPrice),r=V.from(e.maxFeePerGas||0);t.eq(r)||tn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[un(e.chainId||0,"chainId"),un(e.nonce||0,"nonce"),un(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),un(e.maxFeePerGas||0,"maxFeePerGas"),un(e.gasLimit||0,"gasLimit"),null!=e.to?Oe(e.to):"0x",un(e.value||0,"value"),e.data||"0x",hn(e.accessList||[])];if(t){const e=U(t);r.push(un(e.recoveryParam,"recoveryParam")),r.push(P(e.r)),r.push(P(e.s))}return O(["0x02",Te(r)])}function pn(e,t){const r=[un(e.chainId||0,"chainId"),un(e.nonce||0,"nonce"),un(e.gasPrice||0,"gasPrice"),un(e.gasLimit||0,"gasLimit"),null!=e.to?Oe(e.to):"0x",un(e.value||0,"value"),e.data||"0x",hn(e.accessList||[])];if(t){const e=U(t);r.push(un(e.recoveryParam,"recoveryParam")),r.push(P(e.r)),r.push(P(e.s))}return O(["0x01",Te(r)])}function mn(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&tn.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){ie(e,sn);const r=[];an.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=k(C(n,i)),t.length&&n.length!==t.length&&n.length>0&&tn.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=P(n),n.length>t.maxLength&&tn.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(C(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&tn.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!E(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(C(n)),r.push("0x"),r.push("0x")),!t)return Te(r);const i=U(t);let o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&tn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&tn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(C(o)),r.push(P(k(i.r))),r.push(P(k(i.s))),Te(r)}(e,t);switch(e.type){case 1:return pn(e,t);case 2:return bn(e,t)}return tn.throwError(`unsupported transaction type: ${e.type}`,g.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function yn(e,t,r){try{const r=on(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){tn.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=D(t[1],32),e.s=D(t[2],32);try{const t=ve(r(e));e.from=fn(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function gn(e){const t=k(e);if(t[0]>127)return function(e){const t=Pe(e);9!==t.length&&6!==t.length&&tn.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:on(t[0]).toNumber(),gasPrice:on(t[1]),gasLimit:on(t[2]),to:nn(t[3]),value:on(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=V.from(t[6]).toNumber()}catch(e){return r}if(r.r=D(t[7],32),r.s=D(t[8],32),V.from(r.r).isZero()&&V.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(C(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=ve(Te(i));try{r.from=fn(o,{r:C(r.r),s:C(r.s),recoveryParam:n})}catch(e){}r.hash=ve(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=Pe(e.slice(1));8!==t.length&&11!==t.length&&tn.throwArgumentError("invalid component count for transaction type: 1","payload",C(e));const r={type:1,chainId:on(t[0]).toNumber(),nonce:on(t[1]).toNumber(),gasPrice:on(t[2]),gasLimit:on(t[3]),to:nn(t[4]),value:on(t[5]),data:t[6],accessList:dn(t[7])};return 8===t.length||(r.hash=ve(e),yn(r,t.slice(8),pn)),r}(t);case 2:return function(e){const t=Pe(e.slice(1));9!==t.length&&12!==t.length&&tn.throwArgumentError("invalid component count for transaction type: 2","payload",C(e));const r=on(t[2]),n=on(t[3]),i={type:2,chainId:on(t[0]).toNumber(),nonce:on(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:on(t[4]),to:nn(t[5]),value:on(t[6]),data:t[7],accessList:dn(t[8])};return 9===t.length||(i.hash=ve(e),yn(i,t.slice(9),bn)),i}(t)}return tn.throwError(`unsupported transaction type: ${t[0]}`,g.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var vn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const wn=new g("contracts/5.7.0"),An={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function En(e,t){return vn(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&wn.throwArgumentError("invalid address or ENS name","name",r);try{return Oe(r)}catch(e){}e||wn.throwError("a provider or signer is needed to resolve ENS names",g.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&wn.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function _n(e,t,r){return vn(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>_n(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield En(e,t):"tuple"===r.type?yield _n(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>_n(e,t,r.arrayChildren)))):Promise.reject(wn.makeError("invalid value for array",g.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function Tn(e,t,r){return vn(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=oe(r.pop())),wn.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=ne({override:En(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>vn(this,void 0,void 0,(function*(){return Oe(e.signer)!==e.override&&wn.throwError("Contract with a Signer cannot override from",g.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=En(e.provider,n.from));const i=yield ne({args:_n(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:ne(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=V.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=V.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=V.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=V.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=V.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=dn(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=k(o);for(let t=0;t<r.length;t++)e+=4,r[t]&&(e+=64);a.gasLimit=V.from(t.gas).add(e)}if(s.value){const e=V.from(s.value);e.isZero()||t.payable||wn.throwError("non-payable method cannot override value",g.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),a.value=e}s.customData&&(a.customData=oe(s.customData)),s.ccipReadEnabled&&(a.ccipReadEnabled=!!s.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 c=Object.keys(n).filter((e=>null!=n[e]));return c.length&&wn.throwError(`cannot override ${c.map((e=>JSON.stringify(e))).join(",")}`,g.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),a}))}function kn(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=fe(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)))}function Sn(e,t,r){const n=e.signer||e.provider;return function(...i){return vn(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=oe(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const a=yield Tn(e,t,i),s=yield n.call(a,o);try{let n=e.interface.decodeFunctionResult(t,s);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===g.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function Pn(e,t,r){return t.constant?Sn(e,t,r):function(e,t){return function(...r){return vn(this,void 0,void 0,(function*(){e.signer||wn.throwError("sending a transaction requires a signer",g.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield Tn(e,t,r),i=yield e.signer.sendTransaction(n);return kn(e,i),i}))}}(e,t)}function xn(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 Nn{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 Mn extends Nn{constructor(){super("error",null)}}class Cn extends Nn{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&wn.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(xn(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=he(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class Rn extends Nn{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 In{constructor(e,t,r){te(this,"interface",re(new.target,"getInterface")(t)),null==r?(te(this,"provider",null),te(this,"signer",null)):fr.isSigner(r)?(te(this,"provider",r.provider||null),te(this,"signer",r)):ir.isProvider(r)?(te(this,"provider",r),te(this,"signer",null)):wn.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]]):wn.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(te(this,"_runningEvents",{}),te(this,"_wrappedEmits",{}),null==e&&wn.throwArgumentError("invalid contract address or ENS name","addressOrName",e),te(this,"address",e),this.provider)te(this,"resolvedAddress",En(this.provider,e));else try{te(this,"resolvedAddress",Promise.resolve(Oe(e)))}catch(e){wn.throwError("provider is required to use ENS name as contract address",g.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])wn.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,Pn(this,t,!0)),null==this.functions[e]&&te(this.functions,e,Pn(this,t,!1)),null==this.callStatic[e]&&te(this.callStatic,e,Sn(this,t,!0)),null==this.populateTransaction[e]&&te(this.populateTransaction,e,function(e,t){return function(...r){return Tn(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 vn(this,void 0,void 0,(function*(){r||wn.throwError("estimate require a provider or signer",g.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Tn(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 De(e)}static getInterface(e){return tr.isInterface(e)?e:new tr(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&&wn.throwError("contract not deployed",g.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||wn.throwError("sending a transactions require a signer",g.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=oe(e||{});return["from","to"].forEach((function(e){null!=t[e]&&wn.throwError("cannot override "+e,g.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new ur(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 Zt.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 Mn);if("event"===e)return this._normalizeRunningEvent(new Nn("event",null));if("*"===e)return this._normalizeRunningEvent(new Rn(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Cn(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 Cn(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Nn(xn(t),t))}return this._normalizeRunningEvent(new Rn(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=fe(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||wn.throwError("events require a provider or a signer with a provider",g.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=oe(n.filter);return"string"==typeof t&&N(t,32)?(null!=r&&wn.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 On extends In{}class Bn{constructor(e,t,r){let n=null;n="string"==typeof t?t:T(t)?C(t):t&&"string"==typeof t.object?t.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!N(n)||n.length%2)&&wn.throwArgumentError("invalid bytecode","bytecode",t),r&&!fr.isSigner(r)&&wn.throwArgumentError("invalid signer","signer",r),te(this,"bytecode",n),te(this,"interface",re(new.target,"getInterface")(e)),te(this,"signer",r||null)}getDeployTransaction(...e){let t={};if(e.length===this.interface.deploy.inputs.length+1&&"object"==typeof e[e.length-1]){t=oe(e.pop());for(const e in t)if(!An[e])throw new Error("unknown transaction override "+e)}return["data","from","to"].forEach((e=>{null!=t[e]&&wn.throwError("cannot override "+e,g.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.value&&(V.from(t.value).isZero()||this.interface.deploy.payable||wn.throwError("non-payable constructor cannot override value",g.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})),wn.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=C(S([this.bytecode,this.interface.encodeDeploy(e)])),t}deploy(...e){return vn(this,void 0,void 0,(function*(){let t={};e.length===this.interface.deploy.inputs.length+1&&(t=e.pop()),wn.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");const r=yield _n(this.signer,e,this.interface.deploy.inputs);r.push(t);const n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=re(this.constructor,"getContractAddress")(i),a=re(this.constructor,"getContract")(o,this.interface,this.signer);return kn(a,i),te(a,"deployTransaction",i),a}))}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,t){null==e&&wn.throwError("missing compiler output",g.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof e&&(e=JSON.parse(e));const r=e.abi;let n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}static getInterface(e){return On.getInterface(e)}static getContractAddress(e){return De(e)}static getContract(e,t,r){return new On(e,t,r)}}const Fn=new g(G),Dn={},Un=V.from(0),Ln=V.from(-1);function jn(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),Fn.throwError(e,g.errors.NUMERIC_FAULT,i)}let zn="0";for(;zn.length<256;)zn+=zn;function Gn(e){if("number"!=typeof e)try{e=V.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+zn.substring(0,e):Fn.throwArgumentError("invalid decimal size","decimals",e)}function qn(e,t){null==t&&(t=0);const r=Gn(t),n=(e=V.from(e)).lt(Un);n&&(e=e.mul(Ln));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 o=e.div(r).toString();return e=1===r.length?o:o+"."+i,n&&(e="-"+e),e}function Kn(e,t){null==t&&(t=0);const r=Gn(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||Fn.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&Fn.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&Fn.throwArgumentError("too many decimal points","value",e);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&jn("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<r.length-1;)a+="0";const s=V.from(o),c=V.from(a);let f=s.mul(r).add(c);return n&&(f=f.mul(Ln)),f}class Hn{constructor(e,t,r,n){e!==Dn&&Fn.throwError("cannot use FixedFormat constructor; use FixedFormat.from",g.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=Gn(n),Object.freeze(this)}static from(e){if(e instanceof Hn)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||Fn.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&&Fn.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&&Fn.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&Fn.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new Hn(Dn,t,r,n)}}class Jn{constructor(e,t,r,n){e!==Dn&&Fn.throwError("cannot use FixedNumber constructor; use FixedNumber.from",g.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&&Fn.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=Kn(this._value,this.format.decimals),r=Kn(e._value,e.format.decimals);return Jn.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=Kn(this._value,this.format.decimals),r=Kn(e._value,e.format.decimals);return Jn.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=Kn(this._value,this.format.decimals),r=Kn(e._value,e.format.decimals);return Jn.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=Kn(this._value,this.format.decimals),r=Kn(e._value,e.format.decimals);return Jn.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=Jn.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(Wn.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Jn.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(Wn.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)&&Fn.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=Jn.from("1"+zn.substring(0,e),this.format),n=Vn.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&&Fn.throwArgumentError("invalid byte width","width",e),D(V.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Jn.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(V.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||N(e)||"bigint"==typeof e||T(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),Jn.fromString(qn(e,t),Hn.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=Hn.from(t),n=Kn(e,r.decimals);!r.signed&&n.lt(Un)&&jn("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=D(i,r.width/8));const o=qn(n,r.decimals);return new Jn(Dn,i,o,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=Hn.from(t);if(k(e).length>r.width/8)throw new Error("overflow");let n=V.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=qn(n,r.decimals);return new Jn(Dn,i,o,r)}static from(e,t){if("string"==typeof e)return Jn.fromString(e,t);if(T(e))return Jn.fromBytes(e,t);try{return Jn.fromValue(e,0,t)}catch(e){if(e.code!==g.errors.INVALID_ARGUMENT)throw e}return Fn.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const Wn=Jn.from(1),Vn=Jn.from("0.5"),Qn="Ethereum Signed Message:\n";function Yn(e){return"string"==typeof e&&(e=He(e)),ve(S([He(Qn),He(String(e.length)),e]))}const Xn="hash/5.7.0";const Zn=new g(Xn),$n=new Uint8Array(32);$n.fill(0);const ei=V.from(-1),ti=V.from(0),ri=V.from(1),ni=V.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ii=D(ri.toHexString(),32),oi=D(ti.toHexString(),32),ai={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},si=["name","version","chainId","verifyingContract","salt"];function ci(e){return function(t){return"string"!=typeof t&&Zn.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const fi={name:ci("name"),version:ci("version"),chainId:function(e){try{return V.from(e).toString()}catch(e){}return Zn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return Oe(e).toLowerCase()}catch(e){}return Zn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=k(e);if(32!==t.length)throw new Error("bad length");return C(t)}catch(e){}return Zn.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function ui(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))&&Zn.throwArgumentError("invalid numeric width","type",e);const i=ni.mask(r?n-1:n),o=r?i.add(ri).mul(ei):ti;return function(t){const r=V.from(t);return(r.lt(o)||r.gt(i))&&Zn.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),D(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))&&Zn.throwArgumentError("invalid bytes width","type",e),function(t){return k(t).length!==r&&Zn.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=k(e),r=t.length%32;return r?O([t,$n.slice(r)]):C(t)}(t)}}}switch(e){case"address":return function(e){return D(Oe(e),32)};case"bool":return function(e){return e?ii:oi};case"bytes":return function(e){return ve(e)};case"string":return function(e){return Xe(e)}}return null}function li(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class di{constructor(e){te(this,"types",Object.freeze(fe(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((o=>{i[o.name]&&Zn.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",e),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===n&&Zn.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),ui(a)||(r[a]||Zn.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),r[a].push(n),t[n][a]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?Zn.throwArgumentError("missing primary type","types",e):i.length>1&&Zn.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),te(this,"primaryType",i[0]),function i(o,a){a[o]&&Zn.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),a[o]=!0,Object.keys(t[o]).forEach((e=>{r[e]&&(i(e,a),Object.keys(a).forEach((t=>{n[t][e]=!0})))})),delete a[o]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=li(t,e[t])+r.map((t=>li(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=ui(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&&Zn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(ve)),ve(O(i))}}const r=this.types[e];if(r){const t=Xe(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?ve(n):n}));return n.unshift(t),O(n)}}return Zn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Zn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return ve(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(ui(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&&Zn.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)),{}):Zn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new di(e)}static getPrimaryType(e){return di.from(e).primaryType}static hashStruct(e,t,r){return di.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=ai[r];n||Zn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>si.indexOf(e.name)-si.indexOf(t.name))),di.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return O(["0x1901",di.hashDomain(e),di.from(t).hash(r)])}static hash(e,t,r){return ve(di.encode(e,t,r))}static resolveNames(e,t,r,n){return i=this,o=void 0,s=function*(){e=oe(e);const i={};e.verifyingContract&&!N(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=di.from(t);o.visit(r,((e,t)=>("address"!==e||N(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=o.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{c(s.next(e))}catch(e){t(e)}}function n(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}c((s=s.apply(i,o||[])).next())}));var i,o,a,s}static getPayload(e,t,r){di.hashDomain(e);const n={},i=[];si.forEach((t=>{const r=e[t];null!=r&&(n[t]=fi[t](r),i.push({name:t,type:ai[t]}))}));const o=di.from(t),a=oe(t);return a.EIP712Domain?Zn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=i,o.encode(r),{types:a,domain:n,primaryType:o.primaryType,message:o.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return C(k(t));if(e.match(/^u?int/))return V.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Zn.throwArgumentError("invalid string","value",t),t}return Zn.throwArgumentError("unsupported type","type",e)}))}}}class hi{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=k(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 k(new Uint8Array(t.reverse()))}}new hi("abcdefghijklmnopqrstuvwxyz234567");const bi=new hi("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var pi;!function(e){e.sha256="sha256",e.sha512="sha512"}(pi||(pi={}));const mi=new g("sha2/5.7.0");function yi(e){return"0x"+dr().ripemd160().update(k(e)).digest("hex")}function gi(e){return"0x"+dr().sha256().update(k(e)).digest("hex")}function vi(e){return"0x"+dr().sha512().update(k(e)).digest("hex")}function wi(e,t,r){return pi[e]||mi.throwError("unsupported algorithm "+e,g.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+dr().hmac(dr()[e],k(t)).update(k(r)).digest("hex")}function Ai(e,t,r,n,i){let o;e=k(e),t=k(t);let a=1;const s=new Uint8Array(n),c=new Uint8Array(t.length+4);let f,u;c.set(t);for(let l=1;l<=a;l++){c[t.length]=l>>24&255,c[t.length+1]=l>>16&255,c[t.length+2]=l>>8&255,c[t.length+3]=255&l;let d=k(wi(i,e,c));o||(o=d.length,u=new Uint8Array(o),a=Math.ceil(n/o),f=n-(a-1)*o),u.set(d);for(let t=1;t<r;t++){d=k(wi(i,e,d));for(let e=0;e<o;e++)u[e]^=d[e]}const h=(l-1)*o,b=l===a?f:o;s.set(k(u).slice(0,b),h)}return C(s)}const Ei=new g("wordlists/5.7.0");class _i{constructor(e){Ei.checkAbstract(new.target,_i),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 Xe(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}let Ti=null;function ki(e){if(null==Ti&&(Ti="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==_i.check(e)))throw Ti=null,new Error("BIP39 Wordlist for en (English) FAILED")}const Si=new class extends _i{constructor(){super("en")}getWord(e){return ki(this),Ti[e]}getWordIndex(e){return ki(this),Ti.indexOf(e)}};_i.register(Si);const Pi={en:Si},xi=new g("hdnode/5.7.0"),Ni=V.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Mi=He("Bitcoin seed"),Ci=2147483648;function Ri(e){return(1<<e)-1<<8-e}function Ii(e){return D(C(e),32)}function Oi(e){return bi.encode(S([e,I(gi(gi(e)),0,4)]))}function Bi(e){if(null==e)return Pi.en;if("string"==typeof e){const t=Pi[e];return null==t&&xi.throwArgumentError("unknown locale","wordlist",e),t}return e}const Fi={},Di="m/44'/60'/0'/0/0";class Ui{constructor(e,t,r,n,i,o,a,s){if(e!==Fi)throw new Error("HDNode constructor cannot be called directly");if(t){const e=new Zr(t);te(this,"privateKey",e.privateKey),te(this,"publicKey",e.compressedPublicKey)}else te(this,"privateKey",null),te(this,"publicKey",C(r));te(this,"parentFingerprint",n),te(this,"fingerprint",I(yi(gi(this.publicKey)),0,4)),te(this,"address",cn(this.publicKey)),te(this,"chainCode",i),te(this,"index",o),te(this,"depth",a),null==s?(te(this,"mnemonic",null),te(this,"path",null)):"string"==typeof s?(te(this,"mnemonic",null),te(this,"path",s)):(te(this,"mnemonic",s),te(this,"path",s.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return Oi(S([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",C(this.depth),this.parentFingerprint,D(C(this.index),4),this.chainCode,null!=this.privateKey?S(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Ui(Fi,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+="/"+(e&~Ci));const r=new Uint8Array(37);if(e&Ci){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(k(this.privateKey),1),t&&(t+="'")}else r.set(k(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=k(wi(pi.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let a=null,s=null;this.privateKey?a=Ii(V.from(i).add(this.privateKey).mod(Ni)):s=new Zr(C(i))._addPoint(this.publicKey);let c=t;const f=this.mnemonic;return f&&(c=Object.freeze({phrase:f.phrase,path:t,locale:f.locale||"en"})),new Ui(Fi,a,s,this.fingerprint,Ii(o),e,this.depth+1,c)}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>=Ci)throw new Error("invalid path index - "+n);r=r._derive(Ci+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=Ci)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=k(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=k(wi(pi.sha512,Mi,r));return new Ui(Fi,Ii(n.slice(0,32)),null,"0x00000000",Ii(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=zi(ji(e,r=Bi(r)),r),Ui._fromSeed(Li(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return Ui._fromSeed(e,null)}static fromExtendedKey(e){const t=bi.decode(e);82===t.length&&Oi(t.slice(0,78))===e||xi.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=C(t.slice(5,9)),i=parseInt(C(t.slice(9,13)).substring(2),16),o=C(t.slice(13,45)),a=t.slice(45,78);switch(C(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Ui(Fi,null,C(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new Ui(Fi,C(a.slice(1)),null,n,o,i,r,null)}return xi.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Li(e,t){t||(t="");const r=He("mnemonic"+t,je.NFKD);return Ai(He(e,je.NFKD),r,2048,64,"sha512")}function ji(e,t){t=Bi(t),xi.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=k(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let e=0;e<r.length;e++){let o=t.getWordIndex(r[e].normalize("NFKD"));if(-1===o)throw new Error("invalid mnemonic");for(let e=0;e<11;e++)o&1<<10-e&&(n[i>>3]|=1<<7-i%8),i++}const o=32*r.length/3,a=Ri(r.length/3);if((k(gi(n.slice(0,o/8)))[0]&a)!=(n[n.length-1]&a))throw new Error("invalid checksum");return C(n.slice(0,o/8))}function zi(e,t){if(t=Bi(t),(e=k(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,o=k(gi(e))[0]&Ri(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}function Gi(e,t){try{return ji(e,t),!0}catch(e){}return!1}function qi(e){return("number"!=typeof e||e<0||e>=Ci||e%1)&&xi.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}const Ki=new g("random/5.7.0"),Hi=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();let Ji=Hi.crypto||Hi.msCrypto;function Wi(e){(e<=0||e>1024||e%1||e!=e)&&Ki.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return Ji.getRandomValues(t),k(t)}Ji&&Ji.getRandomValues||(Ki.warn("WARNING: Missing strong random number source"),Ji={getRandomValues:function(e){return Ki.throwError("no secure random source avaialble",g.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var Vi=r(202),Qi=r.n(Vi),Yi=r(689),Xi=r.n(Yi);function Zi(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),k(e)}function $i(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function eo(e){return"string"==typeof e?He(e,je.NFKC):k(e)}function to(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 ro(e){const t=k(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=C(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const no="json-wallets/5.7.0";const io=new g(no);function oo(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class ao extends ue{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function so(e,t){const r=Zi(to(e,"crypto/ciphertext"));if(C(ve(S([t.slice(16,32),r]))).substring(2)!==to(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===to(e,"crypto/cipher")){const n=Zi(to(e,"crypto/cipherparams/iv")),i=new(Qi().Counter)(n);return k(new(Qi().ModeOfOperation.ctr)(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||io.throwError("unsupported cipher",g.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=cn(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),Oe(t)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:C(n)};if("0.1"===to(e,"x-ethers/version")){const t=Zi(to(e,"x-ethers/mnemonicCiphertext")),r=Zi(to(e,"x-ethers/mnemonicCounter")),n=new(Qi().Counter)(r),o=new(Qi().ModeOfOperation.ctr)(i,n),s=to(e,"x-ethers/path")||Di,c=to(e,"x-ethers/locale")||"en",f=k(o.decrypt(t));try{const e=zi(f,c),t=Ui.fromMnemonic(e,null,c).derivePath(s);if(t.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=t.mnemonic}catch(e){if(e.code!==g.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new ao(a)}function co(e,t,r,n,i){return k(Ai(e,t,r,n,i))}function fo(e,t,r,n,i){return Promise.resolve(co(e,t,r,n,i))}function uo(e,t,r,n,i){const o=eo(t),a=to(e,"crypto/kdf");if(a&&"string"==typeof a){const t=function(e,t){return io.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){const r=Zi(to(e,"crypto/kdfparams/salt")),s=parseInt(to(e,"crypto/kdfparams/n")),c=parseInt(to(e,"crypto/kdfparams/r")),f=parseInt(to(e,"crypto/kdfparams/p"));s&&c&&f||t("kdf",a),0!=(s&s-1)&&t("N",s);const u=parseInt(to(e,"crypto/kdfparams/dklen"));return 32!==u&&t("dklen",u),n(o,r,s,c,f,64,i)}if("pbkdf2"===a.toLowerCase()){const n=Zi(to(e,"crypto/kdfparams/salt"));let i=null;const a=to(e,"crypto/kdfparams/prf");"hmac-sha256"===a?i="sha256":"hmac-sha512"===a?i="sha512":t("prf",a);const s=parseInt(to(e,"crypto/kdfparams/c")),c=parseInt(to(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(o,n,s,c,i)}}return io.throwArgumentError("unsupported key-derivation function","kdf",a)}const lo=new g(no);class ho extends ue{isCrowdsaleAccount(e){return!(!e||!e._isCrowdsaleAccount)}}function bo(e,t){const r=JSON.parse(e);t=eo(t);const n=Oe(to(r,"ethaddr")),i=Zi(to(r,"encseed"));i&&i.length%16==0||lo.throwArgumentError("invalid encseed","json",e);const o=k(Ai(t,t,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),s=i.slice(16),c=new(Qi().ModeOfOperation.cbc)(o,a),f=Qi().padding.pkcs7.strip(k(c.decrypt(s)));let u="";for(let e=0;e<f.length;e++)u+=String.fromCharCode(f[e]);const l=ve(He(u));return new ho({_isCrowdsaleAccount:!0,address:n,privateKey:l})}function po(e){let t=null;try{t=JSON.parse(e)}catch(e){return!1}return t.encseed&&t.ethaddr}function mo(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 yo(e){if(po(e))try{return Oe(JSON.parse(e).ethaddr)}catch(e){return null}if(mo(e))try{return Oe(JSON.parse(e).address)}catch(e){return null}return null}function go(e,t,r){if(po(e)){r&&r(0);const n=bo(e,t);return r&&r(1),Promise.resolve(n)}return mo(e)?function(e,t,r){return n=this,i=void 0,a=function*(){const n=JSON.parse(e);return so(n,yield uo(n,t,fo,Xi().scrypt,r))},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{c(a.next(e))}catch(e){t(e)}}function s(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}c((a=a.apply(n,i||[])).next())}));var n,i,o,a}(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}var vo=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const wo=new g("wallet/5.7.0");class Ao extends fr{constructor(e,t){if(super(),null!=(r=e)&&N(r.privateKey,32)&&null!=r.address){const t=new Zr(e.privateKey);if(te(this,"_signingKey",(()=>t)),te(this,"address",cn(this.publicKey)),this.address!==Oe(e.address)&&wo.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||Di,locale:t.locale||"en"})));const r=this.mnemonic;cn(Ui.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&wo.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else te(this,"_mnemonic",(()=>null))}else{if(Zr.isSigningKey(e))"secp256k1"!==e.curve&&wo.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 Zr(e);te(this,"_signingKey",(()=>t))}te(this,"_mnemonic",(()=>null)),te(this,"address",cn(this.publicKey))}var r;t&&!ir.isProvider(t)&&wo.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 Ao(this,e)}signTransaction(e){return ne(e).then((t=>{null!=t.from&&(Oe(t.from)!==this.address&&wo.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(ve(mn(t)));return mn(t,r)}))}signMessage(e){return vo(this,void 0,void 0,(function*(){return L(this._signingKey().signDigest(Yn(e)))}))}_signTypedData(e,t,r){return vo(this,void 0,void 0,(function*(){const n=yield di.resolveNames(e,t,r,(e=>(null==this.provider&&wo.throwError("cannot resolve ENS names without a provider",g.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return L(this._signingKey().signDigest(di.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(Oe(e.address)!==cn(e.privateKey))throw new Error("address/privateKey mismatch");if(oo(e)){const t=e.mnemonic;if(Ui.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||Di).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=k(e.privateKey),o=eo(t);let a=null,s=null,c=null;if(oo(e)){const t=e.mnemonic;a=k(ji(t.phrase,t.locale||"en")),s=t.path||Di,c=t.locale||"en"}let f=r.client;f||(f="ethers.js");let u=null;u=r.salt?k(r.salt):Wi(32);let l=null;if(r.iv){if(l=k(r.iv),16!==l.length)throw new Error("invalid iv")}else l=Wi(16);let d=null;if(r.uuid){if(d=k(r.uuid),16!==d.length)throw new Error("invalid uuid")}else d=Wi(16);let h=1<<17,b=8,p=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(b=r.scrypt.r),r.scrypt.p&&(p=r.scrypt.p)),Xi().scrypt(o,u,h,b,p,64,n).then((t=>{const r=(t=k(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),m=new(Qi().Counter)(l),y=k(new(Qi().ModeOfOperation.ctr)(r,m).encrypt(i)),g=ve(S([n,y])),v={address:e.address.substring(2).toLowerCase(),id:ro(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:C(l).substring(2)},ciphertext:C(y).substring(2),kdf:"scrypt",kdfparams:{salt:C(u).substring(2),n:h,dklen:32,p,r:b},mac:g.substring(2)}};if(a){const e=Wi(16),t=new(Qi().Counter)(e),r=k(new(Qi().ModeOfOperation.ctr)(o,t).encrypt(a)),n=new Date,i=n.getUTCFullYear()+"-"+$i(n.getUTCMonth()+1,2)+"-"+$i(n.getUTCDate(),2)+"T"+$i(n.getUTCHours(),2)+"-"+$i(n.getUTCMinutes(),2)+"-"+$i(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:f,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:C(e).substring(2),mnemonicCiphertext:C(r).substring(2),path:s,locale:c,version:"0.1"}}return JSON.stringify(v)}))}(this,e,t,r)}static createRandom(e){let t=Wi(16);e||(e={}),e.extraEntropy&&(t=k(I(ve(S([t,e.extraEntropy])),0,16)));const r=zi(t,e.locale);return Ao.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return go(e,t,r).then((e=>new Ao(e)))}static fromEncryptedJsonSync(e,t){return new Ao(function(e,t){if(po(e))return bo(e,t);if(mo(e))return function(e,t){const r=JSON.parse(e);return so(r,uo(r,t,co,Xi().syncScrypt))}(e,t);throw new Error("invalid JSON wallet")}(e,t))}static fromMnemonic(e,t,r){return t||(t=Di),new Ao(Ui.fromMnemonic(e,null,r).derivePath(t))}}function Eo(e,t){return fn(Yn(e),t)}function _o(e,t,r,n){return fn(di.hash(e,t,r),n)}const To="0x0000000000000000000000000000000000000000",ko="0x0000000000000000000000000000000000000000000000000000000000000000",So="Ξ",Po=new g("networks/5.7.1");function xo(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 o=new t.PocketProvider(e,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}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"],o=new t.AnkrProvider(e,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}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 xo(e)},t}function No(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return No(e,t)},r}const Mo={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:xo("homestead")},Co={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:xo("ropsten")},Ro={chainId:63,name:"classicMordor",_defaultProvider:No("https://www.ethercluster.com/mordor","classicMordor")},Io={unspecified:{chainId:0,name:"unspecified"},homestead:Mo,mainnet:Mo,morden:{chainId:2,name:"morden"},ropsten:Co,testnet:Co,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:xo("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:xo("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:xo("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:xo("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:No("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Ro,classicTestnet:Ro,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:No("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:xo("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:xo("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 Oo(e){if(null==e)return null;if("number"==typeof e){for(const t in Io){const r=Io[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=Io[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=Io[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 Bo(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return k(t)}function Fo(e){e=k(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Do(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 Uo(e){return 1&e?~e>>1:e>>1}function Lo(e,t){let r=Array(e);for(let n=0,i=-1;n<e;n++)r[n]=i+=1+t();return r}function jo(e,t){let r=Array(e);for(let n=0,i=0;n<e;n++)r[n]=i+=Uo(t());return r}function zo(e,t){let r=Lo(e(),e),n=e(),i=Lo(n,e),o=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<o[e];t++)r.push(i[e]+t);return t?r.map((e=>t[e])):r}function Go(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;i<t;i++)jo(e,r).forEach(((e,t)=>n[t].push(e)));return n}function qo(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 Do(Go(i.length,1+e,t).map(((e,t)=>{const o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*n;return[o+t*r,a.map((e=>e+i))]}))})))}function Ko(e,t){return Go(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const Ho=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,o=[0,1];for(let e=1;e<n;e++)o.push(i+=r());let a=r(),s=t;t+=a;let c=0,f=0;function u(){return 0==c&&(f=f<<8|e[t++],c=8),f>>--c&1}const l=Math.pow(2,31),d=l>>>1,h=d>>1,b=l-1;let p=0;for(let e=0;e<31;e++)p=p<<1|u();let m=[],y=0,g=l;for(;;){let e=Math.floor(((p-y+1)*i-1)/g),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<o[n]?r=n:t=n}if(0==t)break;m.push(t);let a=y+Math.floor(g*o[t]/i),s=y+Math.floor(g*o[t+1]/i)-1;for(;0==((a^s)&d);)p=p<<1&b|u(),a=a<<1&b,s=s<<1&b|1;for(;a&~s&h;)p=p&d|p<<1&b>>>1|u(),a=a<<1^d,s=(s^d)<<1|d|1;y=a,g=1+s-a}let v=n-4;return m.map((t=>{switch(t-v){case 3:return v+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return v+256+(e[s++]<<8|e[s++]);case 1:return v+e[s++];default:return t-1}}))}(Bo("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=="))),Jo=new Set(zo(Ho)),Wo=new Set(zo(Ho)),Vo=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(qo(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Ko(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}(Do(t))}(Ho),Qo=function(e){let t=zo(e).sort(((e,t)=>e-t));return function r(){let n=[];for(;;){let i=zo(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(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:a,save:1==i,check:2==i}}()}(Ho),Yo=45,Xo=95;function Zo(e){return Ye(e)}function $o(e){return e.filter((e=>65039!=e))}function ea(e){for(let t of e.split(".")){let e=Zo(t);try{for(let t=e.lastIndexOf(Xo)-1;t>=0;t--)if(e[t]!==Xo)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===Yo&&e[3]===Yo)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function ta(e,t){var r;let n,i,o=Qo,a=[],s=e.length;for(t&&(t.length=0);s;){let c=e[--s];if(o=null===(r=o.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!o)break;if(o.save)i=c;else if(o.check&&c===i)break;a.push(c),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return n}const ra=new g(Xn),na=new Uint8Array(32);function ia(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function oa(e){const t=He(function(e){return ea(function(e,t){let r=Zo(e).reverse(),n=[];for(;r.length;){let e=ta(r);if(e){n.push(...t(e));continue}let i=r.pop();if(Jo.has(i)){n.push(i);continue}if(Wo.has(i))continue;let o=Vo[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return ea(String.fromCodePoint(...n).normalize("NFC"))}(e,$o))}(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++)46===t[e]&&(r.push(ia(t.slice(n,e))),n=e+1);if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(ia(t.slice(n))),r}function aa(e){try{return 0!==oa(e).length}catch(e){}return!1}function sa(e){"string"!=typeof e&&ra.throwArgumentError("invalid ENS name; not a string","name",e);let t=na;const r=oa(e);for(;r.length;)t=ve(S([t,ve(r.pop())]));return C(t)}function ca(e){return C(S(oa(e).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"}na.fill(0);var fa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};function ua(e,t){return fa(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(),o={};return n.headers.forEach?n.headers.forEach(((e,t)=>{o[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{o[e.toLowerCase()]=n.headers.get(e)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:k(new Uint8Array(i))}}))}var la=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const da=new g("web/5.7.1");function ha(e){return new Promise((t=>{setTimeout(t,e)}))}function ba(e,t){if(null==e)return null;if("string"==typeof e)return e;if(E(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Qe(e)}catch(e){}return C(e)}return e}function pa(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;da.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;da.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof e&&!!e.errorPassThrough,s={};let c=null;const f={method:"GET"};let u=!1,l=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||da.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(l=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(u=!0);if(f.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&da.throwError("basic authentication requires a secure https url",g.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+Fo(He(t))}}null!=e.skipFetchSetup&&(f.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(f.fetchOptions=oe(e.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(d):null;if(h)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?Bo(h[3]):(b=h[3],He(b.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){da.throwError("processing response error",g.errors.SERVER_ERROR,{body:ba(h[1],h[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var b;t&&(f.method="POST",f.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const p={};Object.keys(s).forEach((e=>{const t=s[e];p[t.key]=t.value})),f.headers=p;const m=function(){let e=null;return{promise:new Promise((function(t,r){l&&(e=setTimeout((()=>{null!=e&&(e=null,r(da.makeError("timeout",g.errors.TIMEOUT,{requestBody:ba(f.body,p["content-type"]),requestMethod:f.method,timeout:l,url:c})))}),l))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return la(this,void 0,void 0,(function*(){for(let e=0;e<n;e++){let t=null;try{if(t=yield ua(c,f),e<n)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===f.method&&e.match(/^https:/)){c=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(i&&(r=yield i(e,c)),r){let r=0;const n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):o*parseInt(String(Math.random()*Math.pow(2,e))),yield ha(r);continue}}}catch(e){t=e.response,null==t&&(m.cancel(),da.throwError("missing response",g.errors.SERVER_ERROR,{requestBody:ba(f.body,p["content-type"]),requestMethod:f.method,serverError:e,url:c}))}let s=t.body;if(u&&304===t.statusCode?s=null:!a&&(t.statusCode<200||t.statusCode>=300)&&(m.cancel(),da.throwError("bad response",g.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:ba(s,t.headers?t.headers["content-type"]:null),requestBody:ba(f.body,p["content-type"]),requestMethod:f.method,url:c})),r)try{const e=yield r(s,t);return m.cancel(),e}catch(r){if(r.throttleRetry&&e<n){let t=!0;if(i&&(t=yield i(e,c)),t){const t=o*parseInt(String(Math.random()*Math.pow(2,e)));yield ha(t);continue}}m.cancel(),da.throwError("processing response error",g.errors.SERVER_ERROR,{body:ba(s,t.headers?t.headers["content-type"]:null),error:r,requestBody:ba(f.body,p["content-type"]),requestMethod:f.method,url:c})}return m.cancel(),s}return da.throwError("failed response",g.errors.SERVER_ERROR,{requestBody:ba(f.body,p["content-type"]),requestMethod:f.method,url:c})}))}();return Promise.race([m.promise,y])}function ma(e,t,r){let n=null;if(null!=t){n=He(t);const r="string"==typeof e?{url:e}:oe(e);r.headers?0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length||(r.headers=oe(r.headers),r.headers["content-type"]="application/json"):r.headers={"content-type":"application/json"},e=r}return pa(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Qe(e))}catch(t){da.throwError("invalid JSON",g.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function ya(e,t){return t||(t={}),null==(t=oe(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,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{a()&&n(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let c=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(c++,c>s)return void(a()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){a()&&n(e)}))}()}))}var ga=r(273),va=r.n(ga);const wa="providers/5.7.2",Aa=new g(wa);class Ea{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),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:o,type:c,accessList:Ea.allowNull(this.accessList.bind(this),null),blockHash:Ea.allowNull(o,null),blockNumber:Ea.allowNull(s,null),transactionIndex:Ea.allowNull(s,null),confirmations:Ea.allowNull(s,null),from:t,gasPrice:Ea.allowNull(r),maxPriorityFeePerGas:Ea.allowNull(r),maxFeePerGas:Ea.allowNull(r),gasLimit:r,to:Ea.allowNull(t,null),value:r,nonce:s,data:i,r:Ea.allowNull(this.uint256),s:Ea.allowNull(this.uint256),v:Ea.allowNull(s),creates:Ea.allowNull(t,null),raw:Ea.allowNull(i)},e.transactionRequest={from:Ea.allowNull(t),nonce:Ea.allowNull(s),gasLimit:Ea.allowNull(r),gasPrice:Ea.allowNull(r),maxPriorityFeePerGas:Ea.allowNull(r),maxFeePerGas:Ea.allowNull(r),to:Ea.allowNull(t),value:Ea.allowNull(r),data:Ea.allowNull((e=>this.data(e,!0))),type:Ea.allowNull(s),accessList:Ea.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:Ea.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:Ea.allowNull(this.address,null),from:Ea.allowNull(this.address,null),contractAddress:Ea.allowNull(t,null),transactionIndex:s,root:Ea.allowNull(a),gasUsed:r,logsBloom:Ea.allowNull(i),blockHash:o,transactionHash:o,logs:Ea.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:Ea.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:Ea.allowNull(r),status:Ea.allowNull(s),type:c},e.block={hash:Ea.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:Ea.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Ea.allowNull(t),extraData:i,transactions:Ea.allowNull(Ea.arrayOf(o)),baseFeePerGas:Ea.allowNull(r)},e.blockWithTransactions=oe(e.block),e.blockWithTransactions.transactions=Ea.allowNull(Ea.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Ea.allowNull(n,void 0),toBlock:Ea.allowNull(n,void 0),blockHash:Ea.allowNull(o,void 0),address:Ea.allowNull(t,void 0),topics:Ea.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Ea.allowNull(s),blockHash:Ea.allowNull(o),transactionIndex:s,removed:Ea.allowNull(this.boolean.bind(this)),address:t,data:Ea.allowFalsish(i,"0x"),topics:Ea.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return dn(e||[])}number(e){return"0x"===e?0:V.from(e).toNumber()}type(e){return"0x"===e||null==e?0:V.from(e).toNumber()}bigNumber(e){return V.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),N(e))?e.toLowerCase():Aa.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 Oe(e)}callAddress(e){if(!N(e,32))return null;const t=Oe(I(e,12));return t===To?null:t}contractAddress(e){return De(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||N(e))return B(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==R(r)?Aa.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=V.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!N(e))throw new Error("invalid uint256");return D(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=Ea.check(t,e);return n._difficulty=null==r?null:V.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Ea.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&V.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=Ea.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;N(r)&&(r=V.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),N(r)&&(r=V.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 gn(e)}receiptLog(e){return Ea.check(this.formats.receiptLog,e)}receipt(e){const t=Ea.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=V.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Aa.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Aa.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Aa.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 Ea.check(this.formats.filter,e)}filterLog(e){return Ea.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 _a(e){return e&&"function"==typeof e.isCommunityResource}function Ta(e){return _a(e)&&e.isCommunityResource()}let ka=!1;function Sa(){ka||(ka=!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 Pa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const xa=new g(wa);function Na(e){return null==e?"null":(32!==R(e)&&xa.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Ma(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[Na(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return Na(e)})).join("&")}function Ca(e){if("string"==typeof e){if(32===R(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Ma(e);if(nr.isForkEvent(e))throw xa.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Ma(e.topics||[])}throw new Error("invalid event - "+e)}function Ra(){return(new Date).getTime()}function Ia(e){return new Promise((t=>{setTimeout(t,e)}))}const Oa=["block","network","pending","poll"];class Ba{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||Oa.indexOf(this.tag)>=0}}const Fa={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 Da(e){return D(V.from(e).toHexString(),32)}function Ua(e){return bi.encode(S([e,I(gi(gi(e)),0,4)]))}const La=new RegExp("^(ipfs)://(.*)$","i"),ja=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),La,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function za(e,t){try{return Qe(Ga(e,t))}catch(e){}return null}function Ga(e,t){if("0x"===e)return null;const r=V.from(I(e,t,t+32)).toNumber(),n=V.from(I(e,r,r+32)).toNumber();return I(e,r+32,r+32+n)}function qa(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):xa.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function Ka(e){const t=k(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 Ha(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Ja(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=k(e[n]);t[n]=Ka(r),t.push(Ka(i.length)),t.push(Ha(i)),r+=32+32*Math.ceil(i.length/32)}return O(t)}class Wa{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=>V.from(e).eq(1))).catch((e=>{if(e.code===g.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Pa(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:O([e,sa(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=O(["0x9061b923",Ja([ca(this.name),r.data])]));try{let e=yield this.provider.call(r);return k(e).length%32==4&&xa.throwError("resolver threw error",g.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=Ga(e,0)),e}catch(e){if(e.code===g.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Pa(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?Ga(r,0):null}))}_getAddress(e,t){const r=Fa[String(e)];if(null==r&&xa.throwError(`unsupported coin type: ${e}`,g.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=k(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 Ua(S([[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 Ua(S([[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=va().toWords(n.slice(2));return e.unshift(t),va().encode(r.prefix,e)}}return null}getAddress(e){return Pa(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===ko?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===g.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",Da(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&xa.throwError("invalid or unsupported coin data",g.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return Pa(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<ja.length;r++){const n=t.match(ja[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:qa(t)};case"erc721":case"erc1155":{const r="erc721"===i?"0xc87b56dd":"0x0e89341c";e.push({type:i,content:t});const o=this._resolvedAddress||(yield this.getAddress()),a=(n[2]||"").split("/");if(2!==a.length)return null;const s=yield this.provider.formatter.address(a[0]),c=D(V.from(a[1]).toHexString(),32);if("erc721"===i){const t=this.provider.formatter.callAddress(yield this.provider.call({to:s,data:O(["0x6352211e",c])}));if(o!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===i){const t=V.from(yield this.provider.call({to:s,data:O(["0x00fdd58e",D(o,32),c])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const f={to:this.provider.formatter.address(a[0]),data:O([r,c])};let u=za(yield this.provider.call(f),0);if(null==u)return null;e.push({type:"metadata-url-base",content:u}),"erc1155"===i&&(u=u.replace("{id}",c.substring(2)),e.push({type:"metadata-url-expanded",content:u})),u.match(/^ipfs:/i)&&(u=qa(u)),e.push({type:"metadata-url",content:u});const l=yield ma(u);if(!l)return null;e.push({type:"metadata",content:JSON.stringify(l)});let d=l.image;if("string"!=typeof d)return null;if(d.match(/^(https:\/\/|data:)/i));else{if(null==d.match(La))return null;e.push({type:"url-ipfs",content:d}),d=qa(d)}return e.push({type:"url",content:d}),{linkage:e,url:d}}}}}catch(e){}return null}))}getContentHash(){return Pa(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://"+bi.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://"+bi.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://"+Fo("0x"+i[1]).replace(/[=+\/]/g,(t=>e[t]))}return xa.throwError("invalid or unsupported content hash data",g.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Pa(this,void 0,void 0,(function*(){let t=He(e);t=S([Da(64),Da(t.length),t]),t.length%32!=0&&(t=S([t,D("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",C(t));return null==r||"0x"===r?null:Qe(r)}))}}let Va=null,Qa=1;class Ya extends ir{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)):xa.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Pa(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||xa.throwError("no network detected",g.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 ya((()=>this._ready().then((e=>e),(e=>{if(e.code!==g.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==Va&&(Va=new Ea),Va}static getNetwork(e){return Oo(null==e?"homestead":e)}ccipReadFetch(e,t,r){return Pa(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e<r.length;e++){const t=r[e],a=t.replace("{sender}",n).replace("{data}",i),s=t.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),c=yield ma({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const f=c.message||"unknown error";if(c.status>=400&&c.status<500)return xa.throwError(`response not found during CCIP fetch: ${f}`,g.errors.SERVER_ERROR,{url:t,errorMessage:f});o.push(f)}return xa.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,g.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return Pa(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(Ra()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Ra(),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=Ra();return(e=V.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 Pa(this,void 0,void 0,(function*(){const e=Qa++,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)xa.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",xa.makeError("network block skew detected",g.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 o=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(o)}}})),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 Pa(this,void 0,void 0,(function*(){return xa.throwError("provider does not support network detection",g.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Pa(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 Ia(0),this._network;const r=xa.makeError("underlying network changed",g.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=Ra();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=Ra(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return Pa(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return Pa(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const a=[];let s=!1;const c=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},f=e=>{e.confirmations<t||c()||i(e)};if(this.on(e,f),a.push((()=>{this.removeListener(e,f)})),n){let r=n.startBlock,i=null;const f=a=>Pa(this,void 0,void 0,(function*(){s||(yield Ia(1e3),this.getTransactionCount(n.from).then((u=>Pa(this,void 0,void 0,(function*(){if(!s){if(u<=n.nonce)r=a;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<=a;){if(s)return;const r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){const a=r.transactions[i];if(a.hash===e)return;if(a.from===n.from&&a.nonce===n.nonce){if(s)return;const r=yield this.waitForTransaction(a.hash,t);if(c())return;let i="replaced";return a.data===n.data&&a.to===n.to&&a.value.eq(n.value)?i="repriced":"0x"===a.data&&a.from===a.to&&a.value.isZero()&&(i="cancelled"),void o(xa.makeError("transaction was replaced",g.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(a),hash:e,receipt:r}))}}i++}}s||this.once("block",f)}}))),(e=>{s||this.once("block",f)})))}));if(s)return;this.once("block",f),a.push((()=>{this.removeListener("block",f)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||o(xa.makeError("timeout exceeded",g.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Pa(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Pa(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return V.from(e)}catch(t){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Pa(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 V.from(n)}catch(e){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return Pa(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 V.from(n).toNumber()}catch(e){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return Pa(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 C(n)}catch(e){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return Pa(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=>B(e)))}),i=yield this.perform("getStorageAt",n);try{return C(i)}catch(e){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==R(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&xa.throwError("Transaction hash mismatch from Provider.sendTransaction.",g.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>Pa(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 o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&xa.throwError("transaction failed",g.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return Pa(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>C(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 Pa(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?V.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?C(e):null)))})),this.formatter.transactionRequest(yield ne(r))}))}_getFilter(e){return Pa(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 Pa(this,void 0,void 0,(function*(){r>=10&&xa.throwError("CCIP read exceeded maximum redirections",g.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)&&R(i)%32==4)try{const o=I(i,4),a=I(o,0,32);V.from(a).eq(n)||xa.throwError("CCIP Read sender did not match",g.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],c=V.from(I(o,32,64)).toNumber(),f=V.from(I(o,c,c+32)).toNumber(),u=I(o,c+32);for(let t=0;t<f;t++){const r=za(u,32*t);null==r&&xa.throwError("CCIP Read contained corrupt URL string",g.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),s.push(r)}const l=Ga(o,64);V.from(I(o,100,128)).isZero()||xa.throwError("CCIP Read callback selector included junk",g.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const d=I(o,96,100),h=Ga(o,128),b=yield this.ccipReadFetch(e,l,s);null==b&&xa.throwError("CCIP Read disabled or provided no URLs",g.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const p={to:n,data:O([d,Ja([b,h])])};return this._call(p,t,r+1)}catch(e){if(e.code===g.errors.SERVER_ERROR)throw e}try{return C(i)}catch(r){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:i,error:r})}}))}call(e,t){return Pa(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 Pa(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 V.from(r)}catch(e){return xa.throwError("bad result from backend",g.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}}))}_getAddress(e){return Pa(this,void 0,void 0,(function*(){"string"!=typeof(e=yield e)&&xa.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&xa.throwError("ENS name not configured",g.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return Pa(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if(N(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),N(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(t){xa.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return ya((()=>Pa(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 Pa(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return ya((()=>Pa(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 Pa(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return ya((()=>Pa(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 Pa(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)})),Ea.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return Pa(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Pa(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&xa.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 Pa(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 Wa(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Pa(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||xa.throwError("network does not support ENS",g.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+sa(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return Pa(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(N(e))throw t}"string"!=typeof e&&xa.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Pa(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=za(yield this.call({to:r,data:"0x691f3431"+sa(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return Pa(this,void 0,void 0,(function*(){let t=null;if(N(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new Wa(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==g.errors.CALL_EXCEPTION)throw e}try{const e=za(yield this.call({to:n,data:"0x691f3431"+sa(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==g.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 xa.throwError(e+" not implemented",g.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 Ba(Ca(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=Ca(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=Ca(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Ca(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=Ca(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=Ca(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var Xa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Za=new g(wa),$a=["call","estimateGas"];function es(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=N(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=es(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return es(JSON.parse(e),t)}catch(e){}return null}function ts(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=es(t,!0);if(e)return e.data;Za.throwError("missing revert data in call exception; Transaction reverted without a reason string",g.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=es(t.body,!1);null==r&&(r=es(t,!1)),r&&Za.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",g.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===g.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)&&Za.throwError("insufficient funds for intrinsic transaction cost",g.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&Za.throwError("nonce has already been used",g.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Za.throwError("replacement fee too low",g.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&Za.throwError("legacy pre-eip-155 transactions not supported",g.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),$a.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Za.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",g.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function rs(e){return new Promise((function(t){setTimeout(t,e)}))}function ns(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 is(e){return e?e.toLowerCase():e}const os={};class as extends fr{constructor(e,t,r){if(super(),e!==os)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)):Za.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return Za.throwError("cannot alter JSON-RPC Signer connection",g.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new ss(os,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&&Za.throwError("unknown account #"+this._index,g.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=oe(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=oe(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>Xa(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&Za.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&&Za.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)&&Za.throwError("user rejected transaction",g.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),ts("sendTransaction",e,n))))}))}signTransaction(e){return Za.throwError("signing transactions is unsupported",g.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Xa(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 ya((()=>Xa(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 Xa(this,void 0,void 0,(function*(){const t="string"==typeof e?He(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[C(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&Za.throwError("user rejected signing",g.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return Xa(this,void 0,void 0,(function*(){const t="string"==typeof e?He(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),C(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&Za.throwError("user rejected signing",g.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return Xa(this,void 0,void 0,(function*(){const n=yield di.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(di.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&Za.throwError("user rejected signing",g.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return Xa(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class ss extends as{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 cs={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class fs extends Ya{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(oe(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 Xa(this,void 0,void 0,(function*(){yield rs(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(V.from(e).toNumber())}catch(t){return Za.throwError("could not detect network",g.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return Za.throwError("could not detect network",g.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new as(os,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:fe(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=ma(this.connection,JSON.stringify(r),ns).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",[is(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[is(t.address),t.blockTag]];case"getCode":return["eth_getCode",[is(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[is(t.address),D(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=is(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return Xa(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&V.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=oe(t)).transaction=oe(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&Za.throwError(e+" not implemented",g.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return ts(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 rs(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=oe(cs);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=B(V.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=C(e[t]))})),e.accessList&&(n.accessList=dn(e.accessList)),n}}let us=null;try{if(us=WebSocket,null==us)throw new Error("inject please")}catch(e){const t=new g(wa);us=function(){t.throwError("WebSockets not supported in this environment",g.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var ls=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ds=new g(wa);let hs=1;class bs extends fs{constructor(e,t){"any"===t&&ds.throwError("WebSocketProvider does not support 'any' network yet",g.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 us(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){ds.throwError("cannot reset events block on WebSocketProvider",g.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){ds.throwError("cannot set polling interval on WebSocketProvider",g.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return ls(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&ds.throwError("cannot set polling on WebSocketProvider",g.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const r=hs++;return new Promise(((n,i)=>{const o=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?i(e):n(t)},payload:o},this._wsReady&&this.websocket.send(o)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return ls(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=V.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 ls(this,void 0,void 0,(function*(){this.websocket.readyState===us.CONNECTING&&(yield new Promise((e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}}))),this.websocket.close(1e3)}))}}const ps=new g(wa);class ms extends fs{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||ps.throwError("no network detected",g.errors.UNKNOWN_ERROR,{}),null==this._network&&(te(this,"_network",t),this.emit("network",t,null))),t},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}c((i=i.apply(t,r||[])).next())}));var t,r,n,i}}class ys extends ms{constructor(e,t){ps.checkAbstract(new.target,ys),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(){ps.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return ps.throwError("API provider does not support signing",g.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return ps.throwError("not implemented; sub-classes must override getUrl",g.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const gs=new g(wa),vs="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class ws extends bs{constructor(e,t){const r=new As(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===vs}}class As extends ys{static getWebSocketProvider(e,t){return new ws(e,t)}static getApiKey(e){return null==e?vs:(e&&"string"!=typeof e&&gs.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:gs.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===vs&&Sa(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===vs}}const Es=new g(wa),_s="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Ts(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 Es.throwArgumentError("unsupported network","name",e)}class ks extends ys{isCommunityResource(){return this.apiKey===_s}static getApiKey(e){return null==e?_s:e}static getUrl(e,t){null==t&&(t=_s);const r={allowGzip:!0,url:"https://"+Ts(e.name)+t,throttleCallback:(e,r)=>(t.apiKey===_s&&Sa(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}const Ss=new g(wa);class Ps extends ys{static getApiKey(e){return null!=e&&Ss.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/":Ss.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,a=function*(){return"getBlockNumber"===e?(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number:r.perform.call(this,e,t)},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{c(a.next(e))}catch(e){t(e)}}function s(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}c((a=a.apply(n,i||[])).next())}));var n,i,o,a}}var xs=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Ns=new g(wa);function Ms(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]?B(C(n)):"accessList"===r?"["+dn(n).map((e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`)).join(",")+"]":C(n),t[r]=n)}return t}function Cs(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 Rs(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 Is(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function Os(e,t,r){if("call"===e&&t.code===g.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,"")),N(r))return r;Ns.throwError("missing revert data in call exception",g.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===g.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/)&&Ns.throwError("insufficient funds for intrinsic transaction cost",g.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Ns.throwError("nonce has already been used",g.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&Ns.throwError("replacement fee too low",g.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&Ns.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",g.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class Bs extends Ya{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 Ns.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 xs(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null,o="proxy"===e?Rs:Cs;this.emit("debug",{action:"request",request:n,provider:this});const a={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&Sa(),Promise.resolve(!0))};let s=null;i&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(i).map((e=>`${e}=${i[e]}`)).join("&"));const c=yield ma(a,s,o||Rs);return this.emit("debug",{action:"response",request:n,response:fe(c),provider:this}),c}))}detectNetwork(){return xs(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return xs(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=>Os("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=Ms(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(e){return Os("call",e,t.transaction)}}case"estimateGas":{const e=Ms(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(e){return Os("estimateGas",e,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=Is(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=Is(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Ns.throwError("unsupported topic count",g.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const r=t.filter.topics[0];"string"==typeof r&&66===r.length||Ns.throwError("unsupported topic format",g.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 xs(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}}function Fs(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}var Ds=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Us=new g(wa);function Ls(){return(new Date).getTime()}function js(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)||Us.throwArgumentError("provider mismatch","networks",e):t=n}return t}function zs(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 Gs(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(V.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>Gs(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]":Gs(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let qs=1;function Ks(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 Hs=[g.errors.CALL_EXCEPTION,g.errors.INSUFFICIENT_FUNDS,g.errors.NONCE_EXPIRED,g.errors.REPLACEMENT_UNDERPRICED,g.errors.UNPREDICTABLE_GAS_LIMIT],Js=["address","args","errorArgs","errorSignature","method","transaction"];function Ws(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 Vs(e,t){return Ds(this,void 0,void 0,(function*(){const r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:ya((()=>new Promise(((n,i)=>{setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function Qs(e,t,r,n){return Ds(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&&N(n.blockTag)&&(i=yield Vs(e,t)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&N(n.blockTag)&&(i=yield Vs(e,t)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&N(n.blockTag)&&(i=yield Vs(e,t)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&N(n.blockTag)&&(i=yield Vs(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&&N(r.fromBlock)||r.toBlock&&N(r.toBlock))&&(i=yield Vs(e,t)),i.getLogs(r)}}return Us.throwError("unknown method error",g.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class Ys extends Ya{constructor(e,t){0===e.length&&Us.throwArgumentError("missing providers","providers",e);const r=e.map(((e,t)=>{if(ir.isProvider(e)){const t=Ta(e)?2e3:750,r=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:r})}const r=oe(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=Ta(e)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&Us.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&&Us.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let i=js(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 Ds(this,void 0,void 0,(function*(){return js(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}))}perform(e,t){return Ds(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=Gs;switch(t){case"getBlockNumber":return function(t){const r=t.map((e=>e.result));let n=zs(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 zs(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=oe(e)).confirmations=-1,Gs(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=oe(e)).transactions=e.transactions.map((e=>((e=oe(e)).confirmations=-1,e))),Gs(e))}:function(e){return null==e?null:Gs(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=Fs(this.providerConfigs.map(oe));n.sort(((e,t)=>e.priority-t.priority));const i=this._highestBlockNumber;let o=0,a=!0;for(;;){const s=Ls();let c=n.filter((e=>e.runner&&s-e.start<e.stallTimeout)).reduce(((e,t)=>e+t.weight),0);for(;c<this.quorum&&o<n.length;){const r=n[o++],a=qs++;r.start=Ls(),r.staller=Ks(r.stallTimeout),r.staller.wait((()=>{r.staller=null})),r.runner=Qs(r,i,e,t).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Ws(r,Ls()),request:{method:e,params:fe(t)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Ws(r,Ls()),request:{method:e,params:fe(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Ws(r,null),request:{method:e,params:fe(t)},provider:this}),c+=r.weight}const f=[];n.forEach((e=>{!e.done&&e.runner&&(f.push(e.runner),e.staller&&f.push(e.staller.getPromise()))})),f.length&&(yield Promise.race(f));const u=n.filter((e=>e.done&&null==e.error));if(u.length>=this.quorum){const e=r(u);if(void 0!==e)return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;a||(yield Ks(100).getPromise()),a=!1}const l=n.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const r=t.error.code;return Hs.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{});if(Object.keys(l).forEach((e=>{const t=l[e];if(t.weight<this.quorum)return;n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}));const r=t.error,i={};Js.forEach((e=>{null!=r[e]&&(i[e]=r[e])})),Us.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})),Us.throwError("failed to meet quorum",g.errors.SERVER_ERROR,{method:e,params:t,results:n.map((e=>Ws(e))),provider:this})}))}}const Xs=null,Zs=new g(wa),$s="84842078b09946638c03157f83405213";class ec extends bs{constructor(e,t){const r=new tc(e,t),n=r.connection;n.password&&Zs.throwError("INFURA WebSocket project secrets unsupported",g.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===$s}}class tc extends ys{static getWebSocketProvider(e,t){return new ec(e,t)}static getApiKey(e){const t={apiKey:$s,projectId:$s,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(Zs.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),Zs.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:Zs.throwError("unsupported network",g.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===$s&&Sa(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===$s}}class rc extends fs{send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},i=new Promise(((e,t)=>{n.resolve=e,n.reject=t}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const t=e.map((e=>e.request));return this.emit("debug",{action:"requestBatch",request:fe(t),provider:this}),ma(this.connection,JSON.stringify(t)).then((r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach(((e,t)=>{const n=r[t];if(n.error){const t=new Error(n.error.message);t.code=n.error.code,t.data=n.error.data,e.reject(t)}else e.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach((e=>{e.reject(r)}))}))}),10)),i}}const nc=new g(wa);class ic extends ys{static getApiKey(e){return e&&"string"!=typeof e&&nc.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){nc.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:nc.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}const oc=new g(wa),ac="62e1ad51b37b8e00394bda3b";class sc extends ys{static getApiKey(e){const t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=ac:"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:oc.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:oc.throwError("unsupported network",g.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===ac}}const cc=new g(wa);let fc=1;function uc(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:fe(i),provider:this}),t(i,((t,o)=>{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:o,provider:this}),o.error){const e=new Error(o.error.message);return e.code=o.error.code,e.data=o.error.data,n(e)}e(o.result)}))}))}}class lc extends fs{constructor(e,t){null==e&&cc.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:fe(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=uc(0,e.sendAsync.bind(e)):e.send?n=uc(0,e.send.bind(e)):cc.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 dc=new g(wa);function hc(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 fs(e);case"ws":case"wss":return new bs(e);default:dc.throwArgumentError("unsupported URL scheme","network",e)}}const r=Oo(e);return r&&r._defaultProvider||dc.throwError("unsupported getDefaultProvider network",g.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:Ys,AlchemyProvider:As,AnkrProvider:ks,CloudflareProvider:Ps,EtherscanProvider:Bs,InfuraProvider:tc,JsonRpcProvider:fs,NodesmithProvider:ic,PocketProvider:sc,Web3Provider:lc,IpcProvider:Xs},t)}const bc=new RegExp("^bytes([0-9]+)$"),pc=new RegExp("^(u?int)([0-9]*)$"),mc=new RegExp("^(.*)\\[([0-9]*)\\]$"),yc="0000000000000000000000000000000000000000000000000000000000000000",gc=new g("solidity/5.7.0");function vc(e,t,r){switch(e){case"address":return r?x(t,32):k(t);case"string":return He(t);case"bytes":return k(t);case"bool":return t=t?"0x01":"0x00",r?x(t,32):k(t)}let n=e.match(pc);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&gc.throwArgumentError("invalid number type","type",e),r&&(i=256),x(t=V.from(t).toTwos(i),i/8)}if(n=e.match(bc),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&gc.throwArgumentError("invalid bytes type","type",e),k(t).byteLength!==i&&gc.throwArgumentError(`invalid value for ${e}`,"value",t),r?k((t+yc).substring(0,66)):t}if(n=e.match(mc),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&gc.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(vc(r,e,!0))})),S(i)}return gc.throwArgumentError("invalid type","type",e)}function wc(e,t){e.length!=t.length&&gc.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(vc(e,t[n]))})),C(S(r))}function Ac(e,t){return ve(wc(e,t))}function Ec(e,t){return gi(wc(e,t))}function _c(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function Tc(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function kc(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n];if(r+=i.l,e>=r&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}const Sc=Tc("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Pc="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),xc=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Nc=_c("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Mc=_c("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Cc=_c("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),Rc=Tc("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function Ic(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=Ye(e);var r;r=t.map((e=>{if(Pc.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=kc(e,xc);if(t)return[e+t.s];let r=Nc[e];if(r)return r;let n=Mc[e];return n?[e+n[0]]:Cc[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=Ye(Ve(t),je.NFKC),t.forEach((e=>{if(kc(e,Rc))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(kc(e,Sc))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=Ve(t);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}function Oc(e){const t=He(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return C(S([t,ko]).slice(0,32))}function Bc(e){const t=k(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return Qe(t.slice(0,r))}const Fc=new g("units/5.7.0"),Dc=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Uc(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Fc.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return n+o.join(",")+i}function Lc(e,t){if("string"==typeof t){const e=Dc.indexOf(t);-1!==e&&(t=3*e)}return qn(e,null!=t?t:18)}function jc(e,t){if("string"!=typeof e&&Fc.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=Dc.indexOf(t);-1!==e&&(t=3*e)}return Kn(e,null!=t?t:18)}function zc(e){return Lc(e,18)}function Gc(e){return jc(e,18)}const qc="ethers/5.7.2",Kc=new g(qc);try{const e=window;null==e._ethers&&(e._ethers=c)}catch(e){}},485:(e,t,r)=>{var n=t;n.utils=r(212),n.common=r(495),n.sha=r(530),n.ripemd=r(396),n.hmac=r(47),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},495:(e,t,r)=>{"use strict";var n=r(212),i=r(561);function o(){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=o,o.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},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.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 o=8;o<this.padLength;o++)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,o=8;o<this.padLength;o++)n[i++]=0;return n}},47:(e,t,r)=>{"use strict";var n=r(212),i=r(561);function o(e,t,r){if(!(this instanceof o))return new o(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=o,o.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)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},396:(e,t,r)=>{"use strict";var n=r(212),i=r(495),o=n.rotl32,a=n.sum32,s=n.sum32_3,c=n.sum32_4,f=i.BlockHash;function u(){if(!(this instanceof u))return new u;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(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 h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(u,f),t.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],f=this.h[3],u=this.h[4],g=r,v=n,w=i,A=f,E=u,_=0;_<80;_++){var T=a(o(c(r,l(_,n,i,f),e[b[_]+t],d(_)),m[_]),u);r=u,u=f,f=o(i,10),i=n,n=T,T=a(o(c(g,l(79-_,v,w,A),e[p[_]+t],h(_)),y[_]),E),g=E,E=A,A=o(w,10),w=v,v=T}T=s(this.h[1],i,A),this.h[1]=s(this.h[2],f,E),this.h[2]=s(this.h[3],u,g),this.h[3]=s(this.h[4],r,v),this.h[4]=s(this.h[0],n,w),this.h[0]=T},u.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var b=[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],p=[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],y=[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]},530:(e,t,r)=>{"use strict";t.sha1=r(79),t.sha224=r(823),t.sha256=r(32),t.sha384=r(328),t.sha512=r(168)},79:(e,t,r)=>{"use strict";var n=r(212),i=r(495),o=r(713),a=n.rotl32,s=n.sum32,c=n.sum32_5,f=o.ft_1,u=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,u),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]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],u=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var b=~~(n/20),p=c(a(i,5),f(b,o,u,d),h,r[n],l[b]);h=d,d=u,u=a(o,30),o=i,i=p}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],u),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},823:(e,t,r)=>{"use strict";var n=r(212),i=r(32);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},32:(e,t,r)=>{"use strict";var n=r(212),i=r(495),o=r(713),a=r(561),s=n.sum32,c=n.sum32_4,f=n.sum32_5,u=o.ch32,l=o.maj32,d=o.s0_256,h=o.s1_256,b=o.g0_256,p=o.g1_256,m=i.BlockHash,y=[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=y,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]=c(p(r[n-2]),r[n-7],b(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],m=this.h[2],y=this.h[3],g=this.h[4],v=this.h[5],w=this.h[6],A=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var E=f(A,h(g),u(g,v,w),this.k[n],r[n]),_=s(d(i),l(i,o,m));A=w,w=v,v=g,g=s(y,E),y=m,m=o,o=i,i=s(E,_)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],m),this.h[3]=s(this.h[3],y),this.h[4]=s(this.h[4],g),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],A)},g.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},328:(e,t,r)=>{"use strict";var n=r(212),i=r(168);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},168:(e,t,r)=>{"use strict";var n=r(212),i=r(495),o=r(561),a=n.rotr64_hi,s=n.rotr64_lo,c=n.shr64_hi,f=n.shr64_lo,u=n.sum64,l=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,b=n.sum64_4_lo,p=n.sum64_5_hi,m=n.sum64_5_lo,y=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;y.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 o=e&r^~e&i;return o<0&&(o+=4294967296),o}function A(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function _(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function T(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function k(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function P(e,t){var r=a(e,t,1)^a(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,1)^s(e,t,8)^f(e,t,7);return r<0&&(r+=4294967296),r}function N(e,t){var r=s(e,t,19)^s(t,e,29)^f(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,y),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],y=r[n-3],g=void 0,(g=a(m,y,19)^a(y,m,29)^c(m,y,6))<0&&(g+=4294967296),g),o=N(r[n-4],r[n-3]),s=r[n-14],f=r[n-13],u=P(r[n-30],r[n-29]),l=x(r[n-30],r[n-29]),d=r[n-32],p=r[n-31];r[n]=h(i,o,s,f,u,l,d,p),r[n+1]=b(i,o,s,f,u,l,d,p)}var m,y,g},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r,n,i,s=this.W,c=this.h[0],f=this.h[1],h=this.h[2],b=this.h[3],y=this.h[4],g=this.h[5],v=this.h[6],P=this.h[7],x=this.h[8],N=this.h[9],M=this.h[10],C=this.h[11],R=this.h[12],I=this.h[13],O=this.h[14],B=this.h[15];o(this.k.length===s.length);for(var F=0;F<s.length;F+=2){var D=O,U=B,L=(i=void 0,(i=a(r=x,n=N,14)^a(r,n,18)^a(n,r,9))<0&&(i+=4294967296),i),j=S(x,N),z=w(x,0,M,0,R),G=A(0,N,0,C,0,I),q=this.k[F],K=this.k[F+1],H=s[F],J=s[F+1],W=p(D,U,L,j,z,G,q,K,H,J),V=m(D,U,L,j,z,G,q,K,H,J);D=T(c,f),U=k(c,f),L=E(c,0,h,0,y),j=_(0,f,0,b,0,g);var Q=l(D,U,L,j),Y=d(D,U,L,j);O=R,B=I,R=M,I=C,M=x,C=N,x=l(v,P,W,V),N=d(P,P,W,V),v=y,P=g,y=h,g=b,h=c,b=f,c=l(W,V,Q,Y),f=d(W,V,Q,Y)}u(this.h,0,c,f),u(this.h,2,h,b),u(this.h,4,y,g),u(this.h,6,v,P),u(this.h,8,x,N),u(this.h,10,M,C),u(this.h,12,R,I),u(this.h,14,O,B)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},713:(e,t,r)=>{"use strict";var n=r(212).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(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?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,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}},212:(e,t,r)=>{"use strict";var n=r(561),i=r(285);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function c(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 a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|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+=s(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=a(i)),r+=c(i.toString(16))}return r},t.zero2=s,t.zero8=c,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var a=new Array(o/4),s=0,c=t;s<a.length;s++,c+=4){var f;f="big"===i?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],a[s]=f>>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}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],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},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,o,a,s){var c=0,f=t;return c+=(f=f+n>>>0)<t?1:0,c+=(f=f+o>>>0)<o?1:0,e+r+i+a+(c+=(f=f+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,c,f){var u=0,l=t;return u+=(l=l+n>>>0)<t?1:0,u+=(l=l+o>>>0)<o?1:0,u+=(l=l+s>>>0)<s?1:0,e+r+i+a+c+(u+=(l=l+f>>>0)<f?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,c,f){return t+n+o+s+f>>>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}},285: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}}},669:(e,t,r)=>{var n;!function(){"use strict";var i="input is invalid type",o="object"==typeof window,a=o?window:{};a.JS_SHA3_NO_WINDOW&&(o=!1);var s=!o&&"object"==typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?a=r.g:s&&(a=self);var c=!a.JS_SHA3_NO_COMMON_JS&&e.exports,f=r.amdO,u=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),d=[4,1024,262144,67108864],h=[0,8,16,24],b=[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],p=[224,256,384,512],m=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],g={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!u||!a.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 v=function(e,t,r){return function(n){return new O(e,t,e).update(n)[r]()}},w=function(e,t,r){return function(n,i){return new O(e,t,i).update(n)[r]()}},A=function(e,t,r){return function(t,n,i,o){return S["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return S["kmac"+e].update(t,n,i,o)[r]()}},_=function(e,t,r,n){for(var i=0;i<y.length;++i){var o=y[i];e[o]=t(r,n,o)}return e},T=function(e,t){var r=v(e,t,"hex");return r.create=function(){return new O(e,t,e)},r.update=function(e){return r.create().update(e)},_(r,v,e,t)},k=[{name:"keccak",padding:[1,256,65536,16777216],bits:p,createMethod:T},{name:"sha3",padding:[6,1536,393216,100663296],bits:p,createMethod:T},{name:"shake",padding:[31,7936,2031616,520093696],bits:m,createMethod:function(e,t){var r=w(e,t,"hex");return r.create=function(r){return new O(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},_(r,w,e,t)}},{name:"cshake",padding:d,bits:m,createMethod:function(e,t){var r=g[e],n=A(e,0,"hex");return n.create=function(n,i,o){return i||o?new O(e,t,n).bytepad([i,o],r):S["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},_(n,A,e,t)}},{name:"kmac",padding:d,bits:m,createMethod:function(e,t){var r=g[e],n=E(e,0,"hex");return n.create=function(n,i,o){return new B(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},_(n,E,e,t)}}],S={},P=[],x=0;x<k.length;++x)for(var N=k[x],M=N.bits,C=0;C<M.length;++C){var R=N.name+"_"+M[C];if(P.push(R),S[R]=N.createMethod(M[C],N.padding),"sha3"!==N.name){var I=N.name+M[C];P.push(I),S[I]=S[R]}}function O(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 B(e,t,r){O.call(this,e,t,r)}O.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(i);if(null===e)throw new Error(i);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,o,a=this.blocks,s=this.byteCount,c=e.length,f=this.blockCount,l=0,d=this.s;l<c;){if(this.reset)for(this.reset=!1,a[0]=this.block,n=1;n<f+1;++n)a[n]=0;if(t)for(n=this.start;l<c&&n<s;++l)a[n>>2]|=e[l]<<h[3&n++];else for(n=this.start;l<c&&n<s;++l)(o=e.charCodeAt(l))<128?a[n>>2]|=o<<h[3&n++]:o<2048?(a[n>>2]|=(192|o>>6)<<h[3&n++],a[n>>2]|=(128|63&o)<<h[3&n++]):o<55296||o>=57344?(a[n>>2]|=(224|o>>12)<<h[3&n++],a[n>>2]|=(128|o>>6&63)<<h[3&n++],a[n>>2]|=(128|63&o)<<h[3&n++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++l)),a[n>>2]|=(240|o>>18)<<h[3&n++],a[n>>2]|=(128|o>>12&63)<<h[3&n++],a[n>>2]|=(128|o>>6&63)<<h[3&n++],a[n>>2]|=(128|63&o)<<h[3&n++]);if(this.lastByteIndex=n,n>=s){for(this.start=n-s,this.block=a[f],n=0;n<f;++n)d[n]^=a[n];F(d),this.reset=!0}else this.start=n}return this},O.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},O.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}var n=0,o=e.length;if(t)n=o;else for(var a=0;a<e.length;++a){var s=e.charCodeAt(a);s<128?n+=1:s<2048?n+=2:s<55296||s>=57344?n+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},O.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,o=[];return o.length=i,this.update(o),this},O.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];F(n)}},O.prototype.toString=O.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<n;){for(o=0;o<t&&a<n;++o,++a)e=r[o],s+=l[e>>4&15]+l[15&e]+l[e>>12&15]+l[e>>8&15]+l[e>>20&15]+l[e>>16&15]+l[e>>28&15]+l[e>>24&15];a%t==0&&(F(r),o=0)}return i&&(e=r[o],s+=l[e>>4&15]+l[15&e],i>1&&(s+=l[e>>12&15]+l[e>>8&15]),i>2&&(s+=l[e>>20&15]+l[e>>16&15])),s},O.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a<n;){for(o=0;o<t&&a<n;++o,++a)c[a]=r[o];a%t==0&&F(r)}return i&&(c[o]=r[o],e=e.slice(0,s)),e},O.prototype.buffer=O.prototype.arrayBuffer,O.prototype.digest=O.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,c=[];s<i;){for(a=0;a<r&&s<i;++a,++s)e=s<<2,t=n[a],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%r==0&&F(n)}return o&&(e=s<<2,t=n[a],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},B.prototype=new O,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),O.prototype.finalize.call(this)};var F=function(e){var t,r,n,i,o,a,s,c,f,u,l,d,h,p,m,y,g,v,w,A,E,_,T,k,S,P,x,N,M,C,R,I,O,B,F,D,U,L,j,z,G,q,K,H,J,W,V,Q,Y,X,Z,$,ee,te,re,ne,ie,oe,ae,se,ce,fe,ue;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>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^(c<<1|f>>>31),r=o^(f<<1|c>>>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=a^(u<<1|l>>>31),r=s^(l<<1|u>>>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=c^(d<<1|h>>>31),r=f^(h<<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=u^(i<<1|o>>>31),r=l^(o<<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],W=e[11]<<4|e[10]>>>28,V=e[10]<<4|e[11]>>>28,N=e[20]<<3|e[21]>>>29,M=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,q=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,F=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,Q=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,C=e[33]<<13|e[32]>>>19,R=e[32]<<13|e[33]>>>19,fe=e[42]<<2|e[43]>>>30,ue=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,Z=e[35]<<15|e[34]>>>17,I=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,L=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,J=e[9]<<27|e[8]>>>5,P=e[18]<<20|e[19]>>>12,x=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,z=e[38]<<8|e[39]>>>24,G=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=p^~y&v,e[1]=m^~g&w,e[10]=k^~P&N,e[11]=S^~x&M,e[20]=B^~D&L,e[21]=F^~U&j,e[30]=H^~W&Q,e[31]=J^~V&Y,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=y^~v&A,e[3]=g^~w&E,e[12]=P^~N&C,e[13]=x^~M&R,e[22]=D^~L&z,e[23]=U^~j&G,e[32]=W^~Q&X,e[33]=V^~Y&Z,e[42]=ne^~oe&se,e[43]=ie^~ae&ce,e[4]=v^~A&_,e[5]=w^~E&T,e[14]=N^~C&I,e[15]=M^~R&O,e[24]=L^~z&q,e[25]=j^~G&K,e[34]=Q^~X&$,e[35]=Y^~Z&ee,e[44]=oe^~se&fe,e[45]=ae^~ce&ue,e[6]=A^~_&p,e[7]=E^~T&m,e[16]=C^~I&k,e[17]=R^~O&S,e[26]=z^~q&B,e[27]=G^~K&F,e[36]=X^~$&H,e[37]=Z^~ee&J,e[46]=se^~fe&te,e[47]=ce^~ue&re,e[8]=_^~p&y,e[9]=T^~m&g,e[18]=I^~k&P,e[19]=O^~S&x,e[28]=q^~B&D,e[29]=K^~F&U,e[38]=$^~H&W,e[39]=ee^~J&V,e[48]=fe^~te&ne,e[49]=ue^~re&ie,e[0]^=b[n],e[1]^=b[n+1]};if(c)e.exports=S;else{for(x=0;x<P.length;++x)a[P[x]]=S[P[x]];f&&(void 0===(n=function(){return S}.call(t,r,t,e))||(e.exports=n))}}()},561: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)}},689:function(e){"use strict";!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,o=2773480762,a=1359893119,s=2600822924,c=528734635,f=1541459225;const u=new Uint32Array(64);function l(e){let l=0,d=e.length;for(;d>=64;){let h,b,p,m,y,g=r,v=n,w=i,A=o,E=a,_=s,T=c,k=f;for(b=0;b<16;b++)p=l+4*b,u[b]=(255&e[p])<<24|(255&e[p+1])<<16|(255&e[p+2])<<8|255&e[p+3];for(b=16;b<64;b++)h=u[b-2],m=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,h=u[b-15],y=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,u[b]=(m+u[b-7]|0)+(y+u[b-16]|0)|0;for(b=0;b<64;b++)m=(((E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7))+(E&_^~E&T)|0)+(k+(t[b]+u[b]|0)|0)|0,y=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&v^g&w^v&w)|0,k=T,T=_,_=E,E=A+m|0,A=w,w=v,v=g,g=m+y|0;r=r+g|0,n=n+v|0,i=i+w|0,o=o+A|0,a=a+E|0,s=s+_|0,c=c+T|0,f=f+k|0,l+=64,d-=64}}l(e);let d,h=e.length%64,b=e.length/536870912|0,p=e.length<<3,m=h<56?56:120,y=e.slice(e.length-h,e.length);for(y.push(128),d=h+1;d<m;d++)y.push(0);return y.push(b>>>24&255),y.push(b>>>16&255),y.push(b>>>8&255),y.push(b>>>0&255),y.push(p>>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),l(y),[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,o>>>24&255,o>>>16&255,o>>>8&255,o>>>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,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,o=new Array(i),a=new Array(64);let s,c=[];for(s=0;s<64;s++)o[s]=54;for(s=0;s<e.length;s++)o[s]^=e[s];for(s=0;s<t.length;s++)o[64+s]=t[s];for(s=i-4;s<i;s++)o[s]=0;for(s=0;s<64;s++)a[s]=92;for(s=0;s<e.length;s++)a[s]^=e[s];function f(){for(let e=i-1;e>=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;r>=32;)f(),c=c.concat(n(a.concat(n(o)))),r-=32;return r>0&&(f(),c=c.concat(n(a.concat(n(o))).slice(0,r))),c}function o(e,t,r,n,i){let o;for(f(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(e,16*o,i,16),s(i,n),f(i,0,e,t+16*o,16);for(o=0;o<r;o++)f(e,t+2*o*16,e,16*o,16);for(o=0;o<r;o++)f(e,t+16*(2*o+1),e,16*(o+r),16)}function a(e,t){return e<<t|e>>>32-t}function s(e,t){f(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function c(e,t,r,n){for(let i=0;i<n;i++)r[i]^=e[t+i]}function f(e,t,r,n,i){for(;i--;)r[n++]=e[t++]}function u(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 l(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function d(e,t,n,a,s,d,h){if(n=l(n,"N"),a=l(a,"r"),s=l(s,"p"),d=l(d,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/a)throw new Error("N too large");if(a>r/128/s)throw new Error("r too large");if(!u(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!u(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let b=i(e,t,128*s*a);const p=new Uint32Array(32*s*a);for(let e=0;e<p.length;e++){const t=4*e;p[e]=(255&b[t+3])<<24|(255&b[t+2])<<16|(255&b[t+1])<<8|(255&b[t+0])<<0}const m=new Uint32Array(64*a),y=new Uint32Array(32*a*n),g=32*a,v=new Uint32Array(16),w=new Uint32Array(16),A=s*n*2;let E,_,T=0,k=null,S=!1,P=0,x=0;const N=h?parseInt(1e3/a):4294967295,M="undefined"!=typeof setImmediate?setImmediate:setTimeout,C=function(){if(S)return h(new Error("cancelled"),T/A);let t;switch(P){case 0:_=32*x*a,f(p,_,m,0,g),P=1,E=0;case 1:t=n-E,t>N&&(t=N);for(let e=0;e<t;e++)f(m,0,y,(E+e)*g,g),o(m,g,a,v,w);if(E+=t,T+=t,h){const e=parseInt(1e3*T/A);if(e!==k){if(S=h(null,T/A),S)break;k=e}}if(E<n)break;E=0,P=2;case 2:t=n-E,t>N&&(t=N);for(let e=0;e<t;e++){const e=m[16*(2*a-1)]&n-1;c(y,e*g,m,g),o(m,g,a,v,w)}if(E+=t,T+=t,h){const e=parseInt(1e3*T/A);if(e!==k){if(S=h(null,T/A),S)break;k=e}}if(E<n)break;if(f(m,0,p,_,g),x++,x<s){P=0;break}b=[];for(let e=0;e<p.length;e++)b.push(p[e]>>0&255),b.push(p[e]>>8&255),b.push(p[e]>>16&255),b.push(p[e]>>24&255);const r=i(e,b,d);return h&&h(null,1,r),r}h&&M(C)};if(!h)for(;;){const e=C();if(null!=e)return e}C()}const h={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(s,c){let f=0;a&&a(0),d(e,t,r,n,i,o,(function(e,t,r){if(e)c(e);else if(r)a&&1!==f&&a(1),s(new Uint8Array(r));else if(a&&t!==f)return f=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(d(e,t,r,n,i,o))}};e.exports=h}()},222:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=o(r(14)),s=r(391),c=r(859),f=r(157),u=r(182),l=r(1),d=r(411),h=r(742),b=function(){function e(e,t,r){if(!e)throw new Error("No Collection ID.");this.collectionId=e,this.signerOrProvider=t,this.isDev=r,this.apps={}}return e.prototype.init=function(){return n(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,e.getCollectionData(this.collectionId,this.isDev)];case 1:return t=r.sent(),[2,this.initWithData(t)]}}))}))},e.prototype.initWithData=function(e){if(this.data=e,!this.data||!this.data.collectionId)throw new Error("Collection is not ready yet.");if(!this.data.address)throw new Error("Smart contract is not deployed yet.");this.chainId=this.data.chainId,this.networkName=this.data.networkName,this.base=f.BaseFacet__factory.connect(this.data.address,this.signerOrProvider);for(var t=0,r=this.data.apps;t<r.length;t++){var n=r[t];n.id===s.ethers.utils.id("drop")&&(this.apps.drop=u.DropFacet__factory.connect(this.data.address,this.signerOrProvider)),n.id===s.ethers.utils.id("edition")&&(this.apps.edition=l.EditionFacet__factory.connect(this.data.address,this.signerOrProvider)),n.id===s.ethers.utils.id("ape")&&(this.apps.ape=d.ApeDropFacet__factory.connect(this.data.address,this.signerOrProvider)),n.id===s.ethers.utils.id("erc20")&&(this.apps.erc20=h.ERC20AppFacet__factory.connect(this.data.address,this.signerOrProvider))}},e.prototype.verify=function(t){return e.verifyWallet(this.collectionId,t,this.isDev)},e.prototype.verifyForEdition=function(t,r){return e.verifyWalletForEdition(this.collectionId,t,r,this.isDev)},e.create=function(t,r,o,a){return n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return n=new e(r,t,a),o?(n.initWithData(o),[3,3]):[3,1];case 1:return[4,n.init()];case 2:i.sent(),i.label=3;case 3:return[2,n]}}))}))},e.verifyWallet=function(e,t,r){return n(this,void 0,void 0,(function(){var n,o,s,f;return i(this,(function(i){switch(i.label){case 0:return n=r?c.API_ENDPOINT_DEV:c.API_ENDPOINT,o="".concat(n,"/v3/collections/list/").concat(e),[4,a.default.post(o,{wallet:t},{validateStatus:function(e){return e<500}})];case 1:if((s=i.sent()).status>=400)throw f=s.data.message,new Error(f);return[2,s.data]}}))}))},e.verifyWalletForEdition=function(e,t,r,o){return n(this,void 0,void 0,(function(){var n,s,f,u;return i(this,(function(i){switch(i.label){case 0:return n=o?c.API_ENDPOINT_DEV:c.API_ENDPOINT,s="".concat(n,"/v3/editions/list/").concat(e,"/").concat(r),[4,a.default.post(s,{wallet:t},{validateStatus:function(e){return e<500}})];case 1:if((f=i.sent()).status>=400)throw u=f.data.message,new Error(u);return[2,f.data]}}))}))},e.getCollectionData=function(e,t){return n(this,void 0,void 0,(function(){var r,n,o,s;return i(this,(function(i){switch(i.label){case 0:return r=t?c.API_ENDPOINT_DEV:c.API_ENDPOINT,n="".concat(r,"/v3/collections/").concat(e,"/address"),[4,a.default.get(n,{validateStatus:function(e){return e<500}})];case 1:if((o=i.sent()).status>=400)throw s=o.data.message,new Error(s);return[2,o.data]}}))}))},e}();t.default=b},859:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.API_ENDPOINT=t.API_ENDPOINT_DEV=void 0,t.API_ENDPOINT_DEV="https://api-testnet.niftykit.com",t.API_ENDPOINT="https://api.niftykit.com"},368:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(222));t.default=i.default},181:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ApeDropFacet__factory=void 0;var o=r(391),a=[{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{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:"uint256",name:"fromTokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"toTokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"ConsecutiveTransfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"uint256",name:"roles",type:"uint256"}],name:"RolesUpdated",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:[],name:"apeMintFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint64",name:"quantity",type:"uint64"}],name:"apeMintTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"apePresaleActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint64",name:"quantity",type:"uint64"},{internalType:"uint256",name:"allowed",type:"uint256"},{internalType:"bytes32[]",name:"proof",type:"bytes32[]"}],name:"apePresaleMintTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"apePrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"apeRevenue",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"apeSaleActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"newMaxAmount",type:"uint256"},{internalType:"uint256",name:"newMaxPerMint",type:"uint256"},{internalType:"uint256",name:"newMaxPerWallet",type:"uint256"},{internalType:"uint256",name:"newPrice",type:"uint256"},{internalType:"bool",name:"presale",type:"bool"}],name:"apeStartSale",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"apeStopSale",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"apeWithdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"finalizeApeDrop",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress_",type:"address"}],name:"initializeApeDrop",outputs:[],stateMutability:"nonpayable",type:"function"}],s="0x608060405234801561001057600080fd5b506118a3806100206000396000f3fe6080604052600436106100a75760003560e01c80634cbc2233116100645780634cbc223314610153578063629fcbbb146101685780637a3f451e1461019e578063bd0d30e5146101d2578063cb75872a146101fd578063cc3fd3661461021057600080fd5b806303de52b7146100ac578063061a4194146100c357806306af7fa1146100e357806314407faf1461010357806335af1341146101185780633c5f35051461012b575b600080fd5b3480156100b857600080fd5b506100c1610244565b005b3480156100cf57600080fd5b506100c16100de366004611507565b6102dc565b3480156100ef57600080fd5b506100c16100fe366004611569565b6103a0565b34801561010f57600080fd5b506100c161044b565b6100c16101263660046115a2565b610472565b34801561013757600080fd5b506101406106c4565b6040519081526020015b60405180910390f35b34801561015f57600080fd5b506100c1610777565b34801561017457600080fd5b5060008051602061182e83398151915254610100900460ff165b604051901515815260200161014a565b3480156101aa57600080fd5b507fbf52cd849dccc2c223783e1d385704ea86b8dd04290c0a9896c634edf522738754610140565b3480156101de57600080fd5b5060008051602061182e8339815191525462010000900460ff1661018e565b6100c161020b3660046115d7565b610864565b34801561021c57600080fd5b507fbf52cd849dccc2c223783e1d385704ea86b8dd04290c0a9896c634edf522738854610140565b600161024f81610b94565b60008051602061182e8339815191525460ff166102a55760405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081a5b9a5d1a585b1a5e9959608a1b60448201526064015b60405180910390fd5b5060008051602061182e833981519152805460ff1916905560008051602061184e83398151915280546001600160a01b0319169055565b60026102e781610b94565b5060008051602061182e8339815191528054911515620100000262ffff0019909216919091176101001790557fbf52cd849dccc2c223783e1d385704ea86b8dd04290c0a9896c634edf5227387557f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907b929092557f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907c557f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907d55565b60016103ab81610b94565b60008051602061182e8339815191525460ff16156104015760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015260640161029c565b5060008051602061184e83398151915280546001600160a01b0319166001600160a01b039290921691909117905560008051602061182e833981519152805460ff19166001179055565b600261045681610b94565b5060008051602061182e833981519152805462ffff0019169055565b807f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b3815690786001600160401b0382166104da5760405162461bcd60e51b815260206004820152600d60248201526c05175616e74697479206973203609c1b604482015260640161029c565b8060040154826001600160401b0316111561052f5760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b604482015260640161029c565b6000816003015411801561056157508060030154826001600160401b0316610555610bca565b61055f919061168c565b115b156105a45760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b604482015260640161029c565b60008051602061182e8339815191525460008051602061184e8339815191529062010000900460ff161561060b5760405162461bcd60e51b815260206004820152600e60248201526d50726573616c652061637469766560901b604482015260640161029c565b6003810154610100900460ff166106565760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b604482015260640161029c565b7f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907d548461068287610c16565b61068c919061169f565b6001600160401b031611156106b35760405162461bcd60e51b815260040161029c906116c6565b6106bd8486610c53565b5050505050565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a5460408051630317c2dd60e01b81526001600482015281516000936201000090046001600160a01b031692849283928592630317c2dd92602480820193918290030181865afa15801561073c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076091906116fd565b909250905061076f818361168c565b935050505090565b600161078281610b94565b600060008051602061184e83398151915280546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156107e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108049190611721565b9050600081116108425760405162461bcd60e51b8152602060048201526009602482015268302062616c616e636560b81b604482015260640161029c565b61085f61084d610eb8565b83546001600160a01b03169083610efe565b505050565b837f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b3815690786001600160401b0382166108cc5760405162461bcd60e51b815260206004820152600d60248201526c05175616e74697479206973203609c1b604482015260640161029c565b8060040154826001600160401b031611156109215760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b604482015260640161029c565b6000816003015411801561095357508060030154826001600160401b0316610947610bca565b610951919061168c565b115b156109965760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b604482015260640161029c565b7f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907860008051602061184e8339815191526000886109d28b610c16565b6109dc919061169f565b6001600160401b031690508160030160029054906101000a900460ff16610a3a5760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b604482015260640161029c565b8260010154600003610a805760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481b9bdd081cd95d608a1b604482015260640161029c565b8260050154811115610aa45760405162461bcd60e51b815260040161029c906116c6565b87811115610ac45760405162461bcd60e51b815260040161029c906116c6565b610b4087878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050505060018501546040516bffffffffffffffffffffffff1960608f901b166020820152603481018c905260540160405160208183030381529060405280519060200120610f61565b610b7e5760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481a5b9d985b1a59608a1b604482015260640161029c565b610b88898b610c53565b50505050505050505050565b638b78c6d8600c5233600052806020600c205416610bc757638b78c6d819543314610bc7576382b429006000526004601cfd5b50565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c41547f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4054036000190190565b6001600160a01b031660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45602052604090205460c01c90565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a547fbf52cd849dccc2c223783e1d385704ea86b8dd04290c0a9896c634edf52273875460008051602061184e833981519152916201000090046001600160a01b031690600090610cce906001600160401b0387169061173a565b604051630317c2dd60e01b81526001600160401b038716600482015290915060009081906001600160a01b03851690630317c2dd906024016040805180830381865afa158015610d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4691906116fd565b909250905034610d56828461168c565b1115610d965760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b604482015260640161029c565b610da08483610f77565b8015610e1157610e11306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0b9190611751565b82610f77565b600285018054840190558454610e32906001600160a01b0316873086611090565b610e9c8688610e4089610c16565b610e4a919061169f565b6001600160a01b039190911660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c456020526040902080546001600160c01b031660c09290921b919091179055565b610eaf86886001600160401b03166110ce565b50505050505050565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5e546000906001600160a01b03163303610ef9575060131936013560601c90565b503390565b6040516001600160a01b03831660248201526044810182905261085f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611209565b600082610f6e85846112de565b14949350505050565b80471015610fc75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161029c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611014576040519150601f19603f3d011682016040523d82523d6000602084013e611019565b606091505b505090508061085f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161029c565b6040516001600160a01b03808516602483015283166044820152606481018290526110c89085906323b872dd60e01b90608401610f2a565b50505050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405460008290036111095761110963b562e8dd60e01b61132d565b60008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602090815260408083206001600160a01b0387164260a01b6001881460e11b1781179091558084527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4590925282208054680100000000000000018602019055908190036111a5576111a5622e076360e81b61132d565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a48181600101915081036111aa57507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405550505050565b600061125e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113379092919063ffffffff16565b905080516000148061127f57508080602001905181019061127f919061176e565b61085f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161029c565b600081815b84518110156113235761130f828683815181106113025761130261178b565b602002602001015161134e565b91508061131b816117a1565b9150506112e3565b5090505b92915050565b8060005260046000fd5b60606113468484600085611380565b949350505050565b600081831061136a576000828152602084905260409020611379565b60008381526020839052604090205b9392505050565b6060824710156113e15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161029c565b600080866001600160a01b031685876040516113fd91906117de565b60006040518083038185875af1925050503d806000811461143a576040519150601f19603f3d011682016040523d82523d6000602084013e61143f565b606091505b50915091506114508783838761145b565b979650505050505050565b606083156114ca5782516000036114c3576001600160a01b0385163b6114c35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161029c565b5081611346565b61134683838151156114df5781518083602001fd5b8060405162461bcd60e51b815260040161029c91906117fa565b8015158114610bc757600080fd5b600080600080600060a0868803121561151f57600080fd5b853594506020860135935060408601359250606086013591506080860135611546816114f9565b809150509295509295909350565b6001600160a01b0381168114610bc757600080fd5b60006020828403121561157b57600080fd5b813561137981611554565b80356001600160401b038116811461159d57600080fd5b919050565b600080604083850312156115b557600080fd5b82356115c081611554565b91506115ce60208401611586565b90509250929050565b6000806000806000608086880312156115ef57600080fd5b85356115fa81611554565b945061160860208701611586565b93506040860135925060608601356001600160401b038082111561162b57600080fd5b818801915088601f83011261163f57600080fd5b81358181111561164e57600080fd5b8960208260051b850101111561166357600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561132757611327611676565b6001600160401b038181168382160190808211156116bf576116bf611676565b5092915050565b60208082526017908201527f4578636565646564206d6178207065722077616c6c6574000000000000000000604082015260600190565b6000806040838503121561171057600080fd5b505080516020909101519092909150565b60006020828403121561173357600080fd5b5051919050565b808202811582820484141761132757611327611676565b60006020828403121561176357600080fd5b815161137981611554565b60006020828403121561178057600080fd5b8151611379816114f9565b634e487b7160e01b600052603260045260246000fd5b6000600182016117b3576117b3611676565b5060010190565b60005b838110156117d55781810151838201526020016117bd565b50506000910152565b600082516117f08184602087016117ba565b9190910192915050565b60208152600082518060208401526118198160408501602087016117ba565b601f01601f1916919091016040019291505056febf52cd849dccc2c223783e1d385704ea86b8dd04290c0a9896c634edf5227389bf52cd849dccc2c223783e1d385704ea86b8dd04290c0a9896c634edf5227386a264697066735822122017319a8d4e0beb4e8a48a8eb32bd6fc796505e115cb26ab096674ac979bf499364736f6c63430008130033";t.ApeDropFacet__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApeDropFacet__factory=void 0;var n=r(181);Object.defineProperty(t,"ApeDropFacet__factory",{enumerable:!0,get:function(){return n.ApeDropFacet__factory}})},720:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.DropFacet__factory=void 0;var o=r(391),a=[{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{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:"uint256",name:"fromTokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"toTokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"ConsecutiveTransfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"uint256",name:"roles",type:"uint256"}],name:"RolesUpdated",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:[],name:"airdropFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint64[]",name:"quantities",type:"uint64[]"},{internalType:"address[]",name:"recipients",type:"address[]"}],name:"batchAirdrop",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"displayPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"dropRevenue",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxPerMint",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxPerWallet",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"mintFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint64",name:"quantity",type:"uint64"}],name:"mintTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"presaleActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint64",name:"quantity",type:"uint64"},{internalType:"uint256",name:"allowed",type:"uint256"},{internalType:"bytes32[]",name:"proof",type:"bytes32[]"}],name:"presaleMintTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"price",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"saleActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"newRoot",type:"bytes32"}],name:"setMerkleRoot",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"newMaxAmount",type:"uint256"},{internalType:"uint256",name:"newMaxPerMint",type:"uint256"},{internalType:"uint256",name:"newMaxPerWallet",type:"uint256"},{internalType:"uint256",name:"newPrice",type:"uint256"},{internalType:"bool",name:"presale",type:"bool"}],name:"startSale",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"stopSale",outputs:[],stateMutability:"nonpayable",type:"function"}],s="0x608060405234801561001057600080fd5b50611a8e806100206000396000f3fe6080604052600436106100f35760003560e01c8063789e3a551161008a578063a035b1fe11610059578063a035b1fe146102d7578063d53ab501146102ec578063e36b0b37146102ff578063fd51fae81461031457600080fd5b8063789e3a551461026d5780637cb647591461028f57806393d756aa146102af57806398624455146102c257600080fd5b806353135ca0116100c657806353135ca0146101aa5780635541c605146101db5780635f48f3931461020f57806368428a1b1461024357600080fd5b806313966db5146100f857806335b69a3f14610120578063453c231014610142578063507e094f14610176575b600080fd5b34801561010457600080fd5b5061010d610327565b6040519081526020015b60405180910390f35b34801561012c57600080fd5b506000805160206119f98339815191525461010d565b34801561014e57600080fd5b507f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907d5461010d565b34801561018257600080fd5b507f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907c5461010d565b3480156101b657600080fd5b50600080516020611a198339815191525460ff165b6040519015158152602001610117565b3480156101e757600080fd5b507f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907a5461010d565b34801561021b57600080fd5b507f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907b5461010d565b34801561024f57600080fd5b50600080516020611a1983398151915254610100900460ff166101cb565b34801561027957600080fd5b5061028d6102883660046115b2565b6103c8565b005b34801561029b57600080fd5b5061028d6102aa366004611604565b610477565b61028d6102bd36600461164e565b6104a7565b3480156102ce57600080fd5b5061010d6106c9565b3480156102e357600080fd5b5061010d61076f565b61028d6102fa3660046116ce565b61082d565b34801561030b57600080fd5b5061028d610b1b565b61028d610322366004611739565b610b41565b6000805160206119b98339815191525460408051630317c2dd60e01b81526001600482015281516000936201000090046001600160a01b031692849283928592630317c2dd92602480820193918290030181865afa15801561038d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b191906117a9565b90925090506103c081836117e3565b935050505090565b60026103d381610e2b565b50600080516020611a19833981519152805491151561ffff19909216919091176101001790557f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907b939093557f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907c919091557f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907d556000805160206119f983398151915255565b600261048281610e2b565b507f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907955565b80600080516020611a398339815191526001600160401b0382166105025760405162461bcd60e51b815260206004820152600d60248201526c05175616e74697479206973203609c1b60448201526064015b60405180910390fd5b8060040154826001600160401b031611156105575760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b60448201526064016104f9565b6000816003015411801561058957508060030154826001600160401b031661057d610e61565b61058791906117e3565b115b156105cc5760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b60448201526064016104f9565b600080516020611a1983398151915254600080516020611a398339815191529060ff161561062d5760405162461bcd60e51b815260206004820152600e60248201526d50726573616c652061637469766560901b60448201526064016104f9565b6007810154610100900460ff166106785760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b60448201526064016104f9565b80600501548461068787610e9b565b61069191906117f6565b6001600160401b031611156106b85760405162461bcd60e51b81526004016104f99061181d565b6106c28486610ed8565b5050505050565b6000805160206119b98339815191525460408051630317c2dd60e01b81526001600482015281516000936201000090046001600160a01b031692849283928592630317c2dd92602480820193918290030181865afa15801561072f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075391906117a9565b915091506000811161076557816103c0565b6000935050505090565b6000805160206119b9833981519152546000805160206119f98339815191525460408051630317c2dd60e01b81526001600482015281516000946201000090046001600160a01b03169392859283928692630317c2dd92602480820193918290030181865afa1580156107e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080a91906117a9565b90925090508061081a83856117e3565b61082491906117e3565b94505050505090565b600261083881610e2b565b8184811461087c5760405162461bcd60e51b8152602060048201526011602482015270496e76616c696420417267756d656e747360781b60448201526064016104f9565b6000805b8281101561091a576108e786868381811061089d5761089d611854565b90506020020160208101906108b2919061186a565b8989848181106108c4576108c4611854565b90506020020160208101906108d99190611887565b6001600160401b0316611114565b8787828181106108f9576108f9611854565b905060200201602081019061090e9190611887565b90910190600101610880565b5060007f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5660040160029054906101000a90046001600160a01b031690506000816001600160a01b031663788914d0306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca91906118a2565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610a0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3291906118bf565b6bffffffffffffffffffffffff161115610a4e575050506106c2565b604051630317c2dd60e01b81526001600160401b03831660048201526000906001600160a01b03831690630317c2dd906024016040805180830381865afa158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac191906117a9565b50905034811115610b065760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b60448201526064016104f9565b610b108282611132565b505050505050505050565b6002610b2681610e2b565b50600080516020611a19833981519152805461ffff19169055565b83600080516020611a398339815191526001600160401b038216610b975760405162461bcd60e51b815260206004820152600d60248201526c05175616e74697479206973203609c1b60448201526064016104f9565b8060040154826001600160401b03161115610bec5760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b60448201526064016104f9565b60008160030154118015610c1e57508060030154826001600160401b0316610c12610e61565b610c1c91906117e3565b115b15610c615760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b60448201526064016104f9565b600080516020611a39833981519152600087610c7c8a610e9b565b610c8691906117f6565b60078301546001600160401b0391909116915060ff16610cdd5760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b60448201526064016104f9565b8160010154600003610d235760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481b9bdd081cd95d608a1b60448201526064016104f9565b8160050154811115610d475760405162461bcd60e51b81526004016104f99061181d565b86811115610d675760405162461bcd60e51b81526004016104f99061181d565b610de386868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050505060018401546040516bffffffffffffffffffffffff1960608e901b166020820152603481018b905260540160405160208183030381529060405280519060200120611250565b610e215760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481a5b9d985b1a59608a1b60448201526064016104f9565b610b10888a610ed8565b638b78c6d8600c5233600052806020600c205416610e5e57638b78c6d819543314610e5e576382b429006000526004601cfd5b50565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c41546000805160206119d983398151915254036000190190565b6001600160a01b031660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45602052604090205460c01c90565b6000805160206119b9833981519152546000805160206119f983398151915254620100009091046001600160a01b031690600080516020611a3983398151915290600090610f30906001600160401b038716906118ed565b604051630317c2dd60e01b81526001600160401b038716600482015290915060009081906001600160a01b03861690630317c2dd906024016040805180830381865afa158015610f84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa891906117a9565b90925090503481610fb984866117e3565b610fc391906117e3565b11156110035760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b60448201526064016104f9565b6002840180543401839003829003905561101d8583611132565b801561108e5761108e306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611064573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108891906118a2565b82611132565b6110f8868861109c89610e9b565b6110a691906117f6565b6001600160a01b039190911660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c456020526040902080546001600160c01b031660c09290921b919091179055565b61110b86886001600160401b0316611266565b50505050505050565b61112e82826040518060200160405280600081525061137d565b5050565b804710156111825760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016104f9565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146111cf576040519150601f19603f3d011682016040523d82523d6000602084013e6111d4565b606091505b505090508061124b5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016104f9565b505050565b60008261125d85846113f9565b14949350505050565b6000805160206119d983398151915254600082900361128f5761128f63b562e8dd60e01b611448565b60008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602090815260408083206001600160a01b0387164260a01b6001881460e11b1781179091558084527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45909252822080546801000000000000000186020190559081900361132b5761132b622e076360e81b611448565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a481816001019150810361133057506000805160206119d98339815191525550505050565b6113878383611266565b6001600160a01b0383163b1561124b576000805160206119d9833981519152548281035b6113be6000868380600101945086611452565b6113d2576113d26368d2bf6b60e11b611448565b8181106113ab57816000805160206119d983398151915254146106c2576106c26000611448565b600081815b845181101561143e5761142a8286838151811061141d5761141d611854565b602002602001015161153a565b91508061143681611904565b9150506113fe565b5090505b92915050565b8060005260046000fd5b6000836001600160a01b031663150b7a0261146b61156c565b8786866040518563ffffffff1660e01b815260040161148d949392919061191d565b6020604051808303816000875af19250505080156114c8575060408051601f3d908101601f191682019092526114c59181019061198e565b60015b61151d573d8080156114f6576040519150601f19603f3d011682016040523d82523d6000602084013e6114fb565b606091505b508051600003611515576115156368d2bf6b60e11b611448565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6000818310611556576000828152602084905260409020611565565b60008381526020839052604090205b9392505050565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5e546000906001600160a01b031633036115ad575060131936013560601c90565b503390565b600080600080600060a086880312156115ca57600080fd5b85359450602086013593506040860135925060608601359150608086013580151581146115f657600080fd5b809150509295509295909350565b60006020828403121561161657600080fd5b5035919050565b6001600160a01b0381168114610e5e57600080fd5b80356001600160401b038116811461164957600080fd5b919050565b6000806040838503121561166157600080fd5b823561166c8161161d565b915061167a60208401611632565b90509250929050565b60008083601f84011261169557600080fd5b5081356001600160401b038111156116ac57600080fd5b6020830191508360208260051b85010111156116c757600080fd5b9250929050565b600080600080604085870312156116e457600080fd5b84356001600160401b03808211156116fb57600080fd5b61170788838901611683565b9096509450602087013591508082111561172057600080fd5b5061172d87828801611683565b95989497509550505050565b60008060008060006080868803121561175157600080fd5b853561175c8161161d565b945061176a60208701611632565b93506040860135925060608601356001600160401b0381111561178c57600080fd5b61179888828901611683565b969995985093965092949392505050565b600080604083850312156117bc57600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b80820180821115611442576114426117cd565b6001600160401b03818116838216019080821115611816576118166117cd565b5092915050565b60208082526017908201527f4578636565646564206d6178207065722077616c6c6574000000000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561187c57600080fd5b81356115658161161d565b60006020828403121561189957600080fd5b61156582611632565b6000602082840312156118b457600080fd5b81516115658161161d565b6000602082840312156118d157600080fd5b81516bffffffffffffffffffffffff8116811461156557600080fd5b8082028115828204841417611442576114426117cd565b600060018201611916576119166117cd565b5060010190565b600060018060a01b038087168352602081871681850152856040850152608060608501528451915081608085015260005b8281101561196a5785810182015185820160a00152810161194e565b5050600060a0828501015260a0601f19601f83011684010191505095945050505050565b6000602082840312156119a057600080fd5b81516001600160e01b03198116811461156557600080fdfe45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c408463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907e8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b381569078a26469706673582212202adc62a9ecaeaa6d3a506176f2a21c1e432b226a3885dbd152b126f6d44ffc2864736f6c63430008130033";t.DropFacet__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DropFacet__factory=void 0;var n=r(720);Object.defineProperty(t,"DropFacet__factory",{enumerable:!0,get:function(){return n.DropFacet__factory}})},948:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EditionFacet__factory=void 0;var o=r(391),a=[{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{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:"uint256",name:"fromTokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"toTokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"ConsecutiveTransfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"editionId",type:"uint256"}],name:"EditionCreated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"editionId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"quantity",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"EditionMinted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"uint256",name:"roles",type:"uint256"}],name:"RolesUpdated",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:"string",name:"tokenURI",type:"string"},{internalType:"uint256",name:"price",type:"uint256"},{internalType:"uint256",name:"maxQuantity",type:"uint256"},{internalType:"uint256",name:"maxPerWallet",type:"uint256"},{internalType:"uint256",name:"maxPerMint",type:"uint256"}],name:"createEdition",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"editionMintFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"editionRevenue",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"editionsCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"}],name:"getEdition",outputs:[{components:[{internalType:"string",name:"tokenURI",type:"string"},{internalType:"bytes32",name:"merkleRoot",type:"bytes32"},{internalType:"uint256",name:"price",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"uint256",name:"maxQuantity",type:"uint256"},{internalType:"uint256",name:"maxPerWallet",type:"uint256"},{internalType:"uint256",name:"maxPerMint",type:"uint256"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"address",name:"signer",type:"address"},{internalType:"bool",name:"active",type:"bool"}],internalType:"struct EditionStorage.Edition",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"}],name:"getEditionPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"editionId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"bytes32[]",name:"proof",type:"bytes32[]"}],name:"mintEdition",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"},{internalType:"bool",name:"active",type:"bool"}],name:"setEditionActive",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"},{internalType:"bytes32",name:"merkleRoot",type:"bytes32"}],name:"setEditionMerkleRoot",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],name:"setEditionSigner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"},{internalType:"string",name:"tokenURI",type:"string"}],name:"setEditionTokenURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"editionId",type:"uint256"},{internalType:"uint256",name:"price",type:"uint256"},{internalType:"uint256",name:"maxQuantity",type:"uint256"},{internalType:"uint256",name:"maxPerWallet",type:"uint256"},{internalType:"uint256",name:"maxPerMint",type:"uint256"}],name:"updateEdition",outputs:[],stateMutability:"nonpayable",type:"function"}],s="0x608060405234801561001057600080fd5b506118a0806100206000396000f3fe6080604052600436106100a75760003560e01c8063906c012111610064578063906c012114610167578063a619976d14610187578063a642c032146101bb578063c88355b4146101e8578063ca696f4814610208578063fab7ee7b1461022857600080fd5b80631475df11146100ac57806343d7b495146100ce5780635eb30d1c146100e1578063654762ce146101125780638328265714610132578063835f610d14610152575b600080fd5b3480156100b857600080fd5b506100cc6100c7366004611285565b610248565b005b6100cc6100dc3660046112d5565b6102b7565b3480156100ed57600080fd5b5060008051602061184b833981519152545b6040519081526020015b60405180910390f35b34801561011e57600080fd5b506100cc61012d36600461136e565b61057e565b34801561013e57600080fd5b506100cc61014d366004611446565b6105e8565b34801561015e57600080fd5b506100ff610744565b34801561017357600080fd5b506100cc6101823660046114a3565b6107f7565b34801561019357600080fd5b507f0193784bd9621be915feb61a02526941c48cf0476dacde52dea7f0e7110ed0d9546100ff565b3480156101c757600080fd5b506101db6101d63660046114ea565b610852565b6040516101099190611549565b3480156101f457600080fd5b506100ff6102033660046114ea565b6109f4565b34801561021457600080fd5b506100cc6102233660046115e3565b610b03565b34801561023457600080fd5b506100cc610243366004611608565b610b70565b600261025381610bc3565b60008051602061184b8339815191528054871061028b5760405162461bcd60e51b81526004016102829061162a565b60405180910390fd5b600096875260010160205250604090942060028101939093556004830191909155600582015560060155565b60007f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db56600401546201000090046001600160a01b03169050600060008051602061184b83398151915260008781526001820160205260408082209051630317c2dd60e01b8152600481018990529293509181906001600160a01b03861690630317c2dd906024016040805180830381865afa15801561035a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037e9190611652565b91509150888460000154116103a55760405162461bcd60e51b81526004016102829061162a565b6008830154600160a01b900460ff166103ed5760405162461bcd60e51b815260206004820152600a6024820152694e6f742061637469766560b01b6044820152606401610282565b3481838a8660020154610400919061168c565b61040a91906116a3565b61041491906116a3565b11156104545760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b6044820152606401610282565b61046184848b8d8c610bf9565b61046d838b8989610d2e565b60038401805434018390038290039055600089815260028501602090815260408083206001600160a01b038e16845290915290208054890190556104b18583610def565b801561052257610522306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051c91906116b6565b82610def565b61052d838b8a610f0d565b604080518981523460208201528a916001600160a01b038d16917f2974dcc018eac8a0cea38a8688ad4a3cc7686e4edd75be71818e23d62ef2265f910160405180910390a350505050505050505050565b600261058981610bc3565b60008051602061184b833981519152805484106105b85760405162461bcd60e51b81526004016102829061162a565b60009384526001016020525060409091206008018054911515600160a01b0260ff60a01b19909216919091179055565b60026105f381610bc3565b60008051602061184b83398151915280546040805161014081018252898152600060208201819052918101899052606081018290526080810188905260a0810187905260c0810186905260e08101919091526101008101610652611063565b6001600160a01b0316815260006020918201819052838152600185019091526040902081518190610683908261175b565b5060208201516001808301919091556040808401516002840155606084015160038401556080840151600484015560a0840151600584015560c0840151600684015560e0840151600784015561010084015160089093018054610120909501511515600160a01b026001600160a81b03199095166001600160a01b039094169390931793909317909155820183555181907f962bb64b059ad60d491bef43125921210925c52b11ff1cc093409113c8c5fe3790600090a25050505050505050565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a5460408051630317c2dd60e01b81526001600482015281516000936201000090046001600160a01b031692849283928592630317c2dd92602480820193918290030181865afa1580156107bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e09190611652565b90925090506107ef81836116a3565b935050505090565b600261080281610bc3565b60008051602061184b833981519152805484106108315760405162461bcd60e51b81526004016102829061162a565b6000848152600182016020526040902061084b848261175b565b5050505050565b6108b6604051806101400160405280606081526020016000801916815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b031681526020016000151581525090565b60008281527f0193784bd9621be915feb61a02526941c48cf0476dacde52dea7f0e7110ed0d7602052604090819020815161014081019092528054829082906108fe906116d3565b80601f016020809104026020016040519081016040528092919081815260200182805461092a906116d3565b80156109775780601f1061094c57610100808354040283529160200191610977565b820191906000526020600020905b81548152906001019060200180831161095a57829003601f168201915b505050918352505060018201546020820152600282015460408201526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546001600160a01b038116610100830152600160a01b900460ff1615156101209091015292915050565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a5460008051602061184b83398151915280546000926201000090046001600160a01b031691908410610a595760405162461bcd60e51b81526004016102829061162a565b60008481526001828101602052604080832060028101549151630317c2dd60e01b8152600481019390935292909181906001600160a01b03871690630317c2dd906024016040805180830381865afa158015610ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610add9190611652565b909250905080610aed83856116a3565b610af791906116a3565b98975050505050505050565b6002610b0e81610bc3565b60008051602061184b83398151915280548410610b3d5760405162461bcd60e51b81526004016102829061162a565b600093845260010160205250604090912060080180546001600160a01b0319166001600160a01b03909216919091179055565b6002610b7b81610bc3565b60008051602061184b83398151915280548410610baa5760405162461bcd60e51b81526004016102829061162a565b6000938452600190810160205260409093209092015550565b638b78c6d8600c5233600052806020600c205416610bf657638b78c6d819543314610bf6576382b429006000526004601cfd5b50565b6005840154600084815260028701602090815260408083206001600160a01b0387168452909152902054610c2e9083906116a3565b1115610c7c5760405162461bcd60e51b815260206004820152601760248201527f4578636565646564206d6178207065722077616c6c65740000000000000000006044820152606401610282565b8360060154811115610cc85760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b6044820152606401610282565b60048401541580610cec57508360040154818560030154610ce991906116a3565b11155b61084b5760405162461bcd60e51b8152602060048201526013602482015272115e18d959591959081b585e08185b5bdd5b9d606a1b6044820152606401610282565b600184015415610de957610dad82828080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050505060018601546040516bffffffffffffffffffffffff19606088901b166020820152603401604051602081830303815290604052805190602001206110a9565b610de95760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610282565b50505050565b80471015610e3f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610282565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610e8c576040519150601f19603f3d011682016040523d82523d6000602084013e610e91565b606091505b5050905080610f085760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610282565b505050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4054805b610f3b82846116a3565b81101561104e576040518060400160405280600115158152602001866000018054610f65906116d3565b80601f0160208091040260200160405190810160405280929190818152602001828054610f91906116d3565b8015610fde5780601f10610fb357610100808354040283529160200191610fde565b820191906000526020600020905b815481529060010190602001808311610fc157829003601f168201915b505050505081525061100d7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5690565b6000838152600391909101602090815260409091208251815460ff1916901515178155908201516001820190611043908261175b565b505050600101610f31565b5060038401805483019055610de983836110bf565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5e546000906001600160a01b031633036110a4575060131936013560601c90565b503390565b6000826110b685846111fa565b14949350505050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405460008290036110fa576110fa63b562e8dd60e01b611249565b60008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602090815260408083206001600160a01b0387164260a01b6001881460e11b1781179091558084527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45909252822080546801000000000000000186020190559081900361119657611196622e076360e81b611249565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a481816001019150810361119b57507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405550505050565b600081815b845181101561123f5761122b8286838151811061121e5761121e61181b565b6020026020010151611253565b91508061123781611831565b9150506111ff565b5090505b92915050565b8060005260046000fd5b600081831061126f57600082815260208490526040902061127e565b60008381526020839052604090205b9392505050565b600080600080600060a0868803121561129d57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6001600160a01b0381168114610bf657600080fd5b6000806000806000608086880312156112ed57600080fd5b85356112f8816112c0565b94506020860135935060408601359250606086013567ffffffffffffffff8082111561132357600080fd5b818801915088601f83011261133757600080fd5b81358181111561134657600080fd5b8960208260051b850101111561135b57600080fd5b9699959850939650602001949392505050565b6000806040838503121561138157600080fd5b823591506020830135801515811461139857600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126113ca57600080fd5b813567ffffffffffffffff808211156113e5576113e56113a3565b604051601f8301601f19908116603f0116810190828211818310171561140d5761140d6113a3565b8160405283815286602085880101111561142657600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a0868803121561145e57600080fd5b853567ffffffffffffffff81111561147557600080fd5b611481888289016113b9565b9860208801359850604088013597606081013597506080013595509350505050565b600080604083850312156114b657600080fd5b82359150602083013567ffffffffffffffff8111156114d457600080fd5b6114e0858286016113b9565b9150509250929050565b6000602082840312156114fc57600080fd5b5035919050565b6000815180845260005b818110156115295760208185018101518683018201520161150d565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260008251610140806020850152611568610160850183611503565b9150602085015160408501526040850151606085015260608501516080850152608085015160a085015260a085015160c085015260c085015160e085015260e08501516101008181870152808701519150506101206115d1818701836001600160a01b03169052565b90950151151593019290925250919050565b600080604083850312156115f657600080fd5b823591506020830135611398816112c0565b6000806040838503121561161b57600080fd5b50508035926020909101359150565b6020808252600e908201526d111bd95cc81b9bdd08195e1a5cdd60921b604082015260600190565b6000806040838503121561166557600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761124357611243611676565b8082018082111561124357611243611676565b6000602082840312156116c857600080fd5b815161127e816112c0565b600181811c908216806116e757607f821691505b60208210810361170757634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610f0857600081815260208120601f850160051c810160208610156117345750805b601f850160051c820191505b8181101561175357828155600101611740565b505050505050565b815167ffffffffffffffff811115611775576117756113a3565b6117898161178384546116d3565b8461170d565b602080601f8311600181146117be57600084156117a65750858301515b600019600386901b1c1916600185901b178555611753565b600085815260208120601f198616915b828110156117ed578886015182559484019460019091019084016117ce565b508582101561180b5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b60006001820161184357611843611676565b506001019056fe0193784bd9621be915feb61a02526941c48cf0476dacde52dea7f0e7110ed0d6a2646970667358221220d55b27b192b0534c0f2f9d6713b623693c32fe9a5beb8021d520ac801733f08e64736f6c63430008130033";t.EditionFacet__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},1:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditionFacet__factory=void 0;var n=r(948);Object.defineProperty(t,"EditionFacet__factory",{enumerable:!0,get:function(){return n.EditionFacet__factory}})},501:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ERC20AppFacet__factory=void 0;var o=r(391),a=[{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{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:"uint256",name:"fromTokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"toTokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"ConsecutiveTransfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"uint256",name:"roles",type:"uint256"}],name:"RolesUpdated",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:[],name:"erc20ActiveCoin",outputs:[{internalType:"contract IERC20Upgradeable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"erc20CoinByIndex",outputs:[{internalType:"contract IERC20Upgradeable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"erc20CoinsCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"erc20MintFee",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint64",name:"quantity",type:"uint64"}],name:"erc20MintTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"erc20PresaleActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint64",name:"quantity",type:"uint64"},{internalType:"uint256",name:"allowed",type:"uint256"},{internalType:"bytes32[]",name:"proof",type:"bytes32[]"}],name:"erc20PresaleMintTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"erc20Price",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"}],name:"erc20Revenue",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"erc20SaleActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"}],name:"erc20SetActiveCoin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"newMaxAmount",type:"uint256"},{internalType:"uint256",name:"newMaxPerMint",type:"uint256"},{internalType:"uint256",name:"newMaxPerWallet",type:"uint256"},{internalType:"uint256",name:"newPrice",type:"uint256"},{internalType:"bool",name:"presale",type:"bool"}],name:"erc20StartSale",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"erc20StopSale",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"}],name:"erc20Withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}],s="0x608060405234801561001057600080fd5b506119d2806100206000396000f3fe6080604052600436106100dd5760003560e01c8063b694460f1161007f578063d4461d5111610059578063d4461d51146102f4578063f0769c3314610307578063f673e0b71461031a578063fef8ddda1461033a57600080fd5b8063b694460f14610225578063c936b23c1461024a578063d1b022bd1461029f57600080fd5b806356da1506116100bb57806356da15061461017d5780637081ff9b1461019d578063abee801f146101b2578063afab9bb7146101f157600080fd5b806315d11e81146100e25780634adccde5146101045780634fb58bab14610147575b600080fd5b3480156100ee57600080fd5b506101026100fd366004611604565b61034f565b005b34801561011057600080fd5b507fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68aa545b6040519081526020015b60405180910390f35b34801561015357600080fd5b5060008051602061193d83398151915254610100900460ff165b604051901515815260200161013e565b34801561018957600080fd5b50610102610198366004611604565b6104b5565b3480156101a957600080fd5b506101346105a5565b3480156101be57600080fd5b5060008051602061195d833981519152546001600160a01b03165b6040516001600160a01b03909116815260200161013e565b3480156101fd57600080fd5b507fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68a954610134565b34801561023157600080fd5b5060008051602061193d8339815191525460ff1661016d565b34801561025657600080fd5b50610134610265366004611604565b6001600160a01b031660009081527fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68a6602052604090205490565b3480156102ab57600080fd5b506101d96102ba366004611621565b60009081527fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68a860205260409020546001600160a01b031690565b610102610302366004611656565b610658565b61010261031536600461168b565b61088b565b34801561032657600080fd5b50610102610335366004611738565b610b97565b34801561034657600080fd5b50610102610c4e565b600161035a81610c74565b6001600160a01b0382811660009081527fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68a7602052604090205460008051602061195d8339815191529116806103e95760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a590818dbdb9d1c9858dd60821b60448201526064015b60405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610430573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104549190611785565b9050600081116104925760405162461bcd60e51b8152602060048201526009602482015268302062616c616e636560b81b60448201526064016103e0565b6104ae61049d610caa565b6001600160a01b0384169083610cf0565b5050505050565b60026104c081610c74565b6001600160a01b0382811660009081527fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68a7602052604090205460008051602061195d8339815191529116610571576001600160a01b0383166000818152600283016020908152604080832080546001600160a01b03199081168617909155600486018054855260038701909352908320805490911690931790925581548592909161056a836117b4565b9190505550505b6001600160a01b03928316600090815260028201602052604090205481546001600160a01b03191693169290921790915550565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a5460408051630317c2dd60e01b81526001600482015281516000936201000090046001600160a01b031692849283928592630317c2dd92602480820193918290030181865afa15801561061d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064191906117cd565b909250905061065081836117f1565b935050505090565b8060008051602061197d8339815191526001600160401b0382166106ae5760405162461bcd60e51b815260206004820152600d60248201526c05175616e74697479206973203609c1b60448201526064016103e0565b8060040154826001600160401b031611156107035760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b60448201526064016103e0565b6000816003015411801561073557508060030154826001600160401b0316610729610d58565b61073391906117f1565b115b156107785760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b60448201526064016103e0565b60008051602061193d8339815191525460008051602061195d83398151915290610100900460ff16156107de5760405162461bcd60e51b815260206004820152600e60248201526d50726573616c652061637469766560901b60448201526064016103e0565b600681015460ff166108245760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b60448201526064016103e0565b7f8463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b38156907d548461085087610da4565b61085a9190611804565b6001600160401b031611156108815760405162461bcd60e51b81526004016103e09061182b565b6104ae8486610de1565b8360008051602061197d8339815191526001600160401b0382166108e15760405162461bcd60e51b815260206004820152600d60248201526c05175616e74697479206973203609c1b60448201526064016103e0565b8060040154826001600160401b031611156109365760405162461bcd60e51b8152602060048201526015602482015274115e18d959591959081b585e081c195c881b5a5b9d605a1b60448201526064016103e0565b6000816003015411801561096857508060030154826001600160401b031661095c610d58565b61096691906117f1565b115b156109ab5760405162461bcd60e51b81526020600482015260136024820152724578636565646564206d617820737570706c7960681b60448201526064016103e0565b60008051602061197d83398151915260008051602061195d8339815191526000886109d58b610da4565b6109df9190611804565b6001600160401b031690508160060160019054906101000a900460ff16610a3d5760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b60448201526064016103e0565b8260010154600003610a835760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481b9bdd081cd95d608a1b60448201526064016103e0565b8260050154811115610aa75760405162461bcd60e51b81526004016103e09061182b565b87811115610ac75760405162461bcd60e51b81526004016103e09061182b565b610b4387878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050505060018501546040516bffffffffffffffffffffffff1960608f901b166020820152603481018c905260540160405160208183030381529060405280519060200120611057565b610b815760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481a5b9d985b1a59608a1b60448201526064016103e0565b610b8b898b610de1565b50505050505050505050565b6002610ba281610c74565b60008051602061195d833981519152805460008051602061197d833981519152906001600160a01b0316610c115760405162461bcd60e51b8152602060048201526016602482015275151bdad95b8810dbdb9d1c9858dd081b9bdd081cd95d60521b60448201526064016103e0565b6006820180549415156101000261ffff19909516949094176001179093556005908101939093555060038101949094556004840192909255910155565b6002610c5981610c74565b5060008051602061193d833981519152805461ffff19169055565b638b78c6d8600c5233600052806020600c205416610ca757638b78c6d819543314610ca7576382b429006000526004601cfd5b50565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5e546000906001600160a01b03163303610ceb575060131936013560601c90565b503390565b6040516001600160a01b038316602482015260448101829052610d5390849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261106d565b505050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c41547f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4054036000190190565b6001600160a01b031660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45602052604090205460c01c90565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a547fef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68aa5460008051602061195d833981519152916201000090046001600160a01b031690600090610e5c906001600160401b03871690611862565b604051630317c2dd60e01b81526001600160401b038716600482015290915060009081906001600160a01b03851690630317c2dd906024016040805180830381865afa158015610eb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed491906117cd565b909250905034610ee482846117f1565b1115610f245760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b60448201526064016103e0565b610f2e8483611142565b8015610f9f57610f9f306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f999190611879565b82611142565b84546001600160a01b03908116600090815260018701602052604090208054850190558554610fd1911687308661125b565b61103b8688610fdf89610da4565b610fe99190611804565b6001600160a01b039190911660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c456020526040902080546001600160c01b031660c09290921b919091179055565b61104e86886001600160401b0316611299565b50505050505050565b60008261106485846113d4565b14949350505050565b60006110c2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114239092919063ffffffff16565b90508051600014806110e35750808060200190518101906110e39190611896565b610d535760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103e0565b804710156111925760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016103e0565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146111df576040519150601f19603f3d011682016040523d82523d6000602084013e6111e4565b606091505b5050905080610d535760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016103e0565b6040516001600160a01b03808516602483015283166044820152606481018290526112939085906323b872dd60e01b90608401610d1c565b50505050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405460008290036112d4576112d463b562e8dd60e01b61143a565b60008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602090815260408083206001600160a01b0387164260a01b6001881460e11b1781179091558084527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45909252822080546801000000000000000186020190559081900361137057611370622e076360e81b61143a565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a481816001019150810361137557507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405550505050565b600081815b845181101561141957611405828683815181106113f8576113f86118b3565b6020026020010151611444565b915080611411816117b4565b9150506113d9565b5090505b92915050565b60606114328484600085611476565b949350505050565b8060005260046000fd5b600081831061146057600082815260208490526040902061146f565b60008381526020839052604090205b9392505050565b6060824710156114d75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103e0565b600080866001600160a01b031685876040516114f391906118ed565b60006040518083038185875af1925050503d8060008114611530576040519150601f19603f3d011682016040523d82523d6000602084013e611535565b606091505b509150915061154687838387611551565b979650505050505050565b606083156115c05782516000036115b9576001600160a01b0385163b6115b95760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103e0565b5081611432565b61143283838151156115d55781518083602001fd5b8060405162461bcd60e51b81526004016103e09190611909565b6001600160a01b0381168114610ca757600080fd5b60006020828403121561161657600080fd5b813561146f816115ef565b60006020828403121561163357600080fd5b5035919050565b80356001600160401b038116811461165157600080fd5b919050565b6000806040838503121561166957600080fd5b8235611674816115ef565b91506116826020840161163a565b90509250929050565b6000806000806000608086880312156116a357600080fd5b85356116ae816115ef565b94506116bc6020870161163a565b93506040860135925060608601356001600160401b03808211156116df57600080fd5b818801915088601f8301126116f357600080fd5b81358181111561170257600080fd5b8960208260051b850101111561171757600080fd5b9699959850939650602001949392505050565b8015158114610ca757600080fd5b600080600080600060a0868803121561175057600080fd5b8535945060208601359350604086013592506060860135915060808601356117778161172a565b809150509295509295909350565b60006020828403121561179757600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000600182016117c6576117c661179e565b5060010190565b600080604083850312156117e057600080fd5b505080516020909101519092909150565b8082018082111561141d5761141d61179e565b6001600160401b038181168382160190808211156118245761182461179e565b5092915050565b60208082526017908201527f4578636565646564206d6178207065722077616c6c6574000000000000000000604082015260600190565b808202811582820484141761141d5761141d61179e565b60006020828403121561188b57600080fd5b815161146f816115ef565b6000602082840312156118a857600080fd5b815161146f8161172a565b634e487b7160e01b600052603260045260246000fd5b60005b838110156118e45781810151838201526020016118cc565b50506000910152565b600082516118ff8184602087016118c9565b9190910192915050565b60208152600082518060208401526119288160408501602087016118c9565b601f01601f1916919091016040019291505056feef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68abef3ade2c07aeb418fe70a697d77effdb47b5c3ae13994cfb24323e3d2e6a68a58463ba7c736160ca369a87f3f11bd6c808ec9f1e2f50ab84a0ca42b381569078a26469706673582212204ecf113b072f424189c1f34398dfb9b7c697c88536ce7d43c2576b950ae8141f64736f6c63430008130033";t.ERC20AppFacet__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},742:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERC20AppFacet__factory=void 0;var n=r(501);Object.defineProperty(t,"ERC20AppFacet__factory",{enumerable:!0,get:function(){return n.ERC20AppFacet__factory}})},744:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BaseFacet__factory=void 0;var o=r(391),a=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ApprovalCallerNotOwnerNorApproved",type:"error"},{inputs:[],name:"ApprovalQueryForNonexistentToken",type:"error"},{inputs:[],name:"BalanceQueryForZeroAddress",type:"error"},{inputs:[{internalType:"address",name:"_initializationContractAddress",type:"address"},{internalType:"bytes",name:"_calldata",type:"bytes"}],name:"InitializationFunctionReverted",type:"error"},{inputs:[],name:"MintERC2309QuantityExceedsLimit",type:"error"},{inputs:[],name:"MintToZeroAddress",type:"error"},{inputs:[],name:"MintZeroQuantity",type:"error"},{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"OwnerQueryForNonexistentToken",type:"error"},{inputs:[],name:"OwnershipNotInitializedForExtraData",type:"error"},{inputs:[],name:"TransferCallerNotOwnerNorApproved",type:"error"},{inputs:[],name:"TransferFromIncorrectOwner",type:"error"},{inputs:[],name:"TransferToNonERC721ReceiverImplementer",type:"error"},{inputs:[],name:"TransferToZeroAddress",type:"error"},{inputs:[],name:"URIQueryForNonexistentToken",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{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:"uint256",name:"fromTokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"toTokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"ConsecutiveTransfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!0,internalType:"uint256",name:"roles",type:"uint256"}],name:"RolesUpdated",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:"owner_",type:"address"},{internalType:"address",name:"admin_",type:"address"},{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"address",name:"royalty_",type:"address"},{internalType:"uint16",name:"royaltyBps_",type:"uint16"}],name:"_initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"_functionSelector",type:"bytes4"}],name:"facetAddress",outputs:[{internalType:"address",name:"facetAddress_",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"facetAddresses",outputs:[{internalType:"address[]",name:"facetAddresses_",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_facet",type:"address"}],name:"facetFunctionSelectors",outputs:[{internalType:"bytes4[]",name:"_facetFunctionSelectors",type:"bytes4[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"facets",outputs:[{components:[{internalType:"address",name:"facetAddress",type:"address"},{internalType:"bytes4[]",name:"functionSelectors",type:"bytes4[]"}],internalType:"struct IDiamondLoupe.Facet[]",name:"facets_",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"name",type:"bytes32"}],name:"getApp",outputs:[{components:[{internalType:"address",name:"implementation",type:"address"},{internalType:"bytes4",name:"interfaceId",type:"bytes4"},{internalType:"bytes4[]",name:"selectors",type:"bytes4[]"},{internalType:"uint8",name:"version",type:"uint8"}],internalType:"struct INiftyKitAppRegistry.App",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getMintSigner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"roles",type:"uint256"}],name:"grantRoles",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"bytes",name:"data",type:"bytes"}],name:"installApp",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"name",type:"bytes32"}],name:"installApp",outputs:[],stateMutability:"nonpayable",type:"function"},{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:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"result",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"name",type:"bytes32"}],name:"removeApp",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"bytes",name:"data",type:"bytes"}],name:"removeApp",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"roles",type:"uint256"}],name:"renounceRoles",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"roles",type:"uint256"}],name:"revokeRoles",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"rolesOf",outputs:[{internalType:"uint256",name:"roles",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"salePrice",type:"uint256"}],name:"royaltyInfo",outputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",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:"payable",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:"payable",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:"newBaseURI",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"signer_",type:"address"}],name:"setMintSigner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newTreasury",type:"address"}],name:"setTreasury",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"trustedForwarder",type:"address"}],name:"setTrustedForwarder",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:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",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:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"treasury",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}],s="0x60806040523480156200001157600080fd5b506000805160206200474183398151915254610100900460ff166200004b57600080516020620047418339815191525460ff16156200004f565b303b155b620000c65760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a6564000000000000000000606482015260840160405180910390fd5b6000805160206200474183398151915254610100900460ff16158015620001055760008051602062004741833981519152805461ffff19166101011790555b8015620001265760008051602062004741833981519152805461ff00191690555b5061460a80620001376000396000f3fe6080604052600436106102305760003560e01c806361d027b31161012e578063adfca15e116100ab578063da7422281161006f578063da742228146106b3578063e84a9728146106d3578063e985e9c5146106f3578063f0f4426014610713578063f2fde38b1461073357600080fd5b8063adfca15e146105ec578063b88d4fde14610619578063c00cf3ab1461062c578063c87b56dd1461064c578063cdffacc61461066c57600080fd5b80637a0ed627116100f25780637a0ed6271461055c5780638aebc3531461057e5780638da5cb5b1461059e57806395d89b41146105b7578063a22cb465146105cc57600080fd5b806361d027b3146104ea5780636352211e146104ff57806370a082311461051f578063715018a61461053f57806373e996531461054757600080fd5b806323b872dd116101bc57806342842e0e1161018057806342842e0e1461045557806342c71f1d146104685780634a4ee7b11461049557806352ef6b2c146104a857806355f804b3146104ca57600080fd5b806323b872dd1461039b5780632a55205a146103ae5780632de94807146103ed5780632fa8374b146104205780633ccfd60b1461044057600080fd5b806318160ddd1161020357806318160ddd14610312578063183a4f6e146103355780631c10893f146103485780631f1bf78b1461035b5780632099ba841461037b57600080fd5b806301ffc9a71461023557806306fdde03146102a3578063081812fc146102c5578063095ea7b3146102fd575b600080fd5b34801561024157600080fd5b5061028e610250366004613967565b6001600160e01b03191660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f602052604090205460ff1690565b60405190151581526020015b60405180910390f35b3480156102af57600080fd5b506102b8610746565b60405161029a91906139db565b3480156102d157600080fd5b506102e56102e03660046139ee565b6107e1565b6040516001600160a01b03909116815260200161029a565b61031061030b366004613a1c565b61082e565b005b34801561031e57600080fd5b5061032761093e565b60405190815260200161029a565b6103106103433660046139ee565b61095e565b610310610356366004613a1c565b61096b565b34801561036757600080fd5b506103106103763660046139ee565b610981565b34801561038757600080fd5b50610310610396366004613b2d565b6109a7565b6103106103a9366004613b73565b6109c2565b3480156103ba57600080fd5b506103ce6103c9366004613bb4565b610adb565b604080516001600160a01b03909316835260208301919091520161029a565b3480156103f957600080fd5b50610327610408366004613bd6565b638b78c6d8600c908152600091909152602090205490565b34801561042c57600080fd5b5061031061043b3660046139ee565b610af4565b34801561044c57600080fd5b50610310610b1a565b610310610463366004613b73565b610b83565b34801561047457600080fd5b506104886104833660046139ee565b610c92565b60405161029a9190613c38565b6103106104a3366004613a1c565b610d92565b3480156104b457600080fd5b506104bd610da4565b60405161029a9190613c95565b3480156104d657600080fd5b506103106104e5366004613ce2565b610f55565b3480156104f657600080fd5b506102e5610f77565b34801561050b57600080fd5b506102e561051a3660046139ee565b610f93565b34801561052b57600080fd5b5061032761053a366004613bd6565b610fa4565b61031061100c565b34801561055357600080fd5b506102e5611020565b34801561056857600080fd5b5061057161103c565b60405161029a9190613d2a565b34801561058a57600080fd5b50610310610599366004613b2d565b611475565b3480156105aa57600080fd5b50638b78c6d819546102e5565b3480156105c357600080fd5b506102b861148b565b3480156105d857600080fd5b506103106105e7366004613da7565b6114a3565b3480156105f857600080fd5b5061060c610607366004613bd6565b6115a1565b60405161029a9190613de5565b610310610627366004613df8565b611700565b34801561063857600080fd5b50610310610647366004613ea4565b61181b565b34801561065857600080fd5b506102b86106673660046139ee565b611a97565b34801561067857600080fd5b506102e5610687366004613967565b6001600160e01b0319166000908152600080516020614501833981519152602052604090205460601c90565b3480156106bf57600080fd5b506103106106ce366004613bd6565b611bf9565b3480156106df57600080fd5b506103106106ee366004613bd6565b611c32565b3480156106ff57600080fd5b5061028e61070e366004613f65565b611c6b565b34801561071f57600080fd5b5061031061072e366004613bd6565b611ccd565b610310610741366004613bd6565b611d06565b6060610750611d2d565b600201805461075e90613f93565b80601f016020809104026020016040519081016040528092919081815260200182805461078a90613f93565b80156107d75780601f106107ac576101008083540402835291602001916107d7565b820191906000526020600020905b8154815290600101906020018083116107ba57829003601f168201915b5050505050905090565b60006107ec82611d51565b610809576040516333d1c03960e21b815260040160405180910390fd5b610811611d2d565b60009283526006016020525060409020546001600160a01b031690565b8181600061083a611d9a565b6004810154909150610100900460ff16600281600281111561085e5761085e613fc7565b14806108c65750600181600281111561087957610879613fc7565b1480156108a157506001600160a01b038416600090815260018301602052604090205460ff16155b80156108c657506108b0611dbe565b6001600160a01b0316846001600160a01b031614155b806108e15750600083815260028301602052604090205460ff165b156109075760405162461bcd60e51b81526004016108fe90613fdd565b60405180910390fd5b8561091181611de0565b61092b5761091d611e0f565b1561092b5761092b81611e25565b6109358787611e69565b50505050505050565b6000600161094a611d2d565b60010154610956611d2d565b540303919050565b6109683382611e75565b50565b610973611ec4565b61097d8282611edf565b5050565b600161098c81611f2a565b61097d82600060405180602001604052806000815250611f5d565b60016109b281611f2a565b6109bd8330846121ac565b505050565b828160006109ce611d9a565b6004810154909150610100900460ff1660028160028111156109f2576109f2613fc7565b1480610a5a57506001816002811115610a0d57610a0d613fc7565b148015610a3557506001600160a01b038416600090815260018301602052604090205460ff16155b8015610a5a5750610a44611dbe565b6001600160a01b0316846001600160a01b031614155b80610a755750600083815260028301602052604090205460ff165b15610a925760405162461bcd60e51b81526004016108fe90613fdd565b866001600160a01b0381163314610ac657610aac33611de0565b610ac657610ab8611e0f565b15610ac657610ac633611e25565b610ad1888888612454565b5050505050505050565b600080610ae8848461264e565b915091505b9250929050565b6001610aff81611f2a565b61097d826000604051806020016040528060008152506121ac565b6001610b2581611f2a565b6000610b2f611d9a565b90504780610b6b5760405162461bcd60e51b8152602060048201526009602482015268302062616c616e636560b81b60448201526064016108fe565b60058201546109bd906001600160a01b03168261268e565b82816000610b8f611d9a565b6004810154909150610100900460ff166002816002811115610bb357610bb3613fc7565b1480610c1b57506001816002811115610bce57610bce613fc7565b148015610bf657506001600160a01b038416600090815260018301602052604090205460ff16155b8015610c1b5750610c05611dbe565b6001600160a01b0316846001600160a01b031614155b80610c365750600083815260028301602052604090205460ff165b15610c535760405162461bcd60e51b81526004016108fe90613fdd565b866001600160a01b0381163314610c8757610c6d33611de0565b610c8757610c79611e0f565b15610c8757610c8733611e25565b610ad18888886127a7565b60408051608081018252600080825260208201819052606092820183905291810191909152610cbf611d9a565b60008381526020918252604090819020815160808101835281546001600160a01b0381168252600160a01b900460e01b6001600160e01b03191681850152600182018054845181870281018701865281815292959394860193830182828015610d7457602002820191906000526020600020906000905b82829054906101000a900460e01b6001600160e01b03191681526020019060040190602082600301049283019260010382029150808411610d365790505b50505091835250506002919091015460ff1660209091015292915050565b610d9a611ec4565b61097d8282611e75565b60008051602061456d833981519152546060906000805160206145018339815191529061ffff166001600160401b03811115610de257610de2613a48565b604051908082528060200260200182016040528015610e0b578160200160208202803683370190505b50915060008060005b600284015461ffff16821015610f4d576000818152600185016020526040812054905b6008811015610f385783610e4a81614022565b600288015490955061ffff1685119050610f3857600581901b82901b6001600160e01b0319811660009081526020889052604081205460601c90805b88811015610edb578a8181518110610ea057610ea061403b565b60200260200101516001600160a01b0316836001600160a01b031603610ec95760019150610edb565b80610ed381614022565b915050610e86565b508015610eea57505050610f26565b818a8981518110610efd57610efd61403b565b6001600160a01b039092166020928302919091019091015287610f1f81614022565b9850505050505b80610f3081614022565b915050610e37565b50508080610f4590614022565b915050610e14565b505082525090565b6002610f6081611f2a565b81610f69611d9a565b600601906109bd9082614097565b6000610f81611d9a565b600501546001600160a01b0316919050565b6000610f9e826127c2565b92915050565b60006001600160a01b038216610fcd576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b03610fdd611d2d565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b611014611ec4565b61101e600061286f565b565b600061102a611d9a565b600701546001600160a01b0316919050565b60008051602061456d833981519152546060906000805160206145018339815191529061ffff166001600160401b0381111561107a5761107a613a48565b6040519080825280602002602001820160405280156110c057816020015b6040805180820190915260008152606060208201528152602001906001900390816110985790505b50600282015490925060009061ffff166001600160401b038111156110e7576110e7613a48565b604051908082528060200260200182016040528015611110578160200160208202803683370190505b50905060008060005b600285015461ffff16821015611402576000818152600186016020526040812054905b60088110156113ed578361114f81614022565b600289015490955061ffff16851190506113ed57600581901b82901b6001600160e01b0319811660009081526020899052604081205460601c90805b888110156112ab57826001600160a01b03168c82815181106111af576111af61403b565b6020026020010151600001516001600160a01b03160361129957838c82815181106111dc576111dc61403b565b6020026020010151602001518b83815181106111fa576111fa61403b565b602002602001015161ffff16815181106112165761121661403b565b60200260200101906001600160e01b03191690816001600160e01b0319168152505060ff8a828151811061124c5761124c61403b565b602002602001015161ffff161061126257600080fd5b8981815181106112745761127461403b565b60200260200101805180919061128990614156565b61ffff16905250600191506112ab565b806112a381614022565b91505061118b565b5080156112ba575050506113db565b818b89815181106112cd576112cd61403b565b60209081029190910101516001600160a01b03909116905260028a015461ffff166001600160401b0381111561130557611305613a48565b60405190808252806020026020018201604052801561132e578160200160208202803683370190505b508b89815181106113415761134161403b565b602002602001015160200181905250828b89815181106113635761136361403b565b6020026020010151602001516000815181106113815761138161403b565b60200260200101906001600160e01b03191690816001600160e01b0319168152505060018989815181106113b7576113b761403b565b61ffff90921660209283029190910190910152876113d481614022565b9850505050505b806113e581614022565b91505061113c565b505080806113fa90614022565b915050611119565b5060005b8281101561146a5760008482815181106114225761142261403b565b602002602001015161ffff16905060008783815181106114445761144461403b565b60200260200101516020015190508181525050808061146290614022565b915050611406565b508185525050505090565b600161148081611f2a565b6109bd833084611f5d565b6060611495611d2d565b600301805461075e90613f93565b816000806114af611d9a565b6004810154909150610100900460ff1660028160028111156114d3576114d3613fc7565b148061153b575060018160028111156114ee576114ee613fc7565b14801561151657506001600160a01b038416600090815260018301602052604090205460ff16155b801561153b5750611525611dbe565b6001600160a01b0316846001600160a01b031614155b806115565750600083815260028301602052604090205460ff165b156115735760405162461bcd60e51b81526004016108fe90613fdd565b8561157d81611de0565b61159757611589611e0f565b156115975761159781611e25565b61093587876128ad565b60008051602061456d833981519152546060906000805160206145018339815191529060009061ffff166001600160401b038111156115e2576115e2613a48565b60405190808252806020026020018201604052801561160b578160200160208202803683370190505b5092506000805b600284015461ffff168210156116f6576000818152600185016020526040812054905b60088110156116e1578361164881614022565b600288015490955061ffff16851190506116e157600581901b82901b6001600160e01b0319811660009081526020889052604090205460601c6001600160a01b038a168190036116cc57818988815181106116a5576116a561403b565b6001600160e01b031990921660209283029190910190910152866116c881614022565b9750505b505080806116d990614022565b915050611635565b505080806116ee90614022565b915050611612565b5050825250919050565b8382600061170c611d9a565b6004810154909150610100900460ff16600281600281111561173057611730613fc7565b14806117985750600181600281111561174b5761174b613fc7565b14801561177357506001600160a01b038416600090815260018301602052604090205460ff16155b80156117985750611782611dbe565b6001600160a01b0316846001600160a01b031614155b806117b35750600083815260028301602052604090205460ff165b156117d05760405162461bcd60e51b81526004016108fe90613fdd565b876001600160a01b0381163314611804576117ea33611de0565b611804576117f6611e0f565b156118045761180433611e25565b6118108989898961294f565b505050505050505050565b6000805160206145b583398151915254610100900460ff16611850576000805160206145b58339815191525460ff1615611854565b303b155b6118c65760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a656400000000000000000060648201526084016108fe565b6000805160206145b583398151915254610100900460ff16158015611902576000805160206145b5833981519152805461ffff19166101011790555b61197587878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b01819004810282018101909252898152925089915088908190840183828082843760009201919091525061299992505050565b61197e896129d7565b611986612a13565b6000611990611d9a565b7ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b2820805461ffff191661ffff86161790557ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b282280546001600160a01b0319166001600160a01b038781169190911790915560048201805460ff191660011790559091507ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b281f908a1615611a6c576007820180546001600160a01b0319166001600160a01b038c16179055611a6c8a611a6760026001614177565b611edf565b505080156118105750506000805160206145b5833981519152805461ff001916905550505050505050565b6060611aa282611d51565b611abf57604051630a14c4b560e41b815260040160405180910390fd5b6000611ac9611d9a565b600084815260039190910160209081526040918290208251808401909352805460ff16151583526001810180549192840191611b0490613f93565b80601f0160208091040260200160405190810160405280929190818152602001828054611b3090613f93565b8015611b7d5780601f10611b5257610100808354040283529160200191611b7d565b820191906000526020600020905b815481529060010190602001808311611b6057829003601f168201915b5050505050815250509050806000015115611b9c576020015192915050565b6000611ba6612a32565b90508051600003611bc65760405180602001604052806000815250611bf1565b80611bd085612a4a565b604051602001611be192919061418a565b6040516020818303038152906040525b949350505050565b6001611c0481611f2a565b81611c0d611d9a565b60080180546001600160a01b0319166001600160a01b03929092169190911790555050565b6001611c3d81611f2a565b81611c46611d9a565b60070180546001600160a01b0319166001600160a01b03929092169190911790555050565b600080611c76611d9a565b905060016004820154610100900460ff166002811115611c9857611c98613fc7565b03611cc3576001600160a01b03831660009081526001909101602052604090205460ff169050610f9e565b611bf18484612a8e565b6001611cd881611f2a565b81611ce1611d9a565b60050180546001600160a01b0319166001600160a01b03929092169190911790555050565b611d0e611ec4565b8060601b611d2457637448fbae6000526004601cfd5b6109688161286f565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b600081600111158015611d6b5750611d67611d2d565b5482105b8015610f9e5750600160e01b611d7f611d2d565b60008481526004919091016020526040902054161592915050565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5690565b6000611dc933612acb565b15611ddb575060131936013560601c90565b503390565b6000611dea611d9a565b6001600160a01b03909216600090815260019290920160205250604090205460ff1690565b6000611e19611d9a565b6004015460ff16919050565b69c617113400112233445560005230601a5280603a52600080604460166daaeb6d7670e522a718067333cd4e5afa611e61573d6000803e3d6000fd5b6000603a5250565b61097d82826001612af3565b638b78c6d8600c52816000526020600c20805482811681189250508181555080600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a35050565b638b78c6d81954331461101e576382b429006000526004601cfd5b638b78c6d8600c52816000526020600c208181541791508181555080600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a35050565b638b78c6d8600c5233600052806020600c20541661096857638b78c6d819543314610968576382b429006000526004601cfd5b6000611f67611d9a565b600085815260208281526040808320815160808101835281546001600160a01b0381168252600160a01b900460e01b6001600160e01b031916818501526001820180548451818702810187018652818152979850600080516020614501833981519152979295939486019383018282801561202e57602002820191906000526020600020906000905b82829054906101000a900460e01b6001600160e01b03191681526020019060040190602082600301049283019260010382029150808411611ff05790505b50505091835250506002919091015460ff9081166020909201919091526060820151919250166120955760405162461bcd60e51b8152602060048201526012602482015271105c1c08191bd95cc81b9bdd08195e1a5cdd60721b60448201526064016108fe565b604080516001808252818301909252600091816020015b604080516060808201835260008083526020830152918101919091528152602001906001900390816120ac5790505060408051606081019091526000815290915060208101600281526020018360400151815250816000815181106121135761211361403b565b602090810291909101810191909152828101516001600160e01b03191660009081526003850190915260409020805460ff191690556121528686612bba565b61216d81600060405180602001604052806000815250612c80565b600087815260208590526040812080546001600160c01b031916815590612197600183018261386b565b50600201805460ff1916905550505050505050565b60006121b6611d9a565b90506000600080516020614501833981519152905060008260040160029054906101000a90046001600160a01b03166001600160a01b031663bb4fceb96040518163ffffffff1660e01b81526004016020604051808303816000875af1158015612224573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061224891906141b9565b6040516342c71f1d60e01b8152600481018890529091506000906001600160a01b038316906342c71f1d90602401600060405180830381865afa158015612293573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122bb91908101906141e7565b90506000816060015160ff16116123095760405162461bcd60e51b8152602060048201526012602482015271105c1c08191bd95cc81b9bdd08195e1a5cdd60721b60448201526064016108fe565b604080516001808252818301909252600091816020015b6040805160608082018352600080835260208301529181019190915281526020019060019003908161232057905050604080516060810190915283516001600160a01b0316815290915060208101600081526020018360400151815250816000815181106123905761239061403b565b602090810291909101810191909152828101516001600160e01b03191660009081526003860190915260409020805460ff191660011790556123d3818888612c80565b60008881526020868152604091829020845181548387015160e01c600160a01b026001600160c01b03199091166001600160a01b039092169190911717815591840151805185939261242c926001850192910190613890565b50606091909101516002909101805460ff191660ff9092169190911790555050505050505050565b600061245f826127c2565b9050836001600160a01b0316816001600160a01b0316146124925760405162a1148160e81b815260040160405180910390fd5b60008061249e84612dcb565b915091506124c481876124af611dbe565b6001600160a01b039081169116811491141790565b6124f1576124d48661070e611dbe565b6124f157604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661251857604051633a954ecd60e21b815260040160405180910390fd5b801561252357600082555b61252b611d2d565b6001600160a01b0387166000908152600591909101602052604090208054600019019055612557611d2d565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b1761258e611d2d565b60008681526004919091016020526040812091909155600160e11b8416900361260457600184016125bd611d2d565b600082815260049190910160205260408120549003612602576125de611d2d565b54811461260257836125ee611d2d565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b600080600061265c85612df3565b61ffff16905061266b85612e41565b61271061267886846142f9565b6126829190614310565b92509250509250929050565b804710156126de5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016108fe565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461272b576040519150601f19603f3d011682016040523d82523d6000602084013e612730565b606091505b50509050806109bd5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016108fe565b6109bd83838360405180602001604052806000815250611700565b600081600111612856576127d4611d2d565b600083815260049190910160205260408120549150600160e01b82169003612856578060000361285157612806611d2d565b54821061282657604051636f96cda160e11b815260040160405180910390fd5b61282e611d2d565b600019909201600081815260049390930160205260409092205490508015612826575b919050565b604051636f96cda160e11b815260040160405180910390fd5b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a355565b806128b6611d2d565b60070160006128c3611dbe565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155612907611dbe565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051612943911515815260200190565b60405180910390a35050565b61295a8484846109c2565b6001600160a01b0383163b156129935761297684848484612eb1565b612993576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6000805160206145b583398151915254610100900460ff166129cd5760405162461bcd60e51b81526004016108fe90614332565b61097d8282612fa2565b6001600160a01b0316638b78c6d8198190558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b61101e733cc6cdda760b79bafa08df41ecfa224f810dceb66001613015565b6060612a3c611d9a565b600601805461075e90613f93565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480612a645750819003601f19909101908152919050565b6000612a98611d2d565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b6000816001600160a01b0316612adf611d9a565b600801546001600160a01b03161492915050565b6000612afe83610f93565b90508115612b4f57806001600160a01b0316612b18611dbe565b6001600160a01b031614612b4f57612b328161070e611dbe565b612b4f576040516367d9dca160e11b815260040160405180910390fd5b83612b58611d2d565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b6001600160a01b038216612bcc575050565b612bee826040518060600160405280602881526020016145456028913961308a565b600080836001600160a01b031683604051612c099190614386565b600060405180830381855af49150503d8060008114612c44576040519150601f19603f3d011682016040523d82523d6000602084013e612c49565b606091505b50915091508161299357805115612c635780518082602001fd5b838360405163192105d760e01b81526004016108fe9291906143a2565b60008051602061456d833981519152546000805160206145018339815191529061ffff811690819060009060071615612ccb5750600381901c60009081526001840160205260409020545b60005b8751811015612d4857612d3b83838a8481518110612cee57612cee61403b565b6020026020010151600001518b8581518110612d0c57612d0c61403b565b6020026020010151602001518c8681518110612d2a57612d2a61403b565b6020026020010151604001516130ab565b9093509150600101612cce565b50828214612d645760028401805461ffff191661ffff84161790555b6007821615612d8657600382901c600090815260018501602052604090208190555b7f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673878787604051612db9939291906143c6565b60405180910390a16109358686612bba565b6000806000612dd8611d2d565b60009485526006016020525050604090912080549092909150565b60008181527ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b281f6020819052604082205461ffff1691829003612e3b57600181015461ffff1691505b50919050565b60008181527ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b282160205260409020546001600160a01b03167ff298352fd56f58214bf2245c2b202523f72fca3199077ce992640958228b281f81612e3b57600301546001600160a01b031692915050565b6000836001600160a01b031663150b7a02612eca611dbe565b8786866040518563ffffffff1660e01b8152600401612eec949392919061448f565b6020604051808303816000875af1925050508015612f27575060408051601f3d908101601f19168201909252612f24918101906144cc565b60015b612f85573d808015612f55576040519150601f19603f3d011682016040523d82523d6000602084013e612f5a565b606091505b508051600003612f7d576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6000805160206145b583398151915254610100900460ff16612fd65760405162461bcd60e51b81526004016108fe90614332565b81612fdf611d2d565b60020190612fed9082614097565b5080612ff7611d2d565b600301906130059082614097565b506001613010611d2d565b555050565b6001600160a01b0390911690637d3e3dbe81613042578261303b5750634420e486613042565b5063a0af29035b8060e01b60005230600452826024526004600060446000806daaeb6d7670e522a718067333cd4e5af1613080578060005160e01c0361308057600080fd5b5060006024525050565b813b81816129935760405162461bcd60e51b81526004016108fe91906139db565b60008080600080516020614501833981519152905060008451116131255760405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201526a1858d95d081d1bc818dd5d60aa1b60648201526084016108fe565b600085600281111561313957613139613fc7565b0361329f57613160866040518060600160405280602481526020016145216024913961308a565b60005b84518110156132995760008582815181106131805761318061403b565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c156132195760405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f6044820152746e207468617420616c72656164792065786973747360581b60648201526084016108fe565b6001600160e01b031980831660008181526020879052604090206001600160601b031960608d901b168e17905560e060058e901b811692831c199c909c1690821c179a81900361327d5760038c901c600090815260018601602052604081209b909b555b8b61328781614022565b9c505060019093019250613163915050565b5061385f565b60018560028111156132b3576132b3613fc7565b036134d8576132da8660405180606001604052806028815260200161458d6028913961308a565b60005b84518110156132995760008582815181106132fa576132fa61403b565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c30810361338f5760405162461bcd60e51b815260206004820152602f60248201527f4c69624469616d6f6e644375743a2043616e2774207265706c61636520696d6d60448201526e3aba30b1363290333ab731ba34b7b760891b60648201526084016108fe565b896001600160a01b0316816001600160a01b0316036134165760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e20776974682073616d652066756e6374696f6e000000000000000060648201526084016108fe565b6001600160a01b0381166134925760405162461bcd60e51b815260206004820152603860248201527f4c69624469616d6f6e644375743a2043616e2774207265706c6163652066756e60448201527f6374696f6e207468617420646f65736e2774206578697374000000000000000060648201526084016108fe565b506001600160e01b031990911660009081526020849052604090206bffffffffffffffffffffffff919091166001600160601b031960608a901b161790556001016132dd565b60028560028111156134ec576134ec613fc7565b03613807576001600160a01b038616156135675760405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f76652066616365742061646472604482015275657373206d757374206265206164647265737328302960501b60648201526084016108fe565b600388901c6007891660005b86518110156137e75760008a90036135af578261358f816144e9565b60008181526001870160205260409020549b509350600792506135bd9050565b816135b9816144e9565b9250505b6000806000808a85815181106135d5576135d561403b565b6020908102919091018101516001600160e01b031981166000908152918a9052604090912054909150606081901c6136755760405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e277420657869737400000000000000000060648201526084016108fe565b30606082901c036136df5760405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201526d3a30b1363290333ab731ba34b7b760911b60648201526084016108fe565b600587901b8f901b94506001600160e01b031980861690831614613735576001600160e01b03198516600090815260208a90526040902080546001600160601b0319166bffffffffffffffffffffffff83161790555b6001600160e01b031991909116600090815260208990526040812055600381901c611fff16925060051b60e016905085821461379a576000828152600188016020526040902080546001600160e01b031980841c19909116908516831c1790556137be565b80836001600160e01b031916901c816001600160e01b031960001b901c198e16179c505b846000036137dc57600086815260018801602052604081208190559c505b505050600101613573565b50806137f48360086142f9565b6137fe9190614177565b9950505061385f565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f727265637420466163657443756044820152663a20b1ba34b7b760c91b60648201526084016108fe565b50959694955050505050565b508054600082556007016008900490600052602060002090810190610968919061393c565b8280548282559060005260206000209060070160089004810192821561392c5791602002820160005b838211156138fa57835183826101000a81548163ffffffff021916908360e01c021790555092602001926004016020816003010492830192600103026138b9565b801561392a5782816101000a81549063ffffffff02191690556004016020816003010492830192600103026138fa565b505b5061393892915061393c565b5090565b5b80821115613938576000815560010161393d565b6001600160e01b03198116811461096857600080fd5b60006020828403121561397957600080fd5b813561398481613951565b9392505050565b60005b838110156139a657818101518382015260200161398e565b50506000910152565b600081518084526139c781602086016020860161398b565b601f01601f19169290920160200192915050565b60208152600061398460208301846139af565b600060208284031215613a0057600080fd5b5035919050565b6001600160a01b038116811461096857600080fd5b60008060408385031215613a2f57600080fd5b8235613a3a81613a07565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715613a8057613a80613a48565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613aae57613aae613a48565b604052919050565b60006001600160401b03831115613acf57613acf613a48565b613ae2601f8401601f1916602001613a86565b9050828152838383011115613af657600080fd5b828260208301376000602084830101529392505050565b600082601f830112613b1e57600080fd5b61398483833560208501613ab6565b60008060408385031215613b4057600080fd5b8235915060208301356001600160401b03811115613b5d57600080fd5b613b6985828601613b0d565b9150509250929050565b600080600060608486031215613b8857600080fd5b8335613b9381613a07565b92506020840135613ba381613a07565b929592945050506040919091013590565b60008060408385031215613bc757600080fd5b50508035926020909101359150565b600060208284031215613be857600080fd5b813561398481613a07565b600081518084526020808501945080840160005b83811015613c2d5781516001600160e01b03191687529582019590820190600101613c07565b509495945050505050565b602080825282516001600160a01b0316828201528201516001600160e01b03191660408083019190915282015160806060830152600090613c7c60a0840182613bf3565b905060ff60608501511660808401528091505092915050565b6020808252825182820181905260009190848201906040850190845b81811015613cd65783516001600160a01b031683529284019291840191600101613cb1565b50909695505050505050565b600060208284031215613cf457600080fd5b81356001600160401b03811115613d0a57600080fd5b8201601f81018413613d1b57600080fd5b611bf184823560208401613ab6565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015613d9957888303603f19018552815180516001600160a01b03168452870151878401879052613d8687850182613bf3565b9588019593505090860190600101613d51565b509098975050505050505050565b60008060408385031215613dba57600080fd5b8235613dc581613a07565b915060208301358015158114613dda57600080fd5b809150509250929050565b6020815260006139846020830184613bf3565b60008060008060808587031215613e0e57600080fd5b8435613e1981613a07565b93506020850135613e2981613a07565b92506040850135915060608501356001600160401b03811115613e4b57600080fd5b613e5787828801613b0d565b91505092959194509250565b60008083601f840112613e7557600080fd5b5081356001600160401b03811115613e8c57600080fd5b602083019150836020828501011115610aed57600080fd5b60008060008060008060008060c0898b031215613ec057600080fd5b8835613ecb81613a07565b97506020890135613edb81613a07565b965060408901356001600160401b0380821115613ef757600080fd5b613f038c838d01613e63565b909850965060608b0135915080821115613f1c57600080fd5b50613f298b828c01613e63565b9095509350506080890135613f3d81613a07565b915060a089013561ffff81168114613f5457600080fd5b809150509295985092959890939650565b60008060408385031215613f7857600080fd5b8235613f8381613a07565b91506020830135613dda81613a07565b600181811c90821680613fa757607f821691505b602082108103612e3b57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b602080825260159082015274151c985b9cd9995c9cc81b9bdd08185b1b1bddd959605a1b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000600182016140345761403461400c565b5060010190565b634e487b7160e01b600052603260045260246000fd5b601f8211156109bd57600081815260208120601f850160051c810160208610156140785750805b601f850160051c820191505b8181101561264657828155600101614084565b81516001600160401b038111156140b0576140b0613a48565b6140c4816140be8454613f93565b84614051565b602080601f8311600181146140f957600084156140e15750858301515b600019600386901b1c1916600185901b178555612646565b600085815260208120601f198616915b8281101561412857888601518255948401946001909101908401614109565b50858210156141465787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600061ffff80831681810361416d5761416d61400c565b6001019392505050565b80820180821115610f9e57610f9e61400c565b6000835161419c81846020880161398b565b8351908301906141b081836020880161398b565b01949350505050565b6000602082840312156141cb57600080fd5b815161398481613a07565b805160ff8116811461285157600080fd5b600060208083850312156141fa57600080fd5b82516001600160401b038082111561421157600080fd5b908401906080828703121561422557600080fd5b61422d613a5e565b825161423881613a07565b81528284015161424781613951565b8185015260408301518281111561425d57600080fd5b8301601f8101881361426e57600080fd5b80518381111561428057614280613a48565b8060051b9350614291868501613a86565b818152938201860193868101908a8611156142ab57600080fd5b928701925b858410156142d557835192506142c583613951565b82825292870192908701906142b0565b6040850152506142ea915050606084016141d6565b60608201529695505050505050565b8082028115828204841417610f9e57610f9e61400c565b60008261432d57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6000825161439881846020870161398b565b9190910192915050565b6001600160a01b0383168152604060208201819052600090611bf1908301846139af565b6000606080830181845280875180835260808601915060808160051b87010192506020808a016000805b8481101561445f57898703607f19018652825180516001600160a01b03168852848101516003811061443057634e487b7160e01b84526021600452602484fd5b8886015260409081015190880189905261444c89890182613bf3565b97505094830194918301916001016143f0565b5050506001600160a01b038916908701525050838103604085015261448481866139af565b979650505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906144c2908301846139af565b9695505050505050565b6000602082840312156144de57600080fd5b815161398481613951565b6000816144f8576144f861400c565b50600019019056fec8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c4c69624469616d6f6e644375743a2041646420666163657420686173206e6f20636f64654c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f6465c8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e4c69624469616d6f6e644375743a205265706c61636520666163657420686173206e6f20636f6465ee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa2646970667358221220ad794a6fa7c6eab9bf4e825fb8d4739bdf27139916010b993bd91f6e79f2592b64736f6c63430008130033ee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f";t.BaseFacet__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},652:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStorage__factory=void 0;var o=r(391),a=[{inputs:[],name:"ADMIN_ROLE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"API_ROLE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MANAGER_ROLE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}],s="0x60a9610039600b82828239805160001a60731461002c57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361060475760003560e01c806311fc806514604c57806375b238fc146065578063ec87621c14606c575b600080fd5b6053600481565b60405190815260200160405180910390f35b6053600181565b605360028156fea2646970667358221220a3e79d6cb793be0c59eddff0225722fd63aca37acb75c5f5c4704af30daef9e264736f6c63430008130033";t.BaseStorage__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},194:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.DiamondCollection__factory=void 0;var o=r(391),a=[{inputs:[{components:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"admin",type:"address"},{internalType:"address",name:"treasury",type:"address"},{internalType:"address",name:"royalty",type:"address"},{internalType:"address",name:"trustedForwarder",type:"address"},{internalType:"uint16",name:"royaltyBps",type:"uint16"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"baseURI",type:"string"},{internalType:"bytes32[]",name:"apps",type:"bytes32[]"}],internalType:"struct INiftyKitV3.DiamondArgs",name:"args",type:"tuple"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"_initializationContractAddress",type:"address"},{internalType:"bytes",name:"_calldata",type:"bytes"}],name:"InitializationFunctionReverted",type:"error"},{stateMutability:"payable",type:"fallback"},{stateMutability:"payable",type:"receive"}],s="0x60806040523480156200001157600080fd5b5060405162001c9438038062001c9483398101604081905262000034916200137b565b7f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db5a805462010000600160b01b031916336201000090810291909117918290556040805163bb4fceb960e01b815290517f45f38af8fd646bf817698fe2be76218d850d401ba88ffd7c9cd1b4f5c9a1db56936000936001600160a01b039104169163bb4fceb9916004828101926020929190829003018187875af1158015620000e0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001069190620014dd565b90506000816001600160a01b031663d104a1366040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000149573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000173919081019062001598565b905060008461012001515160016200018c91906200166f565b6001600160401b03811115620001a657620001a66200117e565b604051908082528060200260200182016040528015620001f557816020015b60408051606080820183526000808352602083015291810191909152815260200190600190039081620001c55790505b5060408601516005860180546001600160a01b0319166001600160a01b03909216919091179055606083015160048601805460ff60b01b1916600160b01b60ff9093169290920291909117905561010086015190915060068501906200025c908262001714565b5060808501516008850180546001600160a01b0319166001600160a01b039092169190911790556101208501516200029a9082908690869062000328565b9050620002a8818362000562565b90506200031d818360000151876000015188602001518960c001518a60e001518b606001518c60a00151604051602401620002e9969594939291906200180e565b60408051601f198184030181529190526020810180516001600160e01b0390811663c00cf3ab60e01b179091526200064e16565b505050505062001add565b805160609060008051602062001c008339815191529060005b8181101562000556576000866001600160a01b03166342c71f1d8784815181106200037057620003706200186e565b60200260200101516040518263ffffffff1660e01b81526004016200039791815260200190565b600060405180830381865afa158015620003b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620003df919081019062001884565b9050806060015160ff16600003620004335760405162461bcd60e51b8152602060048201526012602482015271105c1c08191bd95cc81b9bdd08195e1a5cdd60721b60448201526064015b60405180910390fd5b604080516060810190915281516001600160a01b03168152602081016000815260200182604001518152508983815181106200047357620004736200186e565b602090810291909101810191909152818101516001600160e01b03191660009081526003860190915260408120805460ff19166001179055865182918a91899086908110620004c657620004c66200186e565b6020908102919091018101518252818101929092526040908101600020835181548585015160e01c600160a01b026001600160c01b03199091166001600160a01b039092169190911717815590830151805191926200052e92600185019290910190620010b4565b50606091909101516002909101805460ff191660ff9092169190911790555060010162000341565b50959695505050505050565b604080516060818101835283516001600160a01b03168252600060208301528383015192820192909252835160008051602062001c0083398151915291908590620005b09060019062001917565b81518110620005c357620005c36200186e565b60200260200101819052506000836020015151905060005b8181101562000641576001836003016000876020015184815181106200060557620006056200186e565b6020908102919091018101516001600160e01b0319168252810191909152604001600020805460ff1916911515919091179055600101620005db565b5084925050505b92915050565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e5460008051602062001c008339815191529061ffff811690819060009060071615620006ad5750600381901c60009081526001840160205260409020545b60005b87518110156200073d576200072f83838a8481518110620006d557620006d56200186e565b6020026020010151600001518b8581518110620006f657620006f66200186e565b6020026020010151602001518c86815181106200071757620007176200186e565b602002602001015160400151620007cf60201b60201c565b9093509150600101620006b0565b508282146200075a5760028401805461ffff191661ffff84161790555b60078216156200077d57600382901c600090815260018501602052604090208190555b7f8faa70878671ccd212d20771b795c50af8fd3ff6cf27f4bde57e5d4de0aeb673878787604051620007b2939291906200192d565b60405180910390a1620007c6868662000fb8565b50505050505050565b6000808060008051602062001c00833981519152905060008451116200084c5760405162461bcd60e51b815260206004820152602b60248201527f4c69624469616d6f6e644375743a204e6f2073656c6563746f727320696e206660448201526a1858d95d081d1bc818dd5d60aa1b60648201526084016200042a565b600085600281111562000863576200086362001901565b03620009e0576200088e8660405180606001604052806024815260200162001c206024913962001090565b60005b8451811015620009d9576000858281518110620008b257620008b26200186e565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c15620009555760405162461bcd60e51b815260206004820152603560248201527f4c69624469616d6f6e644375743a2043616e2774206164642066756e6374696f60448201527f6e207468617420616c726561647920657869737473000000000000000000000060648201526084016200042a565b6001600160e01b031980831660008181526020879052604090206001600160601b031960608d901b168e17905560e060058e901b811692831c199c909c1690821c179a819003620009ba5760038c901c600090815260018601602052604081209b909b555b8b620009c68162001a34565b9c50506001909301925062000891915050565b5062000fac565b6001856002811115620009f757620009f762001901565b0362000c045762000a228660405180606001604052806028815260200162001c6c6028913962001090565b60005b8451811015620009d957600085828151811062000a465762000a466200186e565b6020908102919091018101516001600160e01b03198116600090815291859052604090912054909150606081901c30810362000add5760405162461bcd60e51b815260206004820152602f60248201527f4c69624469616d6f6e644375743a2043616e2774207265706c61636520696d6d60448201526e3aba30b1363290333ab731ba34b7b760891b60648201526084016200042a565b896001600160a01b0316816001600160a01b03160362000b555760405162461bcd60e51b8152602060048201526038602482015260008051602062001be083398151915260448201527f6374696f6e20776974682073616d652066756e6374696f6e000000000000000060648201526084016200042a565b6001600160a01b03811662000bc25760405162461bcd60e51b8152602060048201526038602482015260008051602062001be083398151915260448201527f6374696f6e207468617420646f65736e2774206578697374000000000000000060648201526084016200042a565b506001600160e01b031990911660009081526020849052604090206001600160601b03919091166001600160601b031960608a901b1617905560010162000a25565b600285600281111562000c1b5762000c1b62001901565b0362000f53576001600160a01b0386161562000ca05760405162461bcd60e51b815260206004820152603660248201527f4c69624469616d6f6e644375743a2052656d6f7665206661636574206164647260448201527f657373206d75737420626520616464726573732830290000000000000000000060648201526084016200042a565b600388901c6007891660005b865181101562000f2e5760008a900362000ced578262000ccc8162001a50565b60008181526001870160205260409020549b5093506007925062000cfd9050565b8162000cf98162001a50565b9250505b6000806000808a858151811062000d185762000d186200186e565b6020908102919091018101516001600160e01b031981166000908152918a9052604090912054909150606081901c62000dba5760405162461bcd60e51b815260206004820152603760248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f76652066756e6360448201527f74696f6e207468617420646f65736e277420657869737400000000000000000060648201526084016200042a565b30606082901c0362000e265760405162461bcd60e51b815260206004820152602e60248201527f4c69624469616d6f6e644375743a2043616e27742072656d6f766520696d6d7560448201526d3a30b1363290333ab731ba34b7b760911b60648201526084016200042a565b600587901b8f901b94506001600160e01b03198086169083161462000e78576001600160e01b03198516600090815260208a90526040902080546001600160601b0319166001600160601b0383161790555b6001600160e01b031991909116600090815260208990526040812055600381901c611fff16925060051b60e016905085821462000edf576000828152600188016020526040902080546001600160e01b031980841c19909116908516831c17905562000f03565b80836001600160e01b031916901c816001600160e01b031960001b901c198e16179c505b8460000362000f2257600086815260018801602052604081208190559c505b50505060010162000cac565b508062000f3d83600862001a6a565b62000f4991906200166f565b9950505062000fac565b60405162461bcd60e51b815260206004820152602760248201527f4c69624469616d6f6e644375743a20496e636f727265637420466163657443756044820152663a20b1ba34b7b760c91b60648201526084016200042a565b50959694955050505050565b6001600160a01b03821662000fcb575050565b62000ff08260405180606001604052806028815260200162001c446028913962001090565b600080836001600160a01b0316836040516200100d919062001a84565b600060405180830381855af49150503d80600081146200104a576040519150601f19603f3d011682016040523d82523d6000602084013e6200104f565b606091505b5091509150816200108a578051156200106b5780518082602001fd5b838360405163192105d760e01b81526004016200042a92919062001aa2565b50505050565b813b81816200108a5760405162461bcd60e51b81526004016200042a919062001ac8565b82805482825590600052602060002090600701600890048101928215620011555791602002820160005b838211156200112157835183826101000a81548163ffffffff021916908360e01c02179055509260200192600401602081600301049283019260010302620010de565b8015620011535782816101000a81549063ffffffff021916905560040160208160030104928301926001030262001121565b505b506200116392915062001167565b5090565b5b8082111562001163576000815560010162001168565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b0381118282101715620011ba57620011ba6200117e565b60405290565b604051608081016001600160401b0381118282101715620011ba57620011ba6200117e565b604051601f8201601f191681016001600160401b03811182821017156200121057620012106200117e565b604052919050565b80516001600160a01b03811681146200123057600080fd5b919050565b805161ffff811681146200123057600080fd5b60005b83811015620012655781810151838201526020016200124b565b50506000910152565b600082601f8301126200128057600080fd5b81516001600160401b038111156200129c576200129c6200117e565b620012b1601f8201601f1916602001620011e5565b818152846020838601011115620012c757600080fd5b620012da82602083016020870162001248565b949350505050565b60006001600160401b03821115620012fe57620012fe6200117e565b5060051b60200190565b600082601f8301126200131a57600080fd5b81516020620013336200132d83620012e2565b620011e5565b82815260059290921b840181019181810190868411156200135357600080fd5b8286015b8481101562001370578051835291830191830162001357565b509695505050505050565b6000602082840312156200138e57600080fd5b81516001600160401b0380821115620013a657600080fd5b908301906101408286031215620013bc57600080fd5b620013c662001194565b620013d18362001218565b8152620013e16020840162001218565b6020820152620013f46040840162001218565b6040820152620014076060840162001218565b60608201526200141a6080840162001218565b60808201526200142d60a0840162001235565b60a082015260c0830151828111156200144557600080fd5b62001453878286016200126e565b60c08301525060e0830151828111156200146c57600080fd5b6200147a878286016200126e565b60e08301525061010080840151838111156200149557600080fd5b620014a3888287016200126e565b8284015250506101208084015183811115620014be57600080fd5b620014cc8882870162001308565b918301919091525095945050505050565b600060208284031215620014f057600080fd5b620014fb8262001218565b9392505050565b80516001600160e01b0319811681146200123057600080fd5b600082601f8301126200152d57600080fd5b81516020620015406200132d83620012e2565b82815260059290921b840181019181810190868411156200156057600080fd5b8286015b848110156200137057620015788162001502565b835291830191830162001564565b805160ff811681146200123057600080fd5b600060208284031215620015ab57600080fd5b81516001600160401b0380821115620015c357600080fd5b9083019060808286031215620015d857600080fd5b620015e2620011c0565b620015ed8362001218565b81526020830151828111156200160257600080fd5b62001610878286016200151b565b6020830152506040830151828111156200162957600080fd5b62001637878286016200151b565b6040830152506200164b6060840162001586565b606082015295945050505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000648576200064862001659565b600181811c908216806200169a57607f821691505b602082108103620016bb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200170f57600081815260208120601f850160051c81016020861015620016ea5750805b601f850160051c820191505b818110156200170b57828155600101620016f6565b5050505b505050565b81516001600160401b038111156200173057620017306200117e565b620017488162001741845462001685565b84620016c1565b602080601f831160018114620017805760008415620017675750858301515b600019600386901b1c1916600185901b1785556200170b565b600085815260208120601f198616915b82811015620017b15788860151825594840194600190910190840162001790565b5085821015620017d05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008151808452620017fa81602086016020860162001248565b601f01601f19169290920160200192915050565b600060018060a01b038089168352808816602084015260c060408401526200183a60c0840188620017e0565b83810360608501526200184e8188620017e0565b959091166080840152505061ffff9190911660a090910152949350505050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156200189757600080fd5b81516001600160401b0380821115620018af57600080fd5b9083019060808286031215620018c457600080fd5b620018ce620011c0565b620018d98362001218565b8152620018e96020840162001502565b60208201526040830151828111156200162957600080fd5b634e487b7160e01b600052602160045260246000fd5b8181038181111562000648576200064862001659565b60006060808301818452808751808352608092508286019150828160051b8701016020808b0160005b8481101562001a0257898403607f19018652815180516001600160a01b031685528381015189860190600381106200199e57634e487b7160e01b600052602160045260246000fd5b868601526040918201519186018a905281519081905290840190600090898701905b80831015620019ec5783516001600160e01b0319168252928601926001929092019190860190620019c0565b5097850197955050509082019060010162001956565b50506001600160a01b038a1690880152868103604088015262001a268189620017e0565b9a9950505050505050505050565b60006001820162001a495762001a4962001659565b5060010190565b60008162001a625762001a6262001659565b506000190190565b808202811582820484141762000648576200064862001659565b6000825162001a9881846020870162001248565b9190910192915050565b6001600160a01b0383168152604060208201819052600090620012da90830184620017e0565b602081526000620014fb6020830184620017e0565b60f48062001aec6000396000f3fe608060405236600a57005b600080356001600160e01b03191681527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c6020819052604090912054819060601c80609b5760405162461bcd60e51b815260206004820181905260248201527f4469616d6f6e643a2046756e6374696f6e20646f6573206e6f74206578697374604482015260640160405180910390fd5b3660008037600080366000845af43d6000803e80801560b9573d6000f35b3d6000fdfea26469706673582212204b2e85355e1937888a78adb1bf744ba88839710c17cc2e5676456a66b46bb8ab64736f6c634300081300334c69624469616d6f6e644375743a2043616e2774207265706c6163652066756ec8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c4c69624469616d6f6e644375743a2041646420666163657420686173206e6f20636f64654c69624469616d6f6e644375743a205f696e6974206164647265737320686173206e6f20636f64654c69624469616d6f6e644375743a205265706c61636520666163657420686173206e6f20636f6465";t.DiamondCollection__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t,r){return e.prototype.deploy.call(this,t,r||{})},t.prototype.getDeployTransaction=function(t,r){return e.prototype.getDeployTransaction.call(this,t,r||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},520:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.DiamondLoupeFacet__factory=void 0;var o=r(391),a=[{inputs:[{internalType:"bytes4",name:"_functionSelector",type:"bytes4"}],name:"facetAddress",outputs:[{internalType:"address",name:"facetAddress_",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"facetAddresses",outputs:[{internalType:"address[]",name:"facetAddresses_",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_facet",type:"address"}],name:"facetFunctionSelectors",outputs:[{internalType:"bytes4[]",name:"_facetFunctionSelectors",type:"bytes4[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"facets",outputs:[{components:[{internalType:"address",name:"facetAddress",type:"address"},{internalType:"bytes4[]",name:"functionSelectors",type:"bytes4[]"}],internalType:"struct IDiamondLoupe.Facet[]",name:"facets_",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"_interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}],s="0x608060405234801561001057600080fd5b50610b2b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806301ffc9a71461005c57806352ef6b2c146100bd5780637a0ed627146100d2578063adfca15e146100e7578063cdffacc614610107575b600080fd5b6100a861006a3660046108dd565b6001600160e01b03191660009081527fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131f602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6100c5610159565b6040516100b4919061090e565b6100da61031d565b6040516100b491906109a0565b6100fa6100f5366004610a1d565b61076b565b6040516100b49190610a46565b6101416101153660046108dd565b6001600160e01b0319166000908152600080516020610ad6833981519152602052604090205460601c90565b6040516001600160a01b0390911681526020016100b4565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e54606090600080516020610ad68339815191529061ffff1667ffffffffffffffff8111156101aa576101aa610a59565b6040519080825280602002602001820160405280156101d3578160200160208202803683370190505b50915060008060005b600284015461ffff16821015610315576000818152600185016020526040812054905b6008811015610300578361021281610a85565b600288015490955061ffff168511905061030057600581901b82901b6001600160e01b0319811660009081526020889052604081205460601c90805b888110156102a3578a818151811061026857610268610a9e565b60200260200101516001600160a01b0316836001600160a01b03160361029157600191506102a3565b8061029b81610a85565b91505061024e565b5080156102b2575050506102ee565b818a89815181106102c5576102c5610a9e565b6001600160a01b0390921660209283029190910190910152876102e781610a85565b9850505050505b806102f881610a85565b9150506101ff565b5050808061030d90610a85565b9150506101dc565b505082525090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e54606090600080516020610ad68339815191529061ffff1667ffffffffffffffff81111561036e5761036e610a59565b6040519080825280602002602001820160405280156103b457816020015b60408051808201909152600081526060602082015281526020019060019003908161038c5790505b50600282015490925060009061ffff1667ffffffffffffffff8111156103dc576103dc610a59565b604051908082528060200260200182016040528015610405578160200160208202803683370190505b50905060008060005b600285015461ffff168210156106f8576000818152600186016020526040812054905b60088110156106e3578361044481610a85565b600289015490955061ffff16851190506106e357600581901b82901b6001600160e01b0319811660009081526020899052604081205460601c90805b888110156105a057826001600160a01b03168c82815181106104a4576104a4610a9e565b6020026020010151600001516001600160a01b03160361058e57838c82815181106104d1576104d1610a9e565b6020026020010151602001518b83815181106104ef576104ef610a9e565b602002602001015161ffff168151811061050b5761050b610a9e565b60200260200101906001600160e01b03191690816001600160e01b0319168152505060ff8a828151811061054157610541610a9e565b602002602001015161ffff161061055757600080fd5b89818151811061056957610569610a9e565b60200260200101805180919061057e90610ab4565b61ffff16905250600191506105a0565b8061059881610a85565b915050610480565b5080156105af575050506106d1565b818b89815181106105c2576105c2610a9e565b60209081029190910101516001600160a01b03909116905260028a015461ffff1667ffffffffffffffff8111156105fb576105fb610a59565b604051908082528060200260200182016040528015610624578160200160208202803683370190505b508b898151811061063757610637610a9e565b602002602001015160200181905250828b898151811061065957610659610a9e565b60200260200101516020015160008151811061067757610677610a9e565b60200260200101906001600160e01b03191690816001600160e01b0319168152505060018989815181106106ad576106ad610a9e565b61ffff90921660209283029190910190910152876106ca81610a85565b9850505050505b806106db81610a85565b915050610431565b505080806106f090610a85565b91505061040e565b5060005b8281101561076057600084828151811061071857610718610a9e565b602002602001015161ffff169050600087838151811061073a5761073a610a9e565b60200260200101516020015190508181525050808061075890610a85565b9150506106fc565b508185525050505090565b7fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131e54606090600080516020610ad68339815191529060009061ffff1667ffffffffffffffff8111156107bf576107bf610a59565b6040519080825280602002602001820160405280156107e8578160200160208202803683370190505b5092506000805b600284015461ffff168210156108d3576000818152600185016020526040812054905b60088110156108be578361082581610a85565b600288015490955061ffff16851190506108be57600581901b82901b6001600160e01b0319811660009081526020889052604090205460601c6001600160a01b038a168190036108a9578189888151811061088257610882610a9e565b6001600160e01b031990921660209283029190910190910152866108a581610a85565b9750505b505080806108b690610a85565b915050610812565b505080806108cb90610a85565b9150506107ef565b5050825250919050565b6000602082840312156108ef57600080fd5b81356001600160e01b03198116811461090757600080fd5b9392505050565b6020808252825182820181905260009190848201906040850190845b8181101561094f5783516001600160a01b03168352928401929184019160010161092a565b50909695505050505050565b600081518084526020808501945080840160005b838110156109955781516001600160e01b0319168752958201959082019060010161096f565b509495945050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610a0f57888303603f19018552815180516001600160a01b031684528701518784018790526109fc8785018261095b565b95880195935050908601906001016109c7565b509098975050505050505050565b600060208284031215610a2f57600080fd5b81356001600160a01b038116811461090757600080fd5b602081526000610907602083018461095b565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201610a9757610a97610a6f565b5060010190565b634e487b7160e01b600052603260045260246000fd5b600061ffff808316818103610acb57610acb610a6f565b600101939250505056fec8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131ca2646970667358221220143b424e99baf3f66a7fb20c8ed8ac6c2b482af7c8f35c51091fa35b7b4bae5264736f6c63430008130033";t.DiamondLoupeFacet__factory=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.length>1?e.apply(this,t)||this:e.call(this,a,s,t[0])||this}return i(t,e),t.prototype.deploy=function(t){return e.prototype.deploy.call(this,t||{})},t.prototype.getDeployTransaction=function(t){return e.prototype.getDeployTransaction.call(this,t||{})},t.prototype.attach=function(t){return e.prototype.attach.call(this,t)},t.prototype.connect=function(t){return e.prototype.connect.call(this,t)},t.createInterface=function(){return new o.utils.Interface(a)},t.connect=function(e,t){return new o.Contract(e,a,t)},t.bytecode=s,t.abi=a,t}(o.ContractFactory)},157:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiamondLoupeFacet__factory=t.DiamondCollection__factory=t.BaseStorage__factory=t.BaseFacet__factory=void 0;var n=r(744);Object.defineProperty(t,"BaseFacet__factory",{enumerable:!0,get:function(){return n.BaseFacet__factory}});var i=r(652);Object.defineProperty(t,"BaseStorage__factory",{enumerable:!0,get:function(){return i.BaseStorage__factory}});var o=r(194);Object.defineProperty(t,"DiamondCollection__factory",{enumerable:!0,get:function(){return o.DiamondCollection__factory}});var a=r(520);Object.defineProperty(t,"DiamondLoupeFacet__factory",{enumerable:!0,get:function(){return a.DiamondLoupeFacet__factory}})},196:()=>{},14:(e,t,r)=>{"use strict";function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:o}=Object,a=(s=Object.create(null),e=>{const t=i.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())});var s;const c=e=>(e=e.toLowerCase(),t=>a(t)===e),f=e=>t=>typeof t===e,{isArray:u}=Array,l=f("undefined"),d=c("ArrayBuffer"),h=f("string"),b=f("function"),p=f("number"),m=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==a(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},g=c("Date"),v=c("File"),w=c("Blob"),A=c("FileList"),E=c("URLSearchParams");function _(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),u(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(n=0;n<o;n++)a=i[n],t.call(null,e[a],a,e)}}function T(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,S=e=>!l(e)&&e!==k,P=(x="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>x&&e instanceof x);var x;const N=c("HTMLFormElement"),M=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),C=c("RegExp"),R=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};_(r,((r,i)=>{let o;!1!==(o=t(r,i,e))&&(n[i]=o||r)})),Object.defineProperties(e,n)},I="abcdefghijklmnopqrstuvwxyz",O="0123456789",B={DIGIT:O,ALPHA:I,ALPHA_DIGIT:I+I.toUpperCase()+O},F=c("AsyncFunction");var D={isArray:u,isArrayBuffer:d,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||b(e.append)&&("formdata"===(t=a(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer),t},isString:h,isNumber:p,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:y,isUndefined:l,isDate:g,isFile:v,isBlob:w,isRegExp:C,isFunction:b,isStream:e=>m(e)&&b(e.pipe),isURLSearchParams:E,isTypedArray:P,isFileList:A,forEach:_,merge:function e(){const{caseless:t}=S(this)&&this||{},r={},n=(n,i)=>{const o=t&&T(r,i)||i;y(r[o])&&y(n)?r[o]=e(r[o],n):y(n)?r[o]=e({},n):u(n)?r[o]=n.slice():r[o]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&_(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:i}={})=>(_(t,((t,i)=>{r&&b(t)?e[i]=n(t,r):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,a,s;const c={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],n&&!n(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==r&&o(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:c,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!p(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:N,hasOwnProperty:M,hasOwnProp:M,reduceDescriptors:R,freezeMethods:e=>{R(e,((t,r)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];b(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return u(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:T,global:k,isContextDefined:S,ALPHABET:B,generateString:(e=16,t=B.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=u(e)?[]:{};return _(e,((e,t)=>{const o=r(e,n+1);!l(o)&&(i[t]=o)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:F,isThenable:e=>e&&(m(e)||b(e))&&b(e.then)&&b(e.catch)};function U(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}D.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:D.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const L=U.prototype,j={};function z(e){return D.isPlainObject(e)||D.isArray(e)}function G(e){return D.endsWith(e,"[]")?e.slice(0,-2):e}function q(e,t,r){return e?e.concat(t).map((function(e,t){return e=G(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{j[e]={value:e}})),Object.defineProperties(U,j),Object.defineProperty(L,"isAxiosError",{value:!0}),U.from=(e,t,r,n,i,o)=>{const a=Object.create(L);return D.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(a,e.message,t,r,n,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const K=D.toFlatObject(D,{},null,(function(e){return/^is[A-Z]/.test(e)}));function H(e,t,r){if(!D.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=D.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!D.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,o=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(D.isDate(e))return e.toISOString();if(!s&&D.isBlob(e))throw new U("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(e)||D.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(D.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(D.isArray(e)&&function(e){return D.isArray(e)&&!e.some(z)}(e)||(D.isFileList(e)||D.endsWith(r,"[]"))&&(s=D.toArray(e)))return r=G(r),s.forEach((function(e,n){!D.isUndefined(e)&&null!==e&&t.append(!0===a?q([r],n,o):null===a?r:r+"[]",c(e))})),!1;return!!z(e)||(t.append(q(i,r,o),c(e)),!1)}const u=[],l=Object.assign(K,{defaultVisitor:f,convertValue:c,isVisitable:z});if(!D.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!D.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),D.forEach(r,(function(r,o){!0===(!(D.isUndefined(r)||null===r)&&i.call(t,r,D.isString(o)?o.trim():o,n,l))&&e(r,n?n.concat(o):[o])})),u.pop()}}(e),t}function J(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function W(e,t){this._pairs=[],e&&H(e,this,t)}const V=W.prototype;function Q(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Y(e,t,r){if(!t)return e;const n=r&&r.encode||Q,i=r&&r.serialize;let o;if(o=i?i(t,r):D.isURLSearchParams(t)?t.toString():new W(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}V.append=function(e,t){this._pairs.push([e,t])},V.toString=function(e){const t=e?function(t){return e.call(this,t,J)}:J;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var X=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){D.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:W,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function ee(e){function t(e,r,n,i){let o=e[i++];const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&D.isArray(n)?n.length:o,s?(D.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!a):(n[o]&&D.isObject(n[o])||(n[o]=[]),t(e,r,n[o],i)&&D.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],t[o]=e[o];return t}(n[o])),!a)}if(D.isFormData(e)&&D.isFunction(e.entries)){const r={};return D.forEachEntry(e,((e,n)=>{t(function(e){return D.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const te={transitional:Z,adapter:$.isNode?"http":"xhr",transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=D.isObject(e);if(i&&D.isHTMLForm(e)&&(e=new FormData(e)),D.isFormData(e))return n&&n?JSON.stringify(ee(e)):e;if(D.isArrayBuffer(e)||D.isBuffer(e)||D.isStream(e)||D.isFile(e)||D.isBlob(e))return e;if(D.isArrayBufferView(e))return e.buffer;if(D.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return H(e,new $.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return $.isNode&&D.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=D.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return H(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(D.isString(e))try{return(0,JSON.parse)(e),D.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||te.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&D.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw U.from(e,U.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$.classes.FormData,Blob:$.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],(e=>{te.headers[e]={}}));var re=te;const ne=D.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ie=Symbol("internals");function oe(e){return e&&String(e).trim().toLowerCase()}function ae(e){return!1===e||null==e?e:D.isArray(e)?e.map(ae):String(e)}function se(e,t,r,n,i){return D.isFunction(n)?n.call(this,t,r):(i&&(t=r),D.isString(t)?D.isString(n)?-1!==t.indexOf(n):D.isRegExp(n)?n.test(t):void 0:void 0)}class ce{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=oe(t);if(!i)throw new Error("header name must be a non-empty string");const o=D.findKey(n,i);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=ae(e))}const o=(e,t)=>D.forEach(e,((e,r)=>i(e,r,t)));return D.isPlainObject(e)||e instanceof this.constructor?o(e,t):D.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?o((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&ne[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=oe(e)){const r=D.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(D.isFunction(t))return t.call(this,e,r);if(D.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=oe(e)){const r=D.findKey(this,e);return!(!r||void 0===this[r]||t&&!se(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=oe(e)){const i=D.findKey(r,e);!i||t&&!se(0,r[i],i,t)||(delete r[i],n=!0)}}return D.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!se(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return D.forEach(this,((n,i)=>{const o=D.findKey(r,i);if(o)return t[o]=ae(n),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();a!==i&&delete t[i],t[a]=ae(n),r[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return D.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&D.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[ie]=this[ie]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=oe(e);t[n]||(function(e,t){const r=D.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return D.isArray(e)?e.forEach(n):n(e),this}}ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.reduceDescriptors(ce.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),D.freezeMethods(ce);var fe=ce;function ue(e,t){const r=this||re,n=t||r,i=fe.from(n.headers);let o=n.data;return D.forEach(e,(function(e){o=e.call(r,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function le(e){return!(!e||!e.__CANCEL__)}function de(e,t,r){U.call(this,null==e?"canceled":e,U.ERR_CANCELED,t,r),this.name="CanceledError"}D.inherits(de,U,{__CANCEL__:!0});var he=$.isStandardBrowserEnv?{write:function(e,t,r,n,i,o){const a=[];a.push(e+"="+encodeURIComponent(t)),D.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),D.isString(n)&&a.push("path="+n),D.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function be(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var pe=$.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=D.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function me(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),f=n[a];i||(i=c),r[o]=s,n[o]=c;let u=a,l=0;for(;u!==o;)l+=r[u++],u%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),c-i<t)return;const d=f&&c-f;return d?Math.round(1e3*l/d):void 0}}(50,250);return i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-r,c=n(s);r=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&o<=a?(a-o)/c:void 0,event:i};f[t?"download":"upload"]=!0,e(f)}}const ye={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=fe.from(e.headers).normalize(),o=e.responseType;let a;function s(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}D.isFormData(n)&&($.isStandardBrowserEnv||$.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const f=be(e.baseURL,e.url);function u(){if(!c)return;const n=fe.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new U("Request failed with status code "+r.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),s()}),(function(e){r(e),s()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Y(f,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=u:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(u)},c.onabort=function(){c&&(r(new U("Request aborted",U.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new U("Network Error",U.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new U(t,n.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,c)),c=null},$.isStandardBrowserEnv){const t=(e.withCredentials||pe(f))&&e.xsrfCookieName&&he.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in c&&D.forEach(i.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),D.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",me(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",me(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(r(!t||t.type?new de(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const l=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(f);l&&-1===$.protocols.indexOf(l)?r(new U("Unsupported protocol "+l+":",U.ERR_BAD_REQUEST,e)):c.send(n||null)}))}};D.forEach(ye,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var ge=e=>{e=D.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let i=0;i<t&&(r=e[i],!(n=D.isString(r)?ye[r.toLowerCase()]:r));i++);if(!n){if(!1===n)throw new U(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(D.hasOwnProp(ye,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!D.isFunction(n))throw new TypeError("adapter is not a function");return n};function ve(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new de(null,e)}function we(e){return ve(e),e.headers=fe.from(e.headers),e.data=ue.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ge(e.adapter||re.adapter)(e).then((function(t){return ve(e),t.data=ue.call(e,e.transformResponse,t),t.headers=fe.from(t.headers),t}),(function(t){return le(t)||(ve(e),t&&t.response&&(t.response.data=ue.call(e,e.transformResponse,t.response),t.response.headers=fe.from(t.response.headers))),Promise.reject(t)}))}const Ae=e=>e instanceof fe?e.toJSON():e;function Ee(e,t){t=t||{};const r={};function n(e,t,r){return D.isPlainObject(e)&&D.isPlainObject(t)?D.merge.call({caseless:r},e,t):D.isPlainObject(t)?D.merge({},t):D.isArray(t)?t.slice():t}function i(e,t,r){return D.isUndefined(t)?D.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function o(e,t){if(!D.isUndefined(t))return n(void 0,t)}function a(e,t){return D.isUndefined(t)?D.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,o){return o in t?n(r,i):o in e?n(void 0,r):void 0}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>i(Ae(e),Ae(t),!0)};return D.forEach(Object.keys(Object.assign({},e,t)),(function(n){const o=c[n]||i,a=o(e[n],t[n],n);D.isUndefined(a)&&o!==s||(r[n]=a)})),r}const _e={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{_e[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Te={};_e.transitional=function(e,t,r){function n(e,t){return"[Axios v1.5.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,o)=>{if(!1===e)throw new U(n(i," has been removed"+(t?" in "+t:"")),U.ERR_DEPRECATED);return t&&!Te[i]&&(Te[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,o)}};var ke={assertOptions:function(e,t,r){if("object"!=typeof e)throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],a=t[o];if(a){const t=e[o],r=void 0===t||a(t,o,e);if(!0!==r)throw new U("option "+o+" must be "+r,U.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new U("Unknown option "+o,U.ERR_BAD_OPTION)}},validators:_e};const Se=ke.validators;class Pe{constructor(e){this.defaults=e,this.interceptors={request:new X,response:new X}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ee(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&ke.assertOptions(r,{silentJSONParsing:Se.transitional(Se.boolean),forcedJSONParsing:Se.transitional(Se.boolean),clarifyTimeoutError:Se.transitional(Se.boolean)},!1),null!=n&&(D.isFunction(n)?t.paramsSerializer={serialize:n}:ke.assertOptions(n,{encode:Se.function,serialize:Se.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&D.merge(i.common,i[t.method]);i&&D.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=fe.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let f;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,l=0;if(!s){const e=[we.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),u=e.length,f=Promise.resolve(t);l<u;)f=f.then(e[l++],e[l++]);return f}u=a.length;let d=t;for(l=0;l<u;){const e=a[l++],t=a[l++];try{d=e(d)}catch(e){t.call(this,e);break}}try{f=we.call(this,d)}catch(e){return Promise.reject(e)}for(l=0,u=c.length;l<u;)f=f.then(c[l++],c[l++]);return f}getUri(e){return Y(be((e=Ee(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}D.forEach(["delete","get","head","options"],(function(e){Pe.prototype[e]=function(t,r){return this.request(Ee(r||{},{method:e,url:t,data:(r||{}).data}))}})),D.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(Ee(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Pe.prototype[e]=t(),Pe.prototype[e+"Form"]=t(!0)}));var xe=Pe;class Ne{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new de(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ne((function(t){e=t})),cancel:e}}}var Me=Ne;const Ce={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ce).forEach((([e,t])=>{Ce[t]=e}));var Re=Ce;const Ie=function e(t){const r=new xe(t),i=n(xe.prototype.request,r);return D.extend(i,xe.prototype,r,{allOwnKeys:!0}),D.extend(i,r,null,{allOwnKeys:!0}),i.create=function(r){return e(Ee(t,r))},i}(re);Ie.Axios=xe,Ie.CanceledError=de,Ie.CancelToken=Me,Ie.isCancel=le,Ie.VERSION="1.5.0",Ie.toFormData=H,Ie.AxiosError=U,Ie.Cancel=Ie.CanceledError,Ie.all=function(e){return Promise.all(e)},Ie.spread=function(e){return function(t){return e.apply(null,t)}},Ie.isAxiosError=function(e){return D.isObject(e)&&!0===e.isAxiosError},Ie.mergeConfig=Ee,Ie.AxiosHeaders=fe,Ie.formToJSON=e=>ee(D.isHTMLForm(e)?new FormData(e):e),Ie.getAdapter=ge,Ie.HttpStatusCode=Re,Ie.default=Ie,e.exports=Ie}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n=r(368);return n.default})()));
|