1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945 |
- var _te=Object.defineProperty;var OR=t=>{throw TypeError(t)};var Ete=(t,e,r)=>e in t?_te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Cte=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ce=(t,e,r)=>Ete(t,typeof e!="symbol"?e+"":e,r),Qx=(t,e,r)=>e.has(t)||OR("Cannot "+r);var H=(t,e,r)=>(Qx(t,e,"read from private field"),r?r.call(t):e.get(t)),me=(t,e,r)=>e.has(t)?OR("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Z=(t,e,r,n)=>(Qx(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Pe=(t,e,r)=>(Qx(t,e,"access private method"),r);var I1=(t,e,r,n)=>({set _(i){Z(t,e,i,r)},get _(){return H(t,e,n)}});var sNe=Cte(Eb=>{(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();function Ate(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}const ZW="2.31.0";let P1={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${ZW}`},_r=class GT extends Error{constructor(e,r={}){var a;const n=(()=>{var c;return r.cause instanceof GT?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),i=r.cause instanceof GT&&r.cause.docsPath||r.docsPath,s=(a=P1.getDocsUrl)==null?void 0:a.call(P1,{...r,docsPath:i}),o=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...P1.version?[`Version: ${P1.version}`]:[]].join(`
- `);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=ZW}walk(e){return YW(this,e)}};function YW(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?YW(t.cause,e):e?null:t}let JW=class extends _r{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},xte=class extends _r{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function _v(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function Ci(t){return _v(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}class QW extends _r{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}let XW=class extends _r{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};function Jm(t,{dir:e,size:r=32}={}){return typeof t=="string"?ad(t,{dir:e,size:r}):Ste(t,{dir:e,size:r})}function ad(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new XW({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function Ste(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new XW({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;i<r;i++){const s=e==="right";n[s?i:r-i-1]=t[s?i:t.length-i-1]}return n}const Tte=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Tb(t,e={}){return typeof t=="number"||typeof t=="bigint"?$d(t,e):typeof t=="string"?Ib(t,e):typeof t=="boolean"?eV(t,e):C9(t,e)}function eV(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(Ev(r,{size:e.size}),Jm(r,{size:e.size})):r}function C9(t,e={}){let r="";for(let i=0;i<t.length;i++)r+=Tte[t[i]];const n=`0x${r}`;return typeof e.size=="number"?(Ev(n,{size:e.size}),Jm(n,{dir:"right",size:e.size})):n}function $d(t,e={}){const{signed:r,size:n}=e,i=BigInt(t);let s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&r?-s-1n:0;if(s&&i>s||i<o){const c=typeof t=="bigint"?"n":"";throw new JW({max:s?`${s}${c}`:void 0,min:`${o}${c}`,signed:r,size:n,value:`${t}${c}`})}const a=`0x${(r&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?Jm(a,{size:n}):a}const Ite=new TextEncoder;function Ib(t,e={}){const r=Ite.encode(t);return C9(r,e)}const Pte=new TextEncoder;function tV(t,e={}){return typeof t=="number"||typeof t=="bigint"?Rte(t,e):typeof t=="boolean"?Ote(t,e):_v(t)?rV(t,e):nV(t,e)}function Ote(t,e={}){const r=new Uint8Array(1);return r[0]=Number(t),typeof e.size=="number"?(Ev(r,{size:e.size}),Jm(r,{size:e.size})):r}const mc={zero:48,nine:57,A:65,F:70,a:97,f:102};function RR(t){if(t>=mc.zero&&t<=mc.nine)return t-mc.zero;if(t>=mc.A&&t<=mc.F)return t-(mc.A-10);if(t>=mc.a&&t<=mc.f)return t-(mc.a-10)}function rV(t,e={}){let r=t;e.size&&(Ev(r,{size:e.size}),r=Jm(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,s=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const c=RR(n.charCodeAt(a++)),u=RR(n.charCodeAt(a++));if(c===void 0||u===void 0)throw new _r(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);s[o]=c*16+u}return s}function Rte(t,e){const r=$d(t,e);return rV(r)}function nV(t,e={}){const r=Pte.encode(t);return typeof e.size=="number"?(Ev(r,{size:e.size}),Jm(r,{dir:"right",size:e.size})):r}function Ev(t,{size:e}){if(Ci(t)>e)throw new xte({givenSize:Ci(t),maxSize:e})}function md(t){return typeof t[0]=="string"?iV(t):kte(t)}function kte(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function iV(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function Nte(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,s]=[r.slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $te(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function kR(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function tm(t,...e){if(!$te(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function mC(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function sV(t,e){tm(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function jte(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Pb(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function Xx(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function ga(t,e){return t<<32-e|t>>>e}const Bte=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Dte(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function Mte(t){for(let e=0;e<t.length;e++)t[e]=Dte(t[e]);return t}const NR=Bte?t=>t:Mte,Lte=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Ute=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Fte(t){if(tm(t),Lte)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=Ute[t[r]];return e}function Hte(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function A9(t){return typeof t=="string"&&(t=Hte(t)),tm(t),t}let oV=class{};function aV(t){const e=n=>t().update(A9(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function qte(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+u,a,n)}function zte(t,e,r){return t&e^~t&r}function Wte(t,e,r){return t&e^t&r^e&r}let Vte=class extends oV{constructor(e,r,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=Xx(this.buffer)}update(e){mC(this),e=A9(e),tm(e);const{view:r,buffer:n,blockLen:i}=this,s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=Xx(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){mC(this),sV(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,Pb(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(n,0),o=0);for(let d=o;d<i;d++)r[d]=0;qte(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=Xx(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)a.setUint32(4*d,l[d],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=s,e.length=i,e.pos=a,i%r&&e.buffer.set(n),e}clone(){return this._cloneInto()}};const ll=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),G2=BigInt(2**32-1),$R=BigInt(32);function Gte(t,e=!1){return e?{h:Number(t&G2),l:Number(t>>$R&G2)}:{h:Number(t>>$R&G2)|0,l:Number(t&G2)|0}}function Kte(t,e=!1){const r=t.length;let n=new Uint32Array(r),i=new Uint32Array(r);for(let s=0;s<r;s++){const{h:o,l:a}=Gte(t[s],e);[n[s],i[s]]=[o,a]}return[n,i]}const Zte=(t,e,r)=>t<<r|e>>>32-r,Yte=(t,e,r)=>e<<r|t>>>32-r,Jte=(t,e,r)=>e<<r-32|t>>>64-r,Qte=(t,e,r)=>t<<r-32|e>>>64-r,Xte=Uint32Array.from([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]),dl=new Uint32Array(64);let ere=class extends Vte{constructor(e=32){super(64,e,8,!1),this.A=ll[0]|0,this.B=ll[1]|0,this.C=ll[2]|0,this.D=ll[3]|0,this.E=ll[4]|0,this.F=ll[5]|0,this.G=ll[6]|0,this.H=ll[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let d=0;d<16;d++,r+=4)dl[d]=e.getUint32(r,!1);for(let d=16;d<64;d++){const h=dl[d-15],f=dl[d-2],g=ga(h,7)^ga(h,18)^h>>>3,p=ga(f,17)^ga(f,19)^f>>>10;dl[d]=p+dl[d-7]+g+dl[d-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:u,H:l}=this;for(let d=0;d<64;d++){const h=ga(a,6)^ga(a,11)^ga(a,25),f=l+h+zte(a,c,u)+Xte[d]+dl[d]|0,p=(ga(n,2)^ga(n,13)^ga(n,22))+Wte(n,i,s)|0;l=u,u=c,c=a,a=o+f|0,o=s,s=i,i=n,n=f+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,i,s,o,a,c,u,l)}roundClean(){Pb(dl)}destroy(){this.set(0,0,0,0,0,0,0,0),Pb(this.buffer)}};const tre=aV(()=>new ere),rre=tre;class cV extends _r{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class x9 extends _r{constructor({cause:e,message:r}={}){var i;const n=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(x9,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(x9,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});let S9=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}};const nre=BigInt(0),O1=BigInt(1),ire=BigInt(2),sre=BigInt(7),ore=BigInt(256),are=BigInt(113),uV=[],lV=[],dV=[];for(let t=0,e=O1,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],uV.push(2*(5*n+r)),lV.push((t+1)*(t+2)/2%64);let i=nre;for(let s=0;s<7;s++)e=(e<<O1^(e>>sre)*are)%ore,e&ire&&(i^=O1<<(O1<<BigInt(s))-O1);dV.push(i)}const hV=Kte(dV,!0),cre=hV[0],ure=hV[1],jR=(t,e,r)=>r>32?Jte(t,e,r):Zte(t,e,r),BR=(t,e,r)=>r>32?Qte(t,e,r):Yte(t,e,r);function lre(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=r[c],l=r[c+1],d=jR(u,l,1)^r[a],h=BR(u,l,1)^r[a+1];for(let f=0;f<50;f+=10)t[o+f]^=d,t[o+f+1]^=h}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=lV[o],c=jR(i,s,a),u=BR(i,s,a),l=uV[o];i=t[l],s=t[l+1],t[l]=c,t[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=cre[n],t[1]^=ure[n]}Pb(r)}let dre=class fV extends oV{constructor(e,r,n,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,kR(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=jte(this.state)}clone(){return this._cloneInto()}keccak(){NR(this.state32),lre(this.state32,this.rounds),NR(this.state32),this.posOut=0,this.pos=0}update(e){mC(this),e=A9(e),tm(e);const{blockLen:r,state:n}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);for(let a=0;a<o;a++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){mC(this,!1),tm(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return kR(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(sV(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Pb(this.state)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new fV(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}};const hre=(t,e,r)=>aV(()=>new dre(e,t,r)),fre=hre(1,136,256/8);function qa(t,e){const r=e||"hex",n=fre(_v(t,{strict:!1})?tV(t):t);return r==="bytes"?n:Tb(n)}const e8=new S9(8192);function pre(t,e){if(e8.has(`${t}.${e}`))return e8.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),n=qa(nV(r),"bytes"),i=r.split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(n[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return e8.set(`${t}.${e}`,s),s}const gre=/^0x[a-fA-F0-9]{40}$/,t8=new S9(8192);function Ob(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(t8.has(n))return t8.get(n);const i=gre.test(t)?t.toLowerCase()===t?!0:r?pre(t)===t:!0:!1;return t8.set(n,i),i}function pV(t,e,r,{strict:n}={}){return _v(t,{strict:!1})?wre(t,e,r,{strict:n}):mre(t,e,r,{strict:n})}function gV(t,e){if(typeof e=="number"&&e>0&&e>Ci(t)-1)throw new QW({offset:e,position:"start",size:Ci(t)})}function mV(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Ci(t)!==r-e)throw new QW({offset:r,position:"end",size:Ci(t)})}function mre(t,e,r,{strict:n}={}){gV(t,e);const i=t.slice(e,r);return n&&mV(i,e,r),i}function wre(t,e,r,{strict:n}={}){gV(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&mV(i,e,r),i}function KT(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new Sre(t.type);return`${t.name}(${wV(t.inputs,{includeName:e})})`}function wV(t,{includeName:e=!1}={}){return t?t.map(r=>bre(r,{includeName:e})).join(e?", ":","):""}function bre(t,{includeName:e}){return t.type.startsWith("tuple")?`(${wV(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}class yre extends _r{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(`
- `),{name:"AbiEncodingArrayLengthMismatchError"})}}class vre extends _r{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${Ci(r)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class _re extends _r{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(`
- `),{name:"AbiEncodingLengthMismatchError"})}}class DR extends _r{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
- `),{docsPath:r,name:"AbiFunctionNotFoundError"})}}class Ere extends _r{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${KT(e.abiItem)}\`, and`,`\`${r.type}\` in \`${KT(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class Cre extends _r{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}}class Are extends _r{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
- `),{docsPath:r,name:"InvalidAbiEncodingType"})}}class xre extends _r{constructor(e){super([`Value "${e}" is not a valid array.`].join(`
- `),{name:"InvalidArrayError"})}}class Sre extends _r{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
- `),{name:"InvalidDefinitionTypeError"})}}const Tre=t=>qa(tV(t));function Ire(t){return Tre(t)}function Pre(t,e){const r=t.exec(e);return r==null?void 0:r.groups}const MR=/^tuple(?<array>(\[(\d*)\])*)$/;function ZT(t){let e=t.type;if(MR.test(t.type)&&"components"in t){e="(";const r=t.components.length;for(let i=0;i<r;i++){const s=t.components[i];e+=ZT(s),i<r-1&&(e+=", ")}const n=Pre(MR,t.type);return e+=`)${(n==null?void 0:n.array)??""}`,ZT({...t,type:e})}return"indexed"in t&&t.indexed&&(e=`${e} indexed`),t.name?`${e} ${t.name}`:e}function R1(t){let e="";const r=t.length;for(let n=0;n<r;n++){const i=t[n];e+=ZT(i),n!==r-1&&(e+=", ")}return e}function Ore(t){var e;return t.type==="function"?`function ${t.name}(${R1(t.inputs)})${t.stateMutability&&t.stateMutability!=="nonpayable"?` ${t.stateMutability}`:""}${(e=t.outputs)!=null&&e.length?` returns (${R1(t.outputs)})`:""}`:t.type==="event"?`event ${t.name}(${R1(t.inputs)})`:t.type==="error"?`error ${t.name}(${R1(t.inputs)})`:t.type==="constructor"?`constructor(${R1(t.inputs)})${t.stateMutability==="payable"?" payable":""}`:t.type==="fallback"?`fallback() external${t.stateMutability==="payable"?" payable":""}`:"receive() external payable"}function Rre(t){let e=!0,r="",n=0,i="",s=!1;for(let o=0;o<t.length;o++){const a=t[o];if(["(",")",","].includes(a)&&(e=!0),a==="("&&n++,a===")"&&n--,!!e){if(n===0){if(a===" "&&["event","function",""].includes(i))i="";else if(i+=a,a===")"){s=!0;break}continue}if(a===" "){t[o-1]!==","&&r!==","&&r!==",("&&(r="",e=!1);continue}i+=a,r+=a}}if(!s)throw new _r("Unable to normalize signature.");return i}const kre=t=>{const e=typeof t=="string"?t:Ore(t);return Rre(e)};function bV(t){return Ire(kre(t))}const yV=t=>pV(bV(t),0,4),Nre=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,vV=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function T9(t,e){if(t.length!==e.length)throw new _re({expectedLength:t.length,givenLength:e.length});const r=$re({params:t,values:e}),n=P9(r);return n.length===0?"0x":n}function $re({params:t,values:e}){const r=[];for(let n=0;n<t.length;n++)r.push(I9({param:t[n],value:e[n]}));return r}function I9({param:t,value:e}){const r=Hre(t.type);if(r){const[n,i]=r;return Bre(e,{length:n,param:{...t,type:i}})}if(t.type==="tuple")return Fre(e,{param:t});if(t.type==="address")return jre(e);if(t.type==="bool")return Mre(e);if(t.type.startsWith("uint")||t.type.startsWith("int")){const n=t.type.startsWith("int"),[,,i="256"]=vV.exec(t.type)??[];return Lre(e,{signed:n,size:Number(i)})}if(t.type.startsWith("bytes"))return Dre(e,{param:t});if(t.type==="string")return Ure(e);throw new Are(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function P9(t){let e=0;for(let s=0;s<t.length;s++){const{dynamic:o,encoded:a}=t[s];o?e+=32:e+=Ci(a)}const r=[],n=[];let i=0;for(let s=0;s<t.length;s++){const{dynamic:o,encoded:a}=t[s];o?(r.push($d(e+i,{size:32})),n.push(a),i+=Ci(a)):r.push(a)}return md([...r,...n])}function jre(t){if(!Ob(t))throw new cV({address:t});return{dynamic:!1,encoded:ad(t.toLowerCase())}}function Bre(t,{length:e,param:r}){const n=e===null;if(!Array.isArray(t))throw new xre(t);if(!n&&t.length!==e)throw new yre({expectedLength:e,givenLength:t.length,type:`${r.type}[${e}]`});let i=!1;const s=[];for(let o=0;o<t.length;o++){const a=I9({param:r,value:t[o]});a.dynamic&&(i=!0),s.push(a)}if(n||i){const o=P9(s);if(n){const a=$d(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?md([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:md(s.map(({encoded:o})=>o))}}function Dre(t,{param:e}){const[,r]=e.type.split("bytes"),n=Ci(t);if(!r){let i=t;return n%32!==0&&(i=ad(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:md([ad($d(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new vre({expectedSize:Number.parseInt(r),value:t});return{dynamic:!1,encoded:ad(t,{dir:"right"})}}function Mre(t){if(typeof t!="boolean")throw new _r(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:ad(eV(t))}}function Lre(t,{signed:e,size:r=256}){if(typeof r=="number"){const n=2n**(BigInt(r)-(e?1n:0n))-1n,i=e?-n-1n:0n;if(t>n||t<i)throw new JW({max:n.toString(),min:i.toString(),signed:e,size:r/8,value:t.toString()})}return{dynamic:!1,encoded:$d(t,{size:32,signed:e})}}function Ure(t){const e=Ib(t),r=Math.ceil(Ci(e)/32),n=[];for(let i=0;i<r;i++)n.push(ad(pV(e,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:md([ad($d(Ci(e),{size:32})),...n])}}function Fre(t,{param:e}){let r=!1;const n=[];for(let i=0;i<e.components.length;i++){const s=e.components[i],o=Array.isArray(t)?i:s.name,a=I9({param:s,value:t[o]});n.push(a),a.dynamic&&(r=!0)}return{dynamic:r,encoded:r?P9(n):md(n.map(({encoded:i})=>i))}}function Hre(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const cd=(t,e,r)=>JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString():i,r),qre=bV;function zre(t){const{abi:e,args:r=[],name:n}=t,i=_v(n,{strict:!1}),s=e.filter(a=>i?a.type==="function"?yV(a)===n:a.type==="event"?qre(a)===n:!1:"name"in a&&a.name===n);if(s.length===0)return;if(s.length===1)return s[0];let o;for(const a of s){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((u,l)=>{const d="inputs"in a&&a.inputs[l];return d?YT(u,d):!1})){if(o&&"inputs"in o&&o.inputs){const u=_V(a.inputs,o.inputs,r);if(u)throw new Ere({abiItem:a,type:u[0]},{abiItem:o,type:u[1]})}o=a}}return o||s[0]}function YT(t,e){const r=typeof t,n=e.type;switch(n){case"address":return Ob(t,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>YT(Object.values(t)[s],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>YT(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function _V(t,e,r){for(const n in t){const i=t[n],s=e[n];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return _V(i.components,s.components,r[n]);const o=[i.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Ob(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?Ob(r[n],{strict:!1}):!1)return o}}const O9=t=>t;class ub extends _r{constructor({body:e,cause:r,details:n,headers:i,status:s,url:o}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${O9(o)}`,e&&`Request body: ${cd(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=s,this.url=o}}class EV extends _r{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${O9(n)}`,`Request body: ${cd(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code,this.data=r.data}}class LR extends _r{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${O9(r)}`,`Request body: ${cd(e)}`],name:"TimeoutError"})}}const Wre=-1;class Xi extends _r{constructor(e,{code:r,docsPath:n,metaMessages:i,name:s,shortMessage:o}){super(o,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof EV?e.code:r??Wre}}class Rs extends Xi{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class Rb extends Xi{constructor(e){super(e,{code:Rb.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Rb,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class kb extends Xi{constructor(e){super(e,{code:kb.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(kb,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Nb extends Xi{constructor(e,{method:r}={}){super(e,{code:Nb.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(Nb,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class $b extends Xi{constructor(e){super(e,{code:$b.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
- `)})}}Object.defineProperty($b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class rm extends Xi{constructor(e){super(e,{code:rm.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(rm,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class jb extends Xi{constructor(e){super(e,{code:jb.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
- `)})}}Object.defineProperty(jb,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Bb extends Xi{constructor(e){super(e,{code:Bb.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Bb,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Db extends Xi{constructor(e){super(e,{code:Db.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Db,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class nm extends Xi{constructor(e){super(e,{code:nm.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(nm,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Zh extends Xi{constructor(e,{method:r}={}){super(e,{code:Zh.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not supported.`})}}Object.defineProperty(Zh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class im extends Xi{constructor(e){super(e,{code:im.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(im,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Mb extends Xi{constructor(e){super(e,{code:Mb.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Mb,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class xf extends Rs{constructor(e){super(e,{code:xf.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(xf,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Lb extends Rs{constructor(e){super(e,{code:Lb.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(Lb,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Ub extends Rs{constructor(e,{method:r}={}){super(e,{code:Ub.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(Ub,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Fb extends Rs{constructor(e){super(e,{code:Fb.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(Fb,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Hb extends Rs{constructor(e){super(e,{code:Hb.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(Hb,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class qb extends Rs{constructor(e){super(e,{code:qb.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(qb,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class zb extends Rs{constructor(e){super(e,{code:zb.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(zb,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class Wb extends Rs{constructor(e){super(e,{code:Wb.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(Wb,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class Vb extends Rs{constructor(e){super(e,{code:Vb.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(Vb,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class Gb extends Rs{constructor(e){super(e,{code:Gb.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(Gb,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class Kb extends Rs{constructor(e){super(e,{code:Kb.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(Kb,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Zb extends Rs{constructor(e){super(e,{code:Zb.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Zb,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class Yb extends Rs{constructor(e){super(e,{code:Yb.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(Yb,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Vre extends Xi{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const Gre=Ate({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});function Qm(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}const UR=Qm({id:"5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",name:"Solana",network:"solana-mainnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!1,chainNamespace:"solana",caipNetworkId:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",deprecatedCaipNetworkId:"solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ"}),FR=Qm({id:"EtWTRABZaYq6iMfeYKouRu166VU2xqa1",name:"Solana Devnet",network:"solana-devnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",deprecatedCaipNetworkId:"solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"});Qm({id:"4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",name:"Solana Testnet",network:"solana-testnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"});Qm({id:"000000000019d6689c085ae165831e93",caipNetworkId:"bip122:000000000019d6689c085ae165831e93",chainNamespace:"bip122",name:"Bitcoin",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}});Qm({id:"000000000933ea01ad0ee984209779ba",caipNetworkId:"bip122:000000000933ea01ad0ee984209779ba",chainNamespace:"bip122",name:"Bitcoin Testnet",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},testnet:!0});const Kre=Symbol(),HR=Object.getPrototypeOf,JT=new WeakMap,Zre=t=>t&&(JT.has(t)?JT.get(t):HR(t)===Object.prototype||HR(t)===Array.prototype),Yre=t=>Zre(t)&&t[Kre]||null,qR=(t,e=!0)=>{JT.set(t,e)},wC={},r8=t=>typeof t=="object"&&t!==null,jl=new WeakMap,eb=new WeakSet,Jre=(t=Object.is,e=(u,l)=>new Proxy(u,l),r=u=>r8(u)&&!eb.has(u)&&(Array.isArray(u)||!(Symbol.iterator in u))&&!(u instanceof WeakMap)&&!(u instanceof WeakSet)&&!(u instanceof Error)&&!(u instanceof Number)&&!(u instanceof Date)&&!(u instanceof String)&&!(u instanceof RegExp)&&!(u instanceof ArrayBuffer),n=u=>{switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:throw u}},i=new WeakMap,s=(u,l,d=n)=>{const h=i.get(u);if((h==null?void 0:h[0])===l)return h[1];const f=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u));return qR(f,!0),i.set(u,[l,f]),Reflect.ownKeys(u).forEach(g=>{if(Object.getOwnPropertyDescriptor(f,g))return;const p=Reflect.get(u,g),{enumerable:m}=Reflect.getOwnPropertyDescriptor(u,g),b={value:p,enumerable:m,configurable:!0};if(eb.has(p))qR(p,!1);else if(p instanceof Promise)delete b.value,b.get=()=>d(p);else if(jl.has(p)){const[v,E]=jl.get(p);b.value=s(v,E(),d)}Object.defineProperty(f,g,b)}),Object.preventExtensions(f)},o=new WeakMap,a=[1,1],c=u=>{if(!r8(u))throw new Error("object required");const l=o.get(u);if(l)return l;let d=a[0];const h=new Set,f=(A,T=++a[0])=>{d!==T&&(d=T,h.forEach(O=>O(A,T)))};let g=a[1];const p=(A=++a[1])=>(g!==A&&!h.size&&(g=A,b.forEach(([T])=>{const O=T[1](A);O>d&&(d=O)})),d),m=A=>(T,O)=>{const k=[...T];k[1]=[A,...k[1]],f(k,O)},b=new Map,v=(A,T)=>{if((wC?"production":void 0)!=="production"&&b.has(A))throw new Error("prop listener already exists");if(h.size){const O=T[3](m(A));b.set(A,[T,O])}else b.set(A,[T])},E=A=>{var T;const O=b.get(A);O&&(b.delete(A),(T=O[1])==null||T.call(O))},w=A=>(h.add(A),h.size===1&&b.forEach(([O,k],j)=>{if((wC?"production":void 0)!=="production"&&k)throw new Error("remove already exists");const N=O[3](m(j));b.set(j,[O,N])}),()=>{h.delete(A),h.size===0&&b.forEach(([O,k],j)=>{k&&(k(),b.set(j,[O]))})}),C=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),_=e(C,{deleteProperty(A,T){const O=Reflect.get(A,T);E(T);const k=Reflect.deleteProperty(A,T);return k&&f(["delete",[T],O]),k},set(A,T,O,k){const j=Reflect.has(A,T),N=Reflect.get(A,T,k);if(j&&(t(N,O)||o.has(O)&&t(N,o.get(O))))return!0;E(T),r8(O)&&(O=Yre(O)||O);let S=O;if(O instanceof Promise)O.then(P=>{O.status="fulfilled",O.value=P,f(["resolve",[T],P])}).catch(P=>{O.status="rejected",O.reason=P,f(["reject",[T],P])});else{!jl.has(O)&&r(O)&&(S=c(O));const P=!eb.has(S)&&jl.get(S);P&&v(T,P)}return Reflect.set(A,T,S,k),f(["set",[T],O,N]),!0}});o.set(u,_);const x=[C,p,s,w];return jl.set(_,x),Reflect.ownKeys(u).forEach(A=>{const T=Object.getOwnPropertyDescriptor(u,A);"value"in T&&(_[A]=u[A],delete T.value,delete T.writable),Object.defineProperty(C,A,T)}),_})=>[c,jl,eb,t,e,r,n,i,s,o,a],[Qre]=Jre();function rr(t={}){return Qre(t)}function ln(t,e,r){const n=jl.get(t);(wC?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i;const s=[],o=n[3];let a=!1;const u=o(l=>{s.push(l),i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,u()}}function Jb(t,e){const r=jl.get(t);(wC?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");const[n,i,s]=r;return s(n,i(),e)}function Nf(t){return eb.add(t),t}function dn(t,e,r,n){let i=t[e];return ln(t,()=>{const s=t[e];Object.is(i,s)||r(i=s)})}function Xre(t){const e=rr({data:Array.from([]),has(r){return this.data.some(n=>n[0]===r)},set(r,n){const i=this.data.find(s=>s[0]===r);return i?i[1]=n:this.data.push([r,n]),this},get(r){var n;return(n=this.data.find(i=>i[0]===r))==null?void 0:n[1]},delete(r){const n=this.data.findIndex(i=>i[0]===r);return n===-1?!1:(this.data.splice(n,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(r){this.data.forEach(n=>{r(n[1],n[0],this)})},keys(){return this.data.map(r=>r[0]).values()},values(){return this.data.map(r=>r[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(e,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(e),e}var Da=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function CV(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var F4={exports:{}},ene=F4.exports,zR;function tne(){return zR||(zR=1,function(t,e){(function(r,n){t.exports=n()})(ene,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",u="day",l="week",d="month",h="quarter",f="year",g="date",p="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(N){var S=["th","st","nd","rd"],P=N%100;return"["+N+(S[(P-20)%10]||S[P]||S[0])+"]"}},E=function(N,S,P){var I=String(N);return!I||I.length>=S?N:""+Array(S+1-I.length).join(P)+N},w={s:E,z:function(N){var S=-N.utcOffset(),P=Math.abs(S),I=Math.floor(P/60),B=P%60;return(S<=0?"+":"-")+E(I,2,"0")+":"+E(B,2,"0")},m:function N(S,P){if(S.date()<P.date())return-N(P,S);var I=12*(P.year()-S.year())+(P.month()-S.month()),B=S.clone().add(I,d),$=P-B<0,R=S.clone().add(I+($?-1:1),d);return+(-(I+(P-B)/($?B-R:R-B))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:d,y:f,w:l,d:u,D:g,h:c,m:a,s:o,ms:s,Q:h}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},C="en",y={};y[C]=v;var _="$isDayjsObject",x=function(N){return N instanceof k||!(!N||!N[_])},A=function N(S,P,I){var B;if(!S)return C;if(typeof S=="string"){var $=S.toLowerCase();y[$]&&(B=$),P&&(y[$]=P,B=$);var R=S.split("-");if(!B&&R.length>1)return N(R[0])}else{var D=S.name;y[D]=S,B=D}return!I&&B&&(C=B),B||!I&&C},T=function(N,S){if(x(N))return N.clone();var P=typeof S=="object"?S:{};return P.date=N,P.args=arguments,new k(P)},O=w;O.l=A,O.i=x,O.w=function(N,S){return T(N,{locale:S.$L,utc:S.$u,x:S.$x,$offset:S.$offset})};var k=function(){function N(P){this.$L=A(P.locale,null,!0),this.parse(P),this.$x=this.$x||P.x||{},this[_]=!0}var S=N.prototype;return S.parse=function(P){this.$d=function(I){var B=I.date,$=I.utc;if(B===null)return new Date(NaN);if(O.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var R=B.match(m);if(R){var D=R[2]-1||0,L=(R[7]||"0").substring(0,3);return $?new Date(Date.UTC(R[1],D,R[3]||1,R[4]||0,R[5]||0,R[6]||0,L)):new Date(R[1],D,R[3]||1,R[4]||0,R[5]||0,R[6]||0,L)}}return new Date(B)}(P),this.init()},S.init=function(){var P=this.$d;this.$y=P.getFullYear(),this.$M=P.getMonth(),this.$D=P.getDate(),this.$W=P.getDay(),this.$H=P.getHours(),this.$m=P.getMinutes(),this.$s=P.getSeconds(),this.$ms=P.getMilliseconds()},S.$utils=function(){return O},S.isValid=function(){return this.$d.toString()!==p},S.isSame=function(P,I){var B=T(P);return this.startOf(I)<=B&&B<=this.endOf(I)},S.isAfter=function(P,I){return T(P)<this.startOf(I)},S.isBefore=function(P,I){return this.endOf(I)<T(P)},S.$g=function(P,I,B){return O.u(P)?this[I]:this.set(B,P)},S.unix=function(){return Math.floor(this.valueOf()/1e3)},S.valueOf=function(){return this.$d.getTime()},S.startOf=function(P,I){var B=this,$=!!O.u(I)||I,R=O.p(P),D=function(ae,he){var ie=O.w(B.$u?Date.UTC(B.$y,he,ae):new Date(B.$y,he,ae),B);return $?ie:ie.endOf(u)},L=function(ae,he){return O.w(B.toDate()[ae].apply(B.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(he)),B)},U=this.$W,z=this.$M,W=this.$D,K="set"+(this.$u?"UTC":"");switch(R){case f:return $?D(1,0):D(31,11);case d:return $?D(1,z):D(0,z+1);case l:var J=this.$locale().weekStart||0,ne=(U<J?U+7:U)-J;return D($?W-ne:W+(6-ne),z);case u:case g:return L(K+"Hours",0);case c:return L(K+"Minutes",1);case a:return L(K+"Seconds",2);case o:return L(K+"Milliseconds",3);default:return this.clone()}},S.endOf=function(P){return this.startOf(P,!1)},S.$set=function(P,I){var B,$=O.p(P),R="set"+(this.$u?"UTC":""),D=(B={},B[u]=R+"Date",B[g]=R+"Date",B[d]=R+"Month",B[f]=R+"FullYear",B[c]=R+"Hours",B[a]=R+"Minutes",B[o]=R+"Seconds",B[s]=R+"Milliseconds",B)[$],L=$===u?this.$D+(I-this.$W):I;if($===d||$===f){var U=this.clone().set(g,1);U.$d[D](L),U.init(),this.$d=U.set(g,Math.min(this.$D,U.daysInMonth())).$d}else D&&this.$d[D](L);return this.init(),this},S.set=function(P,I){return this.clone().$set(P,I)},S.get=function(P){return this[O.p(P)]()},S.add=function(P,I){var B,$=this;P=Number(P);var R=O.p(I),D=function(z){var W=T($);return O.w(W.date(W.date()+Math.round(z*P)),$)};if(R===d)return this.set(d,this.$M+P);if(R===f)return this.set(f,this.$y+P);if(R===u)return D(1);if(R===l)return D(7);var L=(B={},B[a]=n,B[c]=i,B[o]=r,B)[R]||1,U=this.$d.getTime()+P*L;return O.w(U,this)},S.subtract=function(P,I){return this.add(-1*P,I)},S.format=function(P){var I=this,B=this.$locale();if(!this.isValid())return B.invalidDate||p;var $=P||"YYYY-MM-DDTHH:mm:ssZ",R=O.z(this),D=this.$H,L=this.$m,U=this.$M,z=B.weekdays,W=B.months,K=B.meridiem,J=function(he,ie,Ee,pe){return he&&(he[ie]||he(I,$))||Ee[ie].slice(0,pe)},ne=function(he){return O.s(D%12||12,he,"0")},ae=K||function(he,ie,Ee){var pe=he<12?"AM":"PM";return Ee?pe.toLowerCase():pe};return $.replace(b,function(he,ie){return ie||function(Ee){switch(Ee){case"YY":return String(I.$y).slice(-2);case"YYYY":return O.s(I.$y,4,"0");case"M":return U+1;case"MM":return O.s(U+1,2,"0");case"MMM":return J(B.monthsShort,U,W,3);case"MMMM":return J(W,U);case"D":return I.$D;case"DD":return O.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return J(B.weekdaysMin,I.$W,z,2);case"ddd":return J(B.weekdaysShort,I.$W,z,3);case"dddd":return z[I.$W];case"H":return String(D);case"HH":return O.s(D,2,"0");case"h":return ne(1);case"hh":return ne(2);case"a":return ae(D,L,!0);case"A":return ae(D,L,!1);case"m":return String(L);case"mm":return O.s(L,2,"0");case"s":return String(I.$s);case"ss":return O.s(I.$s,2,"0");case"SSS":return O.s(I.$ms,3,"0");case"Z":return R}return null}(he)||R.replace(":","")})},S.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},S.diff=function(P,I,B){var $,R=this,D=O.p(I),L=T(P),U=(L.utcOffset()-this.utcOffset())*n,z=this-L,W=function(){return O.m(R,L)};switch(D){case f:$=W()/12;break;case d:$=W();break;case h:$=W()/3;break;case l:$=(z-U)/6048e5;break;case u:$=(z-U)/864e5;break;case c:$=z/i;break;case a:$=z/n;break;case o:$=z/r;break;default:$=z}return B?$:O.a($)},S.daysInMonth=function(){return this.endOf(d).$D},S.$locale=function(){return y[this.$L]},S.locale=function(P,I){if(!P)return this.$L;var B=this.clone(),$=A(P,I,!0);return $&&(B.$L=$),B},S.clone=function(){return O.w(this.$d,this)},S.toDate=function(){return new Date(this.valueOf())},S.toJSON=function(){return this.isValid()?this.toISOString():null},S.toISOString=function(){return this.$d.toISOString()},S.toString=function(){return this.$d.toUTCString()},N}(),j=k.prototype;return T.prototype=j,[["$ms",s],["$s",o],["$m",a],["$H",c],["$W",u],["$M",d],["$y",f],["$D",g]].forEach(function(N){j[N[1]]=function(S){return this.$g(S,N[0],N[1])}}),T.extend=function(N,S){return N.$i||(N(S,k,T),N.$i=!0),T},T.locale=A,T.isDayjs=x,T.unix=function(N){return T(1e3*N)},T.en=y[C],T.Ls=y,T.p={},T})}(F4)),F4.exports}var rne=tne();const ng=cc(rne);var H4={exports:{}},nne=H4.exports,WR;function ine(){return WR||(WR=1,function(t,e){(function(r,n){t.exports=n()})(nne,function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var n=["th","st","nd","rd"],i=r%100;return"["+r+(n[(i-20)%10]||n[i]||n[0])+"]"}}})}(H4)),H4.exports}var sne=ine();const one=cc(sne);var q4={exports:{}},ane=q4.exports,VR;function cne(){return VR||(VR=1,function(t,e){(function(r,n){t.exports=n()})(ane,function(){return function(r,n,i){r=r||{};var s=n.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(u,l,d,h){return s.fromToBase(u,l,d,h)}i.en.relativeTime=o,s.fromToBase=function(u,l,d,h,f){for(var g,p,m,b=d.$locale().relativeTime||o,v=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],E=v.length,w=0;w<E;w+=1){var C=v[w];C.d&&(g=h?i(u).diff(d,C.d,!0):d.diff(u,C.d,!0));var y=(r.rounding||Math.round)(Math.abs(g));if(m=g>0,y<=C.r||!C.r){y<=1&&w>0&&(C=v[w-1]);var _=b[C.l];f&&(y=f(""+y)),p=typeof _=="string"?_.replace("%d",y):_(y,l,C.l,m);break}}if(l)return p;var x=m?b.future:b.past;return typeof x=="function"?x(p):x.replace("%s",p)},s.to=function(u,l){return a(u,l,this,!0)},s.from=function(u,l){return a(u,l,this)};var c=function(u){return u.$u?i.utc():i()};s.toNow=function(u){return this.to(c(this),u)},s.fromNow=function(u){return this.from(c(this),u)}}})}(q4)),q4.exports}var une=cne();const lne=cc(une);var z4={exports:{}},dne=z4.exports,GR;function hne(){return GR||(GR=1,function(t,e){(function(r,n){t.exports=n()})(dne,function(){return function(r,n,i){i.updateLocale=function(s,o){var a=i.Ls[s];if(a)return(o?Object.keys(o):[]).forEach(function(c){a[c]=o[c]}),a}}})}(z4)),z4.exports}var fne=hne();const pne=cc(fne);ng.extend(lne);ng.extend(pne);const gne={...one,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}},mne=["January","February","March","April","May","June","July","August","September","October","November","December"];ng.locale("en-web3-modal",gne);const bC={getMonthNameByIndex(t){return mne[t]},getYear(t=new Date().toISOString()){return ng(t).year()},getRelativeDateFromNow(t){return ng(t).locale("en-web3-modal").fromNow(!0)},formatDate(t,e="DD MMM"){return ng(t).format(e)}};var KR={};const _e={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CONNECTOR_ID:{WALLET_CONNECT:"walletConnect",INJECTED:"injected",WALLET_STANDARD:"announced",COINBASE:"coinbaseWallet",COINBASE_SDK:"coinbaseWalletSDK",SAFE:"safe",LEDGER:"ledger",OKX:"okx",EIP6963:"eip6963",AUTH:"ID_AUTH"},CONNECTOR_NAMES:{AUTH:"Auth"},AUTH_CONNECTOR_SUPPORTED_CHAINS:["eip155","solana"],LIMITS:{PENDING_TRANSACTIONS:99},CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot",BITCOIN:"bip122"},CHAIN_NAME_MAP:{eip155:"EVM Networks",solana:"Solana",polkadot:"Polkadot",bip122:"Bitcoin",cosmos:"Cosmos"},ADAPTER_TYPES:{BITCOIN:"bitcoin",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5"},USDT_CONTRACT_ADDRESSES:["0xdac17f958d2ee523a2206206994597c13d831ec7","0xc2132d05d31c914a87c6611c10748aeb04b58e8f","0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7","0x919C1c267BC06a7039e03fcc2eF738525769109c","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e","0x55d398326f99059fF775485246999027B3197955","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"],HTTP_STATUS_CODES:{SERVICE_UNAVAILABLE:503,FORBIDDEN:403},UNSUPPORTED_NETWORK_NAME:"Unknown Network",SECURE_SITE_SDK_ORIGIN:(typeof process<"u"&&typeof KR<"u"?KR.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org"},AV={caipNetworkIdToNumber(t){return t?Number(t.split(":")[1]):void 0},parseEvmChainId(t){return typeof t=="string"?this.caipNetworkIdToNumber(t):t},getNetworksByNamespace(t,e){return(t==null?void 0:t.filter(r=>r.chainNamespace===e))||[]},getFirstNetworkByNamespace(t,e){return this.getNetworksByNamespace(t,e)[0]},getNetworkNameByCaipNetworkId(t,e){var i;if(!e)return;const r=t.find(s=>s.caipNetworkId===e);if(r)return r.name;const[n]=e.split(":");return((i=_e.CHAIN_NAME_MAP)==null?void 0:i[n])||void 0}};var wne=20,bne=1,$f=1e6,ZR=1e6,yne=-7,vne=21,_ne=!1,Cv="[big.js] ",mp=Cv+"Invalid ",F6=mp+"decimal places",Ene=mp+"rounding mode",xV=Cv+"Division by zero",tr={},Va=void 0,Cne=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function SV(){function t(e){var r=this;if(!(r instanceof t))return e===Va?SV():new t(e);if(e instanceof t)r.s=e.s,r.e=e.e,r.c=e.c.slice();else{if(typeof e!="string"){if(t.strict===!0&&typeof e!="bigint")throw TypeError(mp+"value");e=e===0&&1/e<0?"-0":String(e)}Ane(r,e)}r.constructor=t}return t.prototype=tr,t.DP=wne,t.RM=bne,t.NE=yne,t.PE=vne,t.strict=_ne,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function Ane(t,e){var r,n,i;if(!Cne.test(e))throw Error(mp+"number");for(t.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),i=e.length,n=0;n<i&&e.charAt(n)=="0";)++n;if(n==i)t.c=[t.e=0];else{for(;i>0&&e.charAt(--i)=="0";);for(t.e=r-n-1,t.c=[],r=0;n<=i;)t.c[r++]=+e.charAt(n++)}return t}function wp(t,e,r,n){var i=t.c;if(r===Va&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(Ene);if(e<1)n=r===3&&(n||!!i[0])||e===0&&(r===1&&i[0]>=5||r===2&&(i[0]>5||i[0]===5&&(n||i[1]!==Va))),i.length=1,n?(t.e=t.e-e+1,i[0]=1):i[0]=t.e=0;else if(e<i.length){if(n=r===1&&i[e]>=5||r===2&&(i[e]>5||i[e]===5&&(n||i[e+1]!==Va||i[e-1]&1))||r===3&&(n||!!i[0]),i.length=e,n){for(;++i[--e]>9;)if(i[e]=0,e===0){++t.e,i.unshift(1);break}}for(e=i.length;!i[--e];)i.pop()}return t}function bp(t,e,r){var n=t.e,i=t.c.join(""),s=i.length;if(e)i=i.charAt(0)+(s>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>s)for(n-=s;n--;)i+="0";else n<s&&(i=i.slice(0,n)+"."+i.slice(n));else s>1&&(i=i.charAt(0)+"."+i.slice(1));return t.s<0&&r?"-"+i:i}tr.abs=function(){var t=new this.constructor(this);return t.s=1,t};tr.cmp=function(t){var e,r=this,n=r.c,i=(t=new r.constructor(t)).c,s=r.s,o=t.s,a=r.e,c=t.e;if(!n[0]||!i[0])return n[0]?s:i[0]?-o:0;if(s!=o)return s;if(e=s<0,a!=c)return a>c^e?1:-1;for(o=(a=n.length)<(c=i.length)?a:c,s=-1;++s<o;)if(n[s]!=i[s])return n[s]>i[s]^e?1:-1;return a==c?0:a>c^e?1:-1};tr.div=function(t){var e=this,r=e.constructor,n=e.c,i=(t=new r(t)).c,s=e.s==t.s?1:-1,o=r.DP;if(o!==~~o||o<0||o>$f)throw Error(F6);if(!i[0])throw Error(xV);if(!n[0])return t.s=s,t.c=[t.e=0],t;var a,c,u,l,d,h=i.slice(),f=a=i.length,g=n.length,p=n.slice(0,a),m=p.length,b=t,v=b.c=[],E=0,w=o+(b.e=e.e-t.e)+1;for(b.s=s,s=w<0?0:w,h.unshift(0);m++<a;)p.push(0);do{for(u=0;u<10;u++){if(a!=(m=p.length))l=a>m?1:-1;else for(d=-1,l=0;++d<a;)if(i[d]!=p[d]){l=i[d]>p[d]?1:-1;break}if(l<0){for(c=m==a?i:h;m;){if(p[--m]<c[m]){for(d=m;d&&!p[--d];)p[d]=9;--p[d],p[m]+=10}p[m]-=c[m]}for(;!p[0];)p.shift()}else break}v[E++]=l?u:++u,p[0]&&l?p[m]=n[f]||0:p=[n[f]]}while((f++<g||p[0]!==Va)&&s--);return!v[0]&&E!=1&&(v.shift(),b.e--,w--),E>w&&wp(b,w,r.RM,p[0]!==Va),b};tr.eq=function(t){return this.cmp(t)===0};tr.gt=function(t){return this.cmp(t)>0};tr.gte=function(t){return this.cmp(t)>-1};tr.lt=function(t){return this.cmp(t)<0};tr.lte=function(t){return this.cmp(t)<1};tr.minus=tr.sub=function(t){var e,r,n,i,s=this,o=s.constructor,a=s.s,c=(t=new o(t)).s;if(a!=c)return t.s=-c,s.plus(t);var u=s.c.slice(),l=s.e,d=t.c,h=t.e;if(!u[0]||!d[0])return d[0]?t.s=-c:u[0]?t=new o(s):t.s=1,t;if(a=l-h){for((i=a<0)?(a=-a,n=u):(h=l,n=d),n.reverse(),c=a;c--;)n.push(0);n.reverse()}else for(r=((i=u.length<d.length)?u:d).length,a=c=0;c<r;c++)if(u[c]!=d[c]){i=u[c]<d[c];break}if(i&&(n=u,u=d,d=n,t.s=-t.s),(c=(r=d.length)-(e=u.length))>0)for(;c--;)u[e++]=0;for(c=e;r>a;){if(u[--r]<d[r]){for(e=r;e&&!u[--e];)u[e]=9;--u[e],u[r]+=10}u[r]-=d[r]}for(;u[--c]===0;)u.pop();for(;u[0]===0;)u.shift(),--h;return u[0]||(t.s=1,u=[h=0]),t.c=u,t.e=h,t};tr.mod=function(t){var e,r=this,n=r.constructor,i=r.s,s=(t=new n(t)).s;if(!t.c[0])throw Error(xV);return r.s=t.s=1,e=t.cmp(r)==1,r.s=i,t.s=s,e?new n(r):(i=n.DP,s=n.RM,n.DP=n.RM=0,r=r.div(t),n.DP=i,n.RM=s,this.minus(r.times(t)))};tr.neg=function(){var t=new this.constructor(this);return t.s=-t.s,t};tr.plus=tr.add=function(t){var e,r,n,i=this,s=i.constructor;if(t=new s(t),i.s!=t.s)return t.s=-t.s,i.minus(t);var o=i.e,a=i.c,c=t.e,u=t.c;if(!a[0]||!u[0])return u[0]||(a[0]?t=new s(i):t.s=i.s),t;if(a=a.slice(),e=o-c){for(e>0?(c=o,n=u):(e=-e,n=a),n.reverse();e--;)n.push(0);n.reverse()}for(a.length-u.length<0&&(n=u,u=a,a=n),e=u.length,r=0;e;a[e]%=10)r=(a[--e]=a[e]+u[e]+r)/10|0;for(r&&(a.unshift(r),++c),e=a.length;a[--e]===0;)a.pop();return t.c=a,t.e=c,t};tr.pow=function(t){var e=this,r=new e.constructor("1"),n=r,i=t<0;if(t!==~~t||t<-ZR||t>ZR)throw Error(mp+"exponent");for(i&&(t=-t);t&1&&(n=n.times(e)),t>>=1,!!t;)e=e.times(e);return i?r.div(n):n};tr.prec=function(t,e){if(t!==~~t||t<1||t>$f)throw Error(mp+"precision");return wp(new this.constructor(this),t,e)};tr.round=function(t,e){if(t===Va)t=0;else if(t!==~~t||t<-$f||t>$f)throw Error(F6);return wp(new this.constructor(this),t+this.e+1,e)};tr.sqrt=function(){var t,e,r,n=this,i=n.constructor,s=n.s,o=n.e,a=new i("0.5");if(!n.c[0])return new i(n);if(s<0)throw Error(Cv+"No square root");s=Math.sqrt(+bp(n,!0,!0)),s===0||s===1/0?(e=n.c.join(""),e.length+o&1||(e+="0"),s=Math.sqrt(e),o=((o+1)/2|0)-(o<0||o&1),t=new i((s==1/0?"5e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+o)):t=new i(s+""),o=t.e+(i.DP+=4);do r=t,t=a.times(r.plus(n.div(r)));while(r.c.slice(0,o).join("")!==t.c.slice(0,o).join(""));return wp(t,(i.DP-=4)+t.e+1,i.RM)};tr.times=tr.mul=function(t){var e,r=this,n=r.constructor,i=r.c,s=(t=new n(t)).c,o=i.length,a=s.length,c=r.e,u=t.e;if(t.s=r.s==t.s?1:-1,!i[0]||!s[0])return t.c=[t.e=0],t;for(t.e=c+u,o<a&&(e=i,i=s,s=e,u=o,o=a,a=u),e=new Array(u=o+a);u--;)e[u]=0;for(c=a;c--;){for(a=0,u=o+c;u>c;)a=e[u]+s[c]*i[u-c-1]+a,e[u--]=a%10,a=a/10|0;e[u]=a}for(a?++t.e:e.shift(),c=e.length;!e[--c];)e.pop();return t.c=e,t};tr.toExponential=function(t,e){var r=this,n=r.c[0];if(t!==Va){if(t!==~~t||t<0||t>$f)throw Error(F6);for(r=wp(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return bp(r,!0,!!n)};tr.toFixed=function(t,e){var r=this,n=r.c[0];if(t!==Va){if(t!==~~t||t<0||t>$f)throw Error(F6);for(r=wp(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length<t;)r.c.push(0)}return bp(r,!1,!!n)};tr[Symbol.for("nodejs.util.inspect.custom")]=tr.toJSON=tr.toString=function(){var t=this,e=t.constructor;return bp(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])};tr.toNumber=function(){var t=+bp(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(Cv+"Imprecise conversion");return t};tr.toPrecision=function(t,e){var r=this,n=r.constructor,i=r.c[0];if(t!==Va){if(t!==~~t||t<1||t>$f)throw Error(mp+"precision");for(r=wp(new n(r),t,e);r.c.length<t;)r.c.push(0)}return bp(r,t<=r.e||r.e<=n.NE||r.e>=n.PE,!!i)};tr.valueOf=function(){var t=this,e=t.constructor;if(e.strict===!0)throw Error(Cv+"valueOf disallowed");return bp(t,t.e<=e.NE||t.e>=e.PE,!0)};var k1=SV();const Dt={bigNumber(t){return t?new k1(t):new k1(0)},multiply(t,e){if(t===void 0||e===void 0)return new k1(0);const r=new k1(t),n=new k1(e);return r.times(n)},formatNumberToLocalString(t,e=2){return t===void 0?"0.00":typeof t=="number"?t.toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e}):parseFloat(t).toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e})},parseLocalStringToNumber(t){return t===void 0?0:parseFloat(t.replace(/,/gu,""))}},xne={numericInputKeyDown(t,e,r){const n=["Backspace","Meta","Ctrl","a","A","c","C","x","X","v","V","ArrowLeft","ArrowRight","Tab"],i=t.metaKey||t.ctrlKey,s=t.key,o=s.toLocaleLowerCase(),a=o==="a",c=o==="c",u=o==="v",l=o==="x",d=s===",",h=s===".",f=s>="0"&&s<="9";!i&&(a||c||u||l)&&t.preventDefault(),e==="0"&&!d&&!h&&s==="0"&&t.preventDefault(),e==="0"&&f&&(r(s),t.preventDefault()),(d||h)&&(e||(r("0."),t.preventDefault()),(e!=null&&e.includes(".")||e!=null&&e.includes(","))&&t.preventDefault()),!f&&!n.includes(s)&&!h&&!d&&t.preventDefault()}},Sne=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],Tne=[{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],Ine=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],TV={getERC20Abi:t=>_e.USDT_CONTRACT_ADDRESSES.includes(t)?Ine:Sne,getSwapAbi:()=>Tne},IV={URLS:{FAQ:"https://walletconnect.com/faq"}},bs={validateCaipAddress(t){var e;if(((e=t.split(":"))==null?void 0:e.length)!==3)throw new Error("Invalid CAIP Address");return t},parseCaipAddress(t){const e=t.split(":");if(e.length!==3)throw new Error(`Invalid CAIP-10 address: ${t}`);const[r,n,i]=e;if(!r||!n||!i)throw new Error(`Invalid CAIP-10 address: ${t}`);return{chainNamespace:r,chainId:n,address:i}},parseCaipNetworkId(t){const e=t.split(":");if(e.length!==2)throw new Error(`Invalid CAIP-2 network id: ${t}`);const[r,n]=e;if(!r||!n)throw new Error(`Invalid CAIP-2 network id: ${t}`);return{chainNamespace:r,chainId:n}}},mt={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit-wallet/SOCIAL_USERNAME",RECENT_WALLETS:"@appkit/recent_wallets",DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",ACTIVE_NAMESPACE:"@appkit/active_namespace",CONNECTED_NAMESPACES:"@appkit/connected_namespaces",CONNECTION_STATUS:"@appkit/connection_status",SIWX_AUTH_TOKEN:"@appkit/siwx-auth-token",SIWX_NONCE_TOKEN:"@appkit/siwx-nonce-token",TELEGRAM_SOCIAL_PROVIDER:"@appkit/social_provider",NATIVE_BALANCE_CACHE:"@appkit/native_balance_cache",PORTFOLIO_CACHE:"@appkit/portfolio_cache",ENS_CACHE:"@appkit/ens_cache",IDENTITY_CACHE:"@appkit/identity_cache",PREFERRED_ACCOUNT_TYPES:"@appkit/preferred_account_types",CONNECTIONS:"@appkit/connections"};function n8(t){if(!t)throw new Error("Namespace is required for CONNECTED_CONNECTOR_ID");return`@appkit/${t}:connected_connector_id`}const dt={setItem(t,e){tb()&&e!==void 0&&localStorage.setItem(t,e)},getItem(t){if(tb())return localStorage.getItem(t)||void 0},removeItem(t){tb()&&localStorage.removeItem(t)},clear(){tb()&&localStorage.clear()}};function tb(){return typeof window<"u"&&typeof localStorage<"u"}function za(t,e){return e==="light"?{"--w3m-accent":(t==null?void 0:t["--w3m-accent"])||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":(t==null?void 0:t["--w3m-accent"])||"hsla(230, 100%, 67%, 1)","--w3m-background":"#121313"}}var YR={};const i8=(typeof process<"u"&&typeof YR<"u"?YR.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",PV=[{label:"Coinbase",name:"coinbase",feeRange:"1-2%",url:"",supportedChains:["eip155"]},{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],Pne="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",ct={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,FIVE_SEC_MS:5e3,THREE_SEC_MS:3e3,ONE_SEC_MS:1e3,SECURE_SITE:i8,SECURE_SITE_DASHBOARD:`${i8}/dashboard`,SECURE_SITE_FAVICON:`${i8}/images/favicon.png`,RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],WC_COINBASE_PAY_SDK_CHAINS:["ethereum","arbitrum","polygon","berachain","avalanche-c-chain","optimism","celo","base"],WC_COINBASE_PAY_SDK_FALLBACK_CHAIN:"ethereum",WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP:{Ethereum:"ethereum","Arbitrum One":"arbitrum",Polygon:"polygon",Berachain:"berachain",Avalanche:"avalanche-c-chain","OP Mainnet":"optimism",Celo:"celo",Base:"base"},WC_COINBASE_ONRAMP_APP_ID:"bf18c88d-495a-463b-b249-0b9d3656cf5e",SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],BALANCE_SUPPORTED_CHAINS:["eip155","solana"],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:56","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NAMES_SUPPORTED_CHAIN_NAMESPACES:["eip155"],ONRAMP_SUPPORTED_CHAIN_NAMESPACES:["eip155","solana"],ACTIVITY_ENABLED_CHAIN_NAMESPACES:["eip155"],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x",bip122:"0x",cosmos:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,CONNECT_LABELS:{MOBILE:"Open and continue in the wallet app",WEB:"Open and continue in the wallet app"},SEND_SUPPORTED_NAMESPACES:["eip155","solana"],DEFAULT_REMOTE_FEATURES:{swaps:["1inch"],onramp:["coinbase","meld"],email:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],activity:!0,reownBranding:!0},DEFAULT_REMOTE_FEATURES_DISABLED:{email:!1,socials:!1,swaps:!1,onramp:!1,activity:!1,reownBranding:!1},DEFAULT_FEATURES:{receive:!0,send:!0,emailShowWallets:!0,connectorTypeOrder:["walletConnect","recent","injected","featured","custom","external","recommended"],analytics:!0,allWallets:!0,legalCheckbox:!1,smartSessions:!1,collapseWallets:!1,walletFeaturesOrder:["onramp","swaps","receive","send"],connectMethodsOrder:void 0,pay:!1},DEFAULT_SOCIALS:["google","x","farcaster","discord","apple","github","facebook"],DEFAULT_ACCOUNT_TYPES:{bip122:"payment",eip155:"smartAccount",polkadot:"eoa",solana:"eoa"},ADAPTER_TYPES:{UNIVERSAL:"universal",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5",BITCOIN:"bitcoin"}},Le={cacheExpiry:{portfolio:3e4,nativeBalance:3e4,ens:3e5,identity:3e5},isCacheExpired(t,e){return Date.now()-t>e},getActiveNetworkProps(){const t=Le.getActiveNamespace(),e=Le.getActiveCaipNetworkId(),r=e?e.split(":")[1]:void 0,n=r?isNaN(Number(r))?r:Number(r):void 0;return{namespace:t,caipNetworkId:e,chainId:n}},setWalletConnectDeepLink({name:t,href:e}){try{dt.setItem(mt.DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{const t=dt.getItem(mt.DEEPLINK_CHOICE);if(t)return JSON.parse(t)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{dt.removeItem(mt.DEEPLINK_CHOICE)}catch{console.info("Unable to delete WalletConnect deep link")}},setActiveNamespace(t){try{dt.setItem(mt.ACTIVE_NAMESPACE,t)}catch{console.info("Unable to set active namespace")}},setActiveCaipNetworkId(t){try{dt.setItem(mt.ACTIVE_CAIP_NETWORK_ID,t),Le.setActiveNamespace(t.split(":")[0])}catch{console.info("Unable to set active caip network id")}},getActiveCaipNetworkId(){try{return dt.getItem(mt.ACTIVE_CAIP_NETWORK_ID)}catch{console.info("Unable to get active caip network id");return}},deleteActiveCaipNetworkId(){try{dt.removeItem(mt.ACTIVE_CAIP_NETWORK_ID)}catch{console.info("Unable to delete active caip network id")}},deleteConnectedConnectorId(t){try{const e=n8(t);dt.removeItem(e)}catch{console.info("Unable to delete connected connector id")}},setAppKitRecent(t){try{const e=Le.getRecentWallets();e.find(n=>n.id===t.id)||(e.unshift(t),e.length>2&&e.pop(),dt.setItem(mt.RECENT_WALLETS,JSON.stringify(e)))}catch{console.info("Unable to set AppKit recent")}},getRecentWallets(){try{const t=dt.getItem(mt.RECENT_WALLETS);return t?JSON.parse(t):[]}catch{console.info("Unable to get AppKit recent")}return[]},setConnectedConnectorId(t,e){try{const r=n8(t);dt.setItem(r,e)}catch{console.info("Unable to set Connected Connector Id")}},getActiveNamespace(){try{return dt.getItem(mt.ACTIVE_NAMESPACE)}catch{console.info("Unable to get active namespace")}},getConnectedConnectorId(t){if(t)try{const e=n8(t);return dt.getItem(e)}catch{console.info("Unable to get connected connector id in namespace ",t)}},setConnectedSocialProvider(t){try{dt.setItem(mt.CONNECTED_SOCIAL,t)}catch{console.info("Unable to set connected social provider")}},getConnectedSocialProvider(){try{return dt.getItem(mt.CONNECTED_SOCIAL)}catch{console.info("Unable to get connected social provider")}},deleteConnectedSocialProvider(){try{dt.removeItem(mt.CONNECTED_SOCIAL)}catch{console.info("Unable to delete connected social provider")}},getConnectedSocialUsername(){try{return dt.getItem(mt.CONNECTED_SOCIAL_USERNAME)}catch{console.info("Unable to get connected social username")}},getStoredActiveCaipNetworkId(){var r;const t=dt.getItem(mt.ACTIVE_CAIP_NETWORK_ID);return(r=t==null?void 0:t.split(":"))==null?void 0:r[1]},setConnectionStatus(t){try{dt.setItem(mt.CONNECTION_STATUS,t)}catch{console.info("Unable to set connection status")}},getConnectionStatus(){try{return dt.getItem(mt.CONNECTION_STATUS)}catch{return}},getConnectedNamespaces(){try{const t=dt.getItem(mt.CONNECTED_NAMESPACES);return t!=null&&t.length?t.split(","):[]}catch{return[]}},setConnectedNamespaces(t){try{const e=Array.from(new Set(t));dt.setItem(mt.CONNECTED_NAMESPACES,e.join(","))}catch{console.info("Unable to set namespaces in storage")}},addConnectedNamespace(t){try{const e=Le.getConnectedNamespaces();e.includes(t)||(e.push(t),Le.setConnectedNamespaces(e))}catch{console.info("Unable to add connected namespace")}},removeConnectedNamespace(t){try{const e=Le.getConnectedNamespaces(),r=e.indexOf(t);r>-1&&(e.splice(r,1),Le.setConnectedNamespaces(e))}catch{console.info("Unable to remove connected namespace")}},getTelegramSocialProvider(){try{return dt.getItem(mt.TELEGRAM_SOCIAL_PROVIDER)}catch{return console.info("Unable to get telegram social provider"),null}},setTelegramSocialProvider(t){try{dt.setItem(mt.TELEGRAM_SOCIAL_PROVIDER,t)}catch{console.info("Unable to set telegram social provider")}},removeTelegramSocialProvider(){try{dt.removeItem(mt.TELEGRAM_SOCIAL_PROVIDER)}catch{console.info("Unable to remove telegram social provider")}},getBalanceCache(){let t={};try{const e=dt.getItem(mt.PORTFOLIO_CACHE);t=e?JSON.parse(e):{}}catch{console.info("Unable to get balance cache")}return t},removeAddressFromBalanceCache(t){try{const e=Le.getBalanceCache();dt.setItem(mt.PORTFOLIO_CACHE,JSON.stringify({...e,[t]:void 0}))}catch{console.info("Unable to remove address from balance cache",t)}},getBalanceCacheForCaipAddress(t){try{const r=Le.getBalanceCache()[t];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.portfolio))return r.balance;Le.removeAddressFromBalanceCache(t)}catch{console.info("Unable to get balance cache for address",t)}},updateBalanceCache(t){try{const e=Le.getBalanceCache();e[t.caipAddress]=t,dt.setItem(mt.PORTFOLIO_CACHE,JSON.stringify(e))}catch{console.info("Unable to update balance cache",t)}},getNativeBalanceCache(){let t={};try{const e=dt.getItem(mt.NATIVE_BALANCE_CACHE);t=e?JSON.parse(e):{}}catch{console.info("Unable to get balance cache")}return t},removeAddressFromNativeBalanceCache(t){try{const e=Le.getBalanceCache();dt.setItem(mt.NATIVE_BALANCE_CACHE,JSON.stringify({...e,[t]:void 0}))}catch{console.info("Unable to remove address from balance cache",t)}},getNativeBalanceCacheForCaipAddress(t){try{const r=Le.getNativeBalanceCache()[t];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.nativeBalance))return r;console.info("Discarding cache for address",t),Le.removeAddressFromBalanceCache(t)}catch{console.info("Unable to get balance cache for address",t)}},updateNativeBalanceCache(t){try{const e=Le.getNativeBalanceCache();e[t.caipAddress]=t,dt.setItem(mt.NATIVE_BALANCE_CACHE,JSON.stringify(e))}catch{console.info("Unable to update balance cache",t)}},getEnsCache(){let t={};try{const e=dt.getItem(mt.ENS_CACHE);t=e?JSON.parse(e):{}}catch{console.info("Unable to get ens name cache")}return t},getEnsFromCacheForAddress(t){try{const r=Le.getEnsCache()[t];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.ens))return r.ens;Le.removeEnsFromCache(t)}catch{console.info("Unable to get ens name from cache",t)}},updateEnsCache(t){try{const e=Le.getEnsCache();e[t.address]=t,dt.setItem(mt.ENS_CACHE,JSON.stringify(e))}catch{console.info("Unable to update ens name cache",t)}},removeEnsFromCache(t){try{const e=Le.getEnsCache();dt.setItem(mt.ENS_CACHE,JSON.stringify({...e,[t]:void 0}))}catch{console.info("Unable to remove ens name from cache",t)}},getIdentityCache(){let t={};try{const e=dt.getItem(mt.IDENTITY_CACHE);t=e?JSON.parse(e):{}}catch{console.info("Unable to get identity cache")}return t},getIdentityFromCacheForAddress(t){try{const r=Le.getIdentityCache()[t];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.identity))return r.identity;Le.removeIdentityFromCache(t)}catch{console.info("Unable to get identity from cache",t)}},updateIdentityCache(t){try{const e=Le.getIdentityCache();e[t.address]={identity:t.identity,timestamp:t.timestamp},dt.setItem(mt.IDENTITY_CACHE,JSON.stringify(e))}catch{console.info("Unable to update identity cache",t)}},removeIdentityFromCache(t){try{const e=Le.getIdentityCache();dt.setItem(mt.IDENTITY_CACHE,JSON.stringify({...e,[t]:void 0}))}catch{console.info("Unable to remove identity from cache",t)}},clearAddressCache(){try{dt.removeItem(mt.PORTFOLIO_CACHE),dt.removeItem(mt.NATIVE_BALANCE_CACHE),dt.removeItem(mt.ENS_CACHE),dt.removeItem(mt.IDENTITY_CACHE)}catch{console.info("Unable to clear address cache")}},setPreferredAccountTypes(t){try{dt.setItem(mt.PREFERRED_ACCOUNT_TYPES,JSON.stringify(t))}catch{console.info("Unable to set preferred account types",t)}},getPreferredAccountTypes(){try{const t=dt.getItem(mt.PREFERRED_ACCOUNT_TYPES);return t?JSON.parse(t):{}}catch{console.info("Unable to get preferred account types")}return{}},setConnections(t,e){try{const r={...Le.getConnections(),[e]:t};dt.setItem(mt.CONNECTIONS,JSON.stringify(r))}catch(r){console.error("Unable to sync connections to storage",r)}},getConnections(){try{const t=dt.getItem(mt.CONNECTIONS);return t?JSON.parse(t):{}}catch(t){return console.error("Unable to get connections from storage",t),{}}}},ue={isMobile(){var t;return this.isClient()?!!(typeof(window==null?void 0:window.matchMedia)=="function"&&((t=window==null?void 0:window.matchMedia("(pointer:coarse)"))!=null&&t.matches)||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(t,e=""){return t==null?void 0:t.caipNetworkId.toLocaleLowerCase().includes(e.toLowerCase())},isAndroid(){if(!this.isMobile())return!1;const t=window==null?void 0:window.navigator.userAgent.toLowerCase();return ue.isMobile()&&t.includes("android")},isIos(){if(!this.isMobile())return!1;const t=window==null?void 0:window.navigator.userAgent.toLowerCase();return t.includes("iphone")||t.includes("ipad")},isSafari(){return this.isClient()?(window==null?void 0:window.navigator.userAgent.toLowerCase()).includes("safari"):!1},isClient(){return typeof window<"u"},isPairingExpired(t){return t?t-Date.now()<=ct.TEN_SEC_MS:!0},isAllowedRetry(t,e=ct.ONE_SEC_MS){return Date.now()-t>=e},copyToClopboard(t){navigator.clipboard.writeText(t)},isIframe(){try{return(window==null?void 0:window.self)!==(window==null?void 0:window.top)}catch{return!1}},isSafeApp(){var t,e;if(ue.isClient()&&window.self!==window.top)try{const r=(e=(t=window==null?void 0:window.location)==null?void 0:t.ancestorOrigins)==null?void 0:e[0],n="https://app.safe.global";if(r){const i=new URL(r),s=new URL(n);return i.hostname===s.hostname}}catch{return!1}return!1},getPairingExpiry(){return Date.now()+ct.FOUR_MINUTES_MS},getNetworkId(t){return t==null?void 0:t.split(":")[1]},getPlainAddress(t){return t==null?void 0:t.split(":")[2]},async wait(t){return new Promise(e=>{setTimeout(e,t)})},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e,r=null){if(ue.isHttpUrl(t))return this.formatUniversalUrl(t,e);let n=t,i=r;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),i&&!(i!=null&&i.endsWith("/"))&&(i=`${i}/`),this.isTelegram()&&this.isAndroid()&&(e=encodeURIComponent(e));const s=encodeURIComponent(e);return{redirect:`${n}wc?uri=${s}`,redirectUniversalLink:i?`${i}wc?uri=${s}`:void 0,href:n}},formatUniversalUrl(t,e){if(!ue.isHttpUrl(t))return this.formatNativeUrl(t,e);let r=t;r.endsWith("/")||(r=`${r}/`);const n=encodeURIComponent(e);return{redirect:`${r}wc?uri=${n}`,href:r}},getOpenTargetForPlatform(t){return t==="popupWindow"?t:this.isTelegram()?Le.getTelegramSocialProvider()?"_top":"_blank":t},openHref(t,e,r){window==null||window.open(t,this.getOpenTargetForPlatform(e),r||"noreferrer noopener")},returnOpenHref(t,e,r){return window==null?void 0:window.open(t,this.getOpenTargetForPlatform(e),r||"noreferrer noopener")},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},isPWA(){var r,n,i;if(typeof window>"u")return!1;const t=(n=(r=window.matchMedia)==null?void 0:r.call(window,"(display-mode: standalone)"))==null?void 0:n.matches,e=(i=window==null?void 0:window.navigator)==null?void 0:i.standalone;return!!(t||e)},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.crossOrigin="anonymous",i.src=t});return Promise.race([e,ue.wait(2e3)])},formatBalance(t,e){let r="0.000";if(typeof t=="string"){const n=Number(t);if(n){const i=Math.floor(n*1e3)/1e3;i&&(r=i.toString())}}return`${r}${e?` ${e}`:""}`},formatBalance2(t,e){var n;let r;if(t==="0")r="0";else if(typeof t=="string"){const i=Number(t);i&&(r=(n=i.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:n[0])}return{value:r??"0",rest:r==="0"?"000":"",symbol:e}},getApiUrl(){return _e.W3M_API_URL},getBlockchainApiUrl(){return _e.BLOCKCHAIN_API_RPC_URL},getAnalyticsUrl(){return _e.PULSE_API_URL},getUUID(){return crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})},parseError(t){var e,r;return typeof t=="string"?t:typeof((r=(e=t==null?void 0:t.issues)==null?void 0:e[0])==null?void 0:r.message)=="string"?t.issues[0].message:t instanceof Error?t.message:"Unknown error"},sortRequestedNetworks(t,e=[]){const r={};return e&&t&&(t.forEach((n,i)=>{r[n]=i}),e.sort((n,i)=>{const s=r[n.id],o=r[i.id];return s!==void 0&&o!==void 0?s-o:s!==void 0?-1:o!==void 0?1:0})),e},calculateBalance(t){let e=0;for(const r of t)e+=r.value??0;return e},formatTokenBalance(t){const e=t.toFixed(2),[r,n]=e.split(".");return{dollars:r,pennies:n}},isAddress(t,e="eip155"){switch(e){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)||/^(?:0x)?[0-9A-F]{40}$/iu.test(t))return!0}else return!1;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(t);default:return!1}},uniqueBy(t,e){const r=new Set;return t.filter(n=>{const i=n[e];return r.has(i)?!1:(r.add(i),!0)})},generateSdkVersion(t,e,r){const i=t.length===0?ct.ADAPTER_TYPES.UNIVERSAL:t.map(s=>s.adapterType).join(",");return`${e}-${i}-${r}`},createAccount(t,e,r,n,i){return{namespace:t,address:e,type:r,publicKey:n,path:i}},isCaipAddress(t){if(typeof t!="string")return!1;const e=t.split(":"),r=e[0];return e.filter(Boolean).length===3&&r in _e.CHAIN_NAME_MAP},isMac(){const t=window==null?void 0:window.navigator.userAgent.toLowerCase();return t.includes("macintosh")&&!t.includes("safari")},formatTelegramSocialLoginUrl(t){const e=`--${encodeURIComponent(window==null?void 0:window.location.href)}`,r="state=";if(new URL(t).host==="auth.magic.link"){const i="provider_authorization_url=",s=t.substring(t.indexOf(i)+i.length),o=this.injectIntoUrl(decodeURIComponent(s),r,e);return t.replace(s,encodeURIComponent(o))}return this.injectIntoUrl(t,r,e)},injectIntoUrl(t,e,r){const n=t.indexOf(e);if(n===-1)throw new Error(`${e} parameter not found in the URL: ${t}`);const i=t.indexOf("&",n),s=e.length,o=i!==-1?i:t.length,a=t.substring(0,n+s),c=t.substring(n+s,o),u=t.substring(i),l=c+r;return a+l+u}};async function N1(...t){const e=await fetch(...t);if(!e.ok)throw new Error(`HTTP status code: ${e.status}`,{cause:e});return e}class Av{constructor({baseUrl:e,clientId:r}){this.baseUrl=e,this.clientId=r}async get({headers:e,signal:r,cache:n,...i}){const s=this.createUrl(i);return(await N1(s,{method:"GET",headers:e,signal:r,cache:n})).json()}async getBlob({headers:e,signal:r,...n}){const i=this.createUrl(n);return(await N1(i,{method:"GET",headers:e,signal:r})).blob()}async post({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await N1(s,{method:"POST",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async put({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await N1(s,{method:"PUT",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async delete({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await N1(s,{method:"DELETE",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}createUrl({path:e,params:r}){const n=new URL(e,this.baseUrl);return r&&Object.entries(r).forEach(([i,s])=>{s&&n.searchParams.append(i,s)}),this.clientId&&n.searchParams.append("clientId",this.clientId),n}}const One={getFeatureValue(t,e){const r=e==null?void 0:e[t];return r===void 0?ct.DEFAULT_FEATURES[t]:r},filterSocialsByPlatform(t){if(!t||!t.length)return t;if(ue.isTelegram()){if(ue.isIos())return t.filter(e=>e!=="google");if(ue.isMac())return t.filter(e=>e!=="x");if(ue.isAndroid())return t.filter(e=>!["facebook","x"].includes(e))}return t}},at=rr({features:ct.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined",defaultAccountTypes:ct.DEFAULT_ACCOUNT_TYPES,enableNetworkSwitch:!0,experimental_preferUniversalLinks:!1,remoteFeatures:{}}),oe={state:at,subscribeKey(t,e){return dn(at,t,e)},setOptions(t){Object.assign(at,t)},setRemoteFeatures(t){var r;if(!t)return;const e={...at.remoteFeatures,...t};at.remoteFeatures=e,(r=at.remoteFeatures)!=null&&r.socials&&(at.remoteFeatures.socials=One.filterSocialsByPlatform(at.remoteFeatures.socials))},setFeatures(t){if(!t)return;at.features||(at.features=ct.DEFAULT_FEATURES);const e={...at.features,...t};at.features=e},setProjectId(t){at.projectId=t},setCustomRpcUrls(t){at.customRpcUrls=t},setAllWallets(t){at.allWallets=t},setIncludeWalletIds(t){at.includeWalletIds=t},setExcludeWalletIds(t){at.excludeWalletIds=t},setFeaturedWalletIds(t){at.featuredWalletIds=t},setTokens(t){at.tokens=t},setTermsConditionsUrl(t){at.termsConditionsUrl=t},setPrivacyPolicyUrl(t){at.privacyPolicyUrl=t},setCustomWallets(t){at.customWallets=t},setIsSiweEnabled(t){at.isSiweEnabled=t},setIsUniversalProvider(t){at.isUniversalProvider=t},setSdkVersion(t){at.sdkVersion=t},setMetadata(t){at.metadata=t},setDisableAppend(t){at.disableAppend=t},setEIP6963Enabled(t){at.enableEIP6963=t},setDebug(t){at.debug=t},setEnableWalletConnect(t){at.enableWalletConnect=t},setEnableWalletGuide(t){at.enableWalletGuide=t},setEnableAuthLogger(t){at.enableAuthLogger=t},setEnableWallets(t){at.enableWallets=t},setPreferUniversalLinks(t){at.experimental_preferUniversalLinks=t},setHasMultipleAddresses(t){at.hasMultipleAddresses=t},setSIWX(t){at.siwx=t},setConnectMethodsOrder(t){at.features={...at.features,connectMethodsOrder:t}},setWalletFeaturesOrder(t){at.features={...at.features,walletFeaturesOrder:t}},setSocialsOrder(t){at.remoteFeatures={...at.remoteFeatures,socials:t}},setCollapseWallets(t){at.features={...at.features,collapseWallets:t}},setEnableEmbedded(t){at.enableEmbedded=t},setAllowUnsupportedChain(t){at.allowUnsupportedChain=t},setManualWCControl(t){at.manualWCControl=t},setEnableNetworkSwitch(t){at.enableNetworkSwitch=t},setDefaultAccountTypes(t={}){Object.entries(t).forEach(([e,r])=>{r&&(at.defaultAccountTypes[e]=r)})},setUniversalProviderConfigOverride(t){at.universalProviderConfigOverride=t},getUniversalProviderConfigOverride(){return at.universalProviderConfigOverride},getSnapshot(){return Jb(at)}},Rne=Object.freeze({enabled:!0,events:[]}),kne=new Av({baseUrl:ue.getAnalyticsUrl(),clientId:null}),Nne=5,$ne=60*1e3,hl=rr({...Rne}),jne={state:hl,subscribeKey(t,e){return dn(hl,t,e)},async sendError(t,e){if(!hl.enabled)return;const r=Date.now();if(hl.events.filter(s=>{const o=new Date(s.properties.timestamp||"").getTime();return r-o<$ne}).length>=Nne)return;const i={type:"error",event:e,properties:{errorType:t.name,errorMessage:t.message,stackTrace:t.stack,timestamp:new Date().toISOString()}};hl.events.push(i);try{if(typeof window>"u")return;const{projectId:s,sdkType:o,sdkVersion:a}=oe.state;await kne.post({path:"/e",params:{projectId:s,st:o,sv:a||"html-wagmi-4.2.2"},body:{eventId:ue.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:new Date().toISOString(),props:{type:"error",event:e,errorType:t.name,errorMessage:t.message,stackTrace:t.stack}}})}catch{}},enable(){hl.enabled=!0},disable(){hl.enabled=!1},clearEvents(){hl.events=[]}};class sm extends Error{constructor(e,r,n){super(e),this.name="AppKitError",this.category=r,this.originalError=n,Object.setPrototypeOf(this,sm.prototype);let i=!1;if(n instanceof Error&&typeof n.stack=="string"&&n.stack){const s=n.stack,o=s.indexOf(`
- `);if(o>-1){const a=s.substring(o+1);this.stack=`${this.name}: ${this.message}
- ${a}`,i=!0}}i||(Error.captureStackTrace?Error.captureStackTrace(this,sm):this.stack||(this.stack=`${this.name}: ${this.message}`))}}function JR(t,e){const r=t instanceof sm?t:new sm(t instanceof Error?t.message:String(t),e,t);throw jne.sendError(r,r.category),r}function Pi(t,e="INTERNAL_SDK_ERROR"){const r={};return Object.keys(t).forEach(n=>{const i=t[n];if(typeof i=="function"){let s=i;i.constructor.name==="AsyncFunction"?s=async(...o)=>{try{return await i(...o)}catch(a){return JR(a,e)}}:s=(...o)=>{try{return i(...o)}catch(a){return JR(a,e)}},r[n]=s}else r[n]=i}),r}const Ma={PHANTOM:{id:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",url:"https://phantom.app"},SOLFLARE:{id:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",url:"https://solflare.com"},COINBASE:{id:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",url:"https://go.cb-w.com"}},Bne={handleMobileDeeplinkRedirect(t,e){const r=window.location.href,n=encodeURIComponent(r);if(t===Ma.PHANTOM.id&&!("phantom"in window)){const i=r.startsWith("https")?"https":"http",s=r.split("/")[2],o=encodeURIComponent(`${i}://${s}`);window.location.href=`${Ma.PHANTOM.url}/ul/browse/${n}?ref=${o}`}t===Ma.SOLFLARE.id&&!("solflare"in window)&&(window.location.href=`${Ma.SOLFLARE.url}/ul/v1/browse/${n}?ref=${n}`),e===_e.CHAIN.SOLANA&&t===Ma.COINBASE.id&&!("coinbaseSolana"in window)&&(window.location.href=`${Ma.COINBASE.url}/dapp?cb_url=${n}`)}},ss=rr({walletImages:{},networkImages:{},chainImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),Dne={state:ss,subscribeNetworkImages(t){return ln(ss.networkImages,()=>t(ss.networkImages))},subscribeKey(t,e){return dn(ss,t,e)},subscribe(t){return ln(ss,()=>t(ss))},setWalletImage(t,e){ss.walletImages[t]=e},setNetworkImage(t,e){ss.networkImages[t]=e},setChainImage(t,e){ss.chainImages[t]=e},setConnectorImage(t,e){ss.connectorImages={...ss.connectorImages,[t]:e}},setTokenImage(t,e){ss.tokenImages[t]=e},setCurrencyImage(t,e){ss.currencyImages[t]=e}},er=Pi(Dne),Mne={eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"a1b58899-f671-4276-6a5e-56ca5bd59700",polkadot:"",bip122:"0b4838db-0161-4ffe-022d-532bf03dba00",cosmos:""},s8=rr({networkImagePromises:{}}),pt={async fetchWalletImage(t){if(t)return await Ne._fetchWalletImage(t),this.getWalletImageById(t)},async fetchNetworkImage(t){if(!t)return;const e=this.getNetworkImageById(t);return e||(s8.networkImagePromises[t]||(s8.networkImagePromises[t]=Ne._fetchNetworkImage(t)),await s8.networkImagePromises[t],this.getNetworkImageById(t))},getWalletImageById(t){if(t)return er.state.walletImages[t]},getWalletImage(t){if(t!=null&&t.image_url)return t==null?void 0:t.image_url;if(t!=null&&t.image_id)return er.state.walletImages[t.image_id]},getNetworkImage(t){var e,r,n;if((e=t==null?void 0:t.assets)!=null&&e.imageUrl)return(r=t==null?void 0:t.assets)==null?void 0:r.imageUrl;if((n=t==null?void 0:t.assets)!=null&&n.imageId)return er.state.networkImages[t.assets.imageId]},getNetworkImageById(t){if(t)return er.state.networkImages[t]},getConnectorImage(t){if(t!=null&&t.imageUrl)return t.imageUrl;if(t!=null&&t.imageId)return er.state.connectorImages[t.imageId]},getChainImage(t){return er.state.networkImages[Mne[t]]}},fl=rr({message:"",variant:"info",open:!1}),Lne={state:fl,subscribeKey(t,e){return dn(fl,t,e)},open(t,e){const{debug:r}=oe.state,{shortMessage:n,longMessage:i}=t;r&&(fl.message=n,fl.variant=e,fl.open=!0),i&&console.error(typeof i=="function"?i():i)},close(){fl.open=!1,fl.message="",fl.variant="info"}},Fn=Pi(Lne),Une=ue.getAnalyticsUrl(),Fne=new Av({baseUrl:Une,clientId:null}),Hne=["MODAL_CREATED"],wc=rr({timestamp:Date.now(),reportedErrors:{},data:{type:"track",event:"MODAL_CREATED"}}),Re={state:wc,subscribe(t){return ln(wc,()=>t(wc))},getSdkProperties(){const{projectId:t,sdkType:e,sdkVersion:r}=oe.state;return{projectId:t,st:e,sv:r||"html-wagmi-4.2.2"}},async _sendAnalyticsEvent(t){try{const e=re.state.address;if(Hne.includes(t.data.event)||typeof window>"u")return;await Fne.post({path:"/e",params:Re.getSdkProperties(),body:{eventId:ue.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:t.timestamp,props:{...t.data,address:e}}}),wc.reportedErrors.FORBIDDEN=!1}catch(e){e instanceof Error&&e.cause instanceof Response&&e.cause.status===_e.HTTP_STATUS_CODES.FORBIDDEN&&!wc.reportedErrors.FORBIDDEN&&(Fn.open({shortMessage:"Invalid App Configuration",longMessage:`Origin ${tb()?window.origin:"uknown"} not found on Allowlist - update configuration on cloud.reown.com`},"error"),wc.reportedErrors.FORBIDDEN=!0)}},sendEvent(t){var e;wc.timestamp=Date.now(),wc.data=t,(e=oe.state.features)!=null&&e.analytics&&Re._sendAnalyticsEvent(wc)}},qne=ue.getApiUrl(),Ni=new Av({baseUrl:qne,clientId:null}),zne=40,QR=4,Wne=20,wt=rr({promises:{},page:1,count:0,featured:[],allFeatured:[],recommended:[],allRecommended:[],wallets:[],filteredWallets:[],search:[],isAnalyticsEnabled:!1,excludedWallets:[],isFetchingRecommendedWallets:!1}),Ne={state:wt,subscribeKey(t,e){return dn(wt,t,e)},_getSdkProperties(){const{projectId:t,sdkType:e,sdkVersion:r}=oe.state;return{projectId:t,st:e||"appkit",sv:r||"html-wagmi-4.2.2"}},_filterOutExtensions(t){return oe.state.isUniversalProvider?t.filter(e=>!!(e.mobile_link||e.desktop_link||e.webapp_link)):t},async _fetchWalletImage(t){const e=`${Ni.baseUrl}/getWalletImage/${t}`,r=await Ni.getBlob({path:e,params:Ne._getSdkProperties()});er.setWalletImage(t,URL.createObjectURL(r))},async _fetchNetworkImage(t){const e=`${Ni.baseUrl}/public/getAssetImage/${t}`,r=await Ni.getBlob({path:e,params:Ne._getSdkProperties()});er.setNetworkImage(t,URL.createObjectURL(r))},async _fetchConnectorImage(t){const e=`${Ni.baseUrl}/public/getAssetImage/${t}`,r=await Ni.getBlob({path:e,params:Ne._getSdkProperties()});er.setConnectorImage(t,URL.createObjectURL(r))},async _fetchCurrencyImage(t){const e=`${Ni.baseUrl}/public/getCurrencyImage/${t}`,r=await Ni.getBlob({path:e,params:Ne._getSdkProperties()});er.setCurrencyImage(t,URL.createObjectURL(r))},async _fetchTokenImage(t){const e=`${Ni.baseUrl}/public/getTokenImage/${t}`,r=await Ni.getBlob({path:e,params:Ne._getSdkProperties()});er.setTokenImage(t,URL.createObjectURL(r))},_filterWalletsByPlatform(t){return ue.isMobile()?t==null?void 0:t.filter(r=>r.mobile_link||r.id===Ma.COINBASE.id?!0:F.state.activeChain==="solana"&&(r.id===Ma.SOLFLARE.id||r.id===Ma.PHANTOM.id)):t},async fetchProjectConfig(){return(await Ni.get({path:"/appkit/v1/config",params:Ne._getSdkProperties()})).features},async fetchAllowedOrigins(){try{const{allowedOrigins:t}=await Ni.get({path:"/projects/v1/origins",params:Ne._getSdkProperties()});return t}catch{return[]}},async fetchNetworkImages(){const t=F.getAllRequestedCaipNetworks(),e=t==null?void 0:t.map(({assets:r})=>r==null?void 0:r.imageId).filter(Boolean).filter(r=>!pt.getNetworkImageById(r));e&&await Promise.allSettled(e.map(r=>Ne._fetchNetworkImage(r)))},async fetchConnectorImages(){const{connectors:t}=ge.state,e=t.map(({imageId:r})=>r).filter(Boolean);await Promise.allSettled(e.map(r=>Ne._fetchConnectorImage(r)))},async fetchCurrencyImages(t=[]){await Promise.allSettled(t.map(e=>Ne._fetchCurrencyImage(e)))},async fetchTokenImages(t=[]){await Promise.allSettled(t.map(e=>Ne._fetchTokenImage(e)))},async fetchWallets(t){var s;const e=t.exclude??[];Ne._getSdkProperties().sv.startsWith("html-core-")&&e.push(...Object.values(Ma).map(o=>o.id));const n=await Ni.get({path:"/getWallets",params:{...Ne._getSdkProperties(),...t,page:String(t.page),entries:String(t.entries),include:(s=t.include)==null?void 0:s.join(","),exclude:e.join(",")}});return{data:Ne._filterWalletsByPlatform(n==null?void 0:n.data)||[],count:n==null?void 0:n.count}},async fetchFeaturedWallets(){const{featuredWalletIds:t}=oe.state;if(t!=null&&t.length){const e={...Ne._getSdkProperties(),page:1,entries:(t==null?void 0:t.length)??QR,include:t},{data:r}=await Ne.fetchWallets(e),n=[...r].sort((s,o)=>t.indexOf(s.id)-t.indexOf(o.id)),i=n.map(s=>s.image_id).filter(Boolean);await Promise.allSettled(i.map(s=>Ne._fetchWalletImage(s))),wt.featured=n,wt.allFeatured=n}},async fetchRecommendedWallets(){try{wt.isFetchingRecommendedWallets=!0;const{includeWalletIds:t,excludeWalletIds:e,featuredWalletIds:r}=oe.state,n=[...e??[],...r??[]].filter(Boolean),i=F.getRequestedCaipNetworkIds().join(","),s={page:1,entries:QR,include:t,exclude:n,chains:i},{data:o,count:a}=await Ne.fetchWallets(s),c=Le.getRecentWallets(),u=o.map(d=>d.image_id).filter(Boolean),l=c.map(d=>d.image_id).filter(Boolean);await Promise.allSettled([...u,...l].map(d=>Ne._fetchWalletImage(d))),wt.recommended=o,wt.allRecommended=o,wt.count=a??0}catch{}finally{wt.isFetchingRecommendedWallets=!1}},async fetchWalletsByPage({page:t}){const{includeWalletIds:e,excludeWalletIds:r,featuredWalletIds:n}=oe.state,i=F.getRequestedCaipNetworkIds().join(","),s=[...wt.recommended.map(({id:l})=>l),...r??[],...n??[]].filter(Boolean),o={page:t,entries:zne,include:e,exclude:s,chains:i},{data:a,count:c}=await Ne.fetchWallets(o),u=a.slice(0,Wne).map(l=>l.image_id).filter(Boolean);await Promise.allSettled(u.map(l=>Ne._fetchWalletImage(l))),wt.wallets=ue.uniqueBy([...wt.wallets,...Ne._filterOutExtensions(a)],"id").filter(l=>{var d;return(d=l.chains)==null?void 0:d.some(h=>i.includes(h))}),wt.count=c>wt.count?c:wt.count,wt.page=t},async initializeExcludedWallets({ids:t}){const e={page:1,entries:t.length,include:t},{data:r}=await Ne.fetchWallets(e);r&&r.forEach(n=>{wt.excludedWallets.push({rdns:n.rdns,name:n.name})})},async searchWallet({search:t,badge:e}){const{includeWalletIds:r,excludeWalletIds:n}=oe.state,i=F.getRequestedCaipNetworkIds().join(",");wt.search=[];const s={page:1,entries:100,search:t==null?void 0:t.trim(),badge_type:e,include:r,exclude:n,chains:i},{data:o}=await Ne.fetchWallets(s);Re.sendEvent({type:"track",event:"SEARCH_WALLET",properties:{badge:e??"",search:t??""}});const a=o.map(c=>c.image_id).filter(Boolean);await Promise.allSettled([...a.map(c=>Ne._fetchWalletImage(c)),ue.wait(300)]),wt.search=Ne._filterOutExtensions(o)},initPromise(t,e){const r=wt.promises[t];return r||(wt.promises[t]=e())},prefetch({fetchConnectorImages:t=!0,fetchFeaturedWallets:e=!0,fetchRecommendedWallets:r=!0,fetchNetworkImages:n=!0}={}){const i=[t&&Ne.initPromise("connectorImages",Ne.fetchConnectorImages),e&&Ne.initPromise("featuredWallets",Ne.fetchFeaturedWallets),r&&Ne.initPromise("recommendedWallets",Ne.fetchRecommendedWallets),n&&Ne.initPromise("networkImages",Ne.fetchNetworkImages)].filter(Boolean);return Promise.allSettled(i)},prefetchAnalyticsConfig(){var t;(t=oe.state.features)!=null&&t.analytics&&Ne.fetchAnalyticsConfig()},async fetchAnalyticsConfig(){try{const{isAnalyticsEnabled:t}=await Ni.get({path:"/getAnalyticsConfig",params:Ne._getSdkProperties()});oe.setFeatures({analytics:t})}catch{oe.setFeatures({analytics:!1})}},filterByNamespaces(t){if(!(t!=null&&t.length)){wt.featured=wt.allFeatured,wt.recommended=wt.allRecommended;return}const e=F.getRequestedCaipNetworkIds().join(",");wt.featured=wt.allFeatured.filter(r=>{var n;return(n=r.chains)==null?void 0:n.some(i=>e.includes(i))}),wt.recommended=wt.allRecommended.filter(r=>{var n;return(n=r.chains)==null?void 0:n.some(i=>e.includes(i))}),wt.filteredWallets=wt.wallets.filter(r=>{var n;return(n=r.chains)==null?void 0:n.some(i=>e.includes(i))})},clearFilterByNamespaces(){wt.filteredWallets=[]},setFilterByNamespace(t){if(!t){wt.featured=wt.allFeatured,wt.recommended=wt.allRecommended;return}const e=F.getRequestedCaipNetworkIds().join(",");wt.featured=wt.allFeatured.filter(r=>{var n;return(n=r.chains)==null?void 0:n.some(i=>e.includes(i))}),wt.recommended=wt.allRecommended.filter(r=>{var n;return(n=r.chains)==null?void 0:n.some(i=>e.includes(i))}),wt.filteredWallets=wt.wallets.filter(r=>{var n;return(n=r.chains)==null?void 0:n.some(i=>e.includes(i))})}},nr=rr({view:"Connect",history:["Connect"],transactionStack:[]}),Vne={state:nr,subscribeKey(t,e){return dn(nr,t,e)},pushTransactionStack(t){nr.transactionStack.push(t)},popTransactionStack(t){const e=nr.transactionStack.pop();if(!e)return;const{onSuccess:r,onError:n,onCancel:i}=e;switch(t){case"success":r==null||r();break;case"error":n==null||n(),X.goBack();break;case"cancel":i==null||i(),X.goBack();break}},push(t,e){t!==nr.view&&(nr.view=t,nr.history.push(t),nr.data=e)},reset(t,e){nr.view=t,nr.history=[t],nr.data=e},replace(t,e){nr.history.at(-1)===t||(nr.view=t,nr.history[nr.history.length-1]=t,nr.data=e)},goBack(){var n;const t=F.state.activeCaipAddress,e=X.state.view==="ConnectingFarcaster",r=!t&&e;if(nr.history.length>1){nr.history.pop();const[i]=nr.history.slice(-1);i&&(t&&i==="Connect"?nr.view="Account":nr.view=i)}else We.close();(n=nr.data)!=null&&n.wallet&&(nr.data.wallet=void 0),setTimeout(()=>{var i,s,o;if(r){re.setFarcasterUrl(void 0,F.state.activeChain);const a=ge.getAuthConnector();(i=a==null?void 0:a.provider)==null||i.reload();const c=Jb(oe.state);(o=(s=a==null?void 0:a.provider)==null?void 0:s.syncDappData)==null||o.call(s,{metadata:c.metadata,sdkVersion:c.sdkVersion,projectId:c.projectId,sdkType:c.sdkType})}},100)},goBackToIndex(t){if(nr.history.length>1){nr.history=nr.history.slice(0,t+1);const[e]=nr.history.slice(-1);e&&(nr.view=e)}},goBackOrCloseModal(){X.state.history.length>1?X.goBack():We.close()}},X=Pi(Vne),bc=rr({themeMode:"dark",themeVariables:{},w3mThemeVariables:void 0}),QT={state:bc,subscribe(t){return ln(bc,()=>t(bc))},setThemeMode(t){bc.themeMode=t;try{const e=ge.getAuthConnector();if(e){const r=QT.getSnapshot().themeVariables;e.provider.syncTheme({themeMode:t,themeVariables:r,w3mThemeVariables:za(r,t)})}}catch{console.info("Unable to sync theme to auth connector")}},setThemeVariables(t){bc.themeVariables={...bc.themeVariables,...t};try{const e=ge.getAuthConnector();if(e){const r=QT.getSnapshot().themeVariables;e.provider.syncTheme({themeVariables:r,w3mThemeVariables:za(bc.themeVariables,bc.themeMode)})}}catch{console.info("Unable to sync theme to auth connector")}},getSnapshot(){return Jb(bc)}},ar=Pi(QT),OV={eip155:void 0,solana:void 0,polkadot:void 0,bip122:void 0,cosmos:void 0},Lt=rr({allConnectors:[],connectors:[],activeConnector:void 0,filterByNamespace:void 0,activeConnectorIds:{...OV},filterByNamespaceMap:{eip155:!0,solana:!0,polkadot:!0,bip122:!0,cosmos:!0}}),Gne={state:Lt,subscribe(t){return ln(Lt,()=>{t(Lt)})},subscribeKey(t,e){return dn(Lt,t,e)},initialize(t){t.forEach(e=>{const r=Le.getConnectedConnectorId(e);r&&ge.setConnectorId(r,e)})},setActiveConnector(t){t&&(Lt.activeConnector=Nf(t))},setConnectors(t){t.filter(i=>!Lt.allConnectors.some(s=>s.id===i.id&&ge.getConnectorName(s.name)===ge.getConnectorName(i.name)&&s.chain===i.chain)).forEach(i=>{i.type!=="MULTI_CHAIN"&&Lt.allConnectors.push(Nf(i))});const r=ge.getEnabledNamespaces(),n=ge.getEnabledConnectors(r);Lt.connectors=ge.mergeMultiChainConnectors(n)},filterByNamespaces(t){Object.keys(Lt.filterByNamespaceMap).forEach(e=>{Lt.filterByNamespaceMap[e]=!1}),t.forEach(e=>{Lt.filterByNamespaceMap[e]=!0}),ge.updateConnectorsForEnabledNamespaces()},filterByNamespace(t,e){Lt.filterByNamespaceMap[t]=e,ge.updateConnectorsForEnabledNamespaces()},updateConnectorsForEnabledNamespaces(){const t=ge.getEnabledNamespaces(),e=ge.getEnabledConnectors(t),r=ge.areAllNamespacesEnabled();Lt.connectors=ge.mergeMultiChainConnectors(e),r?Ne.clearFilterByNamespaces():Ne.filterByNamespaces(t)},getEnabledNamespaces(){return Object.entries(Lt.filterByNamespaceMap).filter(([t,e])=>e).map(([t])=>t)},getEnabledConnectors(t){return Lt.allConnectors.filter(e=>t.includes(e.chain))},areAllNamespacesEnabled(){return Object.values(Lt.filterByNamespaceMap).every(t=>t)},mergeMultiChainConnectors(t){const e=ge.generateConnectorMapByName(t),r=[];return e.forEach(n=>{const i=n[0],s=(i==null?void 0:i.id)===_e.CONNECTOR_ID.AUTH;n.length>1&&i?r.push({name:i.name,imageUrl:i.imageUrl,imageId:i.imageId,connectors:[...n],type:s?"AUTH":"MULTI_CHAIN",chain:"eip155",id:(i==null?void 0:i.id)||""}):i&&r.push(i)}),r},generateConnectorMapByName(t){const e=new Map;return t.forEach(r=>{const{name:n}=r,i=ge.getConnectorName(n);if(!i)return;const s=e.get(i)||[];s.find(a=>a.chain===r.chain)||s.push(r),e.set(i,s)}),e},getConnectorName(t){return t&&({"Trust Wallet":"Trust"}[t]||t)},getUniqueConnectorsByName(t){const e=[];return t.forEach(r=>{e.find(n=>n.chain===r.chain)||e.push(r)}),e},addConnector(t){var e,r,n;if(t.id===_e.CONNECTOR_ID.AUTH){const i=t,s=Jb(oe.state),o=ar.getSnapshot().themeMode,a=ar.getSnapshot().themeVariables;(r=(e=i==null?void 0:i.provider)==null?void 0:e.syncDappData)==null||r.call(e,{metadata:s.metadata,sdkVersion:s.sdkVersion,projectId:s.projectId,sdkType:s.sdkType}),(n=i==null?void 0:i.provider)==null||n.syncTheme({themeMode:o,themeVariables:a,w3mThemeVariables:za(a,o)}),ge.setConnectors([t])}else ge.setConnectors([t])},getAuthConnector(t){var n;const e=t||F.state.activeChain,r=Lt.connectors.find(i=>i.id===_e.CONNECTOR_ID.AUTH);if(r)return(n=r==null?void 0:r.connectors)!=null&&n.length?r.connectors.find(s=>s.chain===e):r},getAnnouncedConnectorRdns(){return Lt.connectors.filter(t=>t.type==="ANNOUNCED").map(t=>{var e;return(e=t.info)==null?void 0:e.rdns})},getConnectorById(t){return Lt.allConnectors.find(e=>e.id===t)},getConnector(t,e){return Lt.allConnectors.filter(n=>n.chain===F.state.activeChain).find(n=>{var i;return n.explorerId===t||((i=n.info)==null?void 0:i.rdns)===e})},syncIfAuthConnector(t){var s,o;if(t.id!=="ID_AUTH")return;const e=t,r=Jb(oe.state),n=ar.getSnapshot().themeMode,i=ar.getSnapshot().themeVariables;(o=(s=e==null?void 0:e.provider)==null?void 0:s.syncDappData)==null||o.call(s,{metadata:r.metadata,sdkVersion:r.sdkVersion,sdkType:r.sdkType,projectId:r.projectId}),e.provider.syncTheme({themeMode:n,themeVariables:i,w3mThemeVariables:za(i,n)})},getConnectorsByNamespace(t){const e=Lt.allConnectors.filter(r=>r.chain===t);return ge.mergeMultiChainConnectors(e)},selectWalletConnector(t){const e=ge.getConnector(t.id,t.rdns),r=F.state.activeChain;Bne.handleMobileDeeplinkRedirect((e==null?void 0:e.explorerId)||t.id,r),e?X.push("ConnectingExternal",{connector:e}):X.push("ConnectingWalletConnect",{wallet:t})},getConnectors(t){return t?ge.getConnectorsByNamespace(t):ge.mergeMultiChainConnectors(Lt.allConnectors)},setFilterByNamespace(t){Lt.filterByNamespace=t,Lt.connectors=ge.getConnectors(t),Ne.setFilterByNamespace(t)},setConnectorId(t,e){t&&(Lt.activeConnectorIds={...Lt.activeConnectorIds,[e]:t},Le.setConnectedConnectorId(e,t))},removeConnectorId(t){Lt.activeConnectorIds={...Lt.activeConnectorIds,[t]:void 0},Le.deleteConnectedConnectorId(t)},getConnectorId(t){if(t)return Lt.activeConnectorIds[t]},isConnected(t){return t?!!Lt.activeConnectorIds[t]:Object.values(Lt.activeConnectorIds).some(e=>!!e)},resetConnectorIds(){Lt.activeConnectorIds={...OV}}},ge=Pi(Gne);var om={};const Kne="https://secure.walletconnect.org/sdk",Zne=(typeof process<"u"&&typeof om<"u"?om.NEXT_PUBLIC_SECURE_SITE_SDK_URL:void 0)||Kne,Yne=(typeof process<"u"&&typeof om<"u"?om.NEXT_PUBLIC_DEFAULT_LOG_LEVEL:void 0)||"error",Jne=(typeof process<"u"&&typeof om<"u"?om.NEXT_PUBLIC_SECURE_SITE_SDK_VERSION:void 0)||"4",Ye={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@appkit-wallet/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",SOCIAL_USERNAME:"SOCIAL_USERNAME",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_CONNECT_SOCIAL:"@w3m-app/CONNECT_SOCIAL",APP_GET_SOCIAL_REDIRECT_URI:"@w3m-app/GET_SOCIAL_REDIRECT_URI",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",APP_CONNECT_FARCASTER:"@w3m-app/CONNECT_FARCASTER",APP_GET_FARCASTER_URI:"@w3m-app/GET_FARCASTER_URI",APP_RELOAD:"@w3m-app/RELOAD",FRAME_SWITCH_NETWORK_ERROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_CONNECT_SOCIAL_SUCCESS:"@w3m-frame/CONNECT_SOCIAL_SUCCESS",FRAME_CONNECT_SOCIAL_ERROR:"@w3m-frame/CONNECT_SOCIAL_ERROR",FRAME_CONNECT_FARCASTER_SUCCESS:"@w3m-frame/CONNECT_FARCASTER_SUCCESS",FRAME_CONNECT_FARCASTER_ERROR:"@w3m-frame/CONNECT_FARCASTER_ERROR",FRAME_GET_FARCASTER_URI_SUCCESS:"@w3m-frame/GET_FARCASTER_URI_SUCCESS",FRAME_GET_FARCASTER_URI_ERROR:"@w3m-frame/GET_FARCASTER_URI_ERROR",FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",FRAME_READY:"@w3m-frame/READY",FRAME_RELOAD_SUCCESS:"@w3m-frame/RELOAD_SUCCESS",FRAME_RELOAD_ERROR:"@w3m-frame/RELOAD_ERROR",RPC_RESPONSE_TYPE_ERROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},bt={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter","wallet_getCapabilities","wallet_getCallsStatus","eth_getUserOperationReceipt","eth_estimateUserOperationGas","eth_getUserOperationByHash","eth_supportedEntryPoints","wallet_getAssets"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction","solana_signMessage","solana_signTransaction","solana_signAllTransactions","solana_signAndSendTransaction","wallet_sendCalls","wallet_grantPermissions","wallet_revokePermissions","eth_sendUserOperation"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RPC_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}},$h=Object.freeze({message:"",variant:"success",svg:void 0,open:!1,autoClose:!0}),pn=rr({...$h}),Qne={state:pn,subscribeKey(t,e){return dn(pn,t,e)},showLoading(t,e={}){this._showMessage({message:t,variant:"loading",...e})},showSuccess(t){this._showMessage({message:t,variant:"success"})},showSvg(t,e){this._showMessage({message:t,svg:e})},showError(t){const e=ue.parseError(t);this._showMessage({message:e,variant:"error"})},hide(){pn.message=$h.message,pn.variant=$h.variant,pn.svg=$h.svg,pn.open=$h.open,pn.autoClose=$h.autoClose},_showMessage({message:t,svg:e,variant:r="success",autoClose:n=$h.autoClose}){pn.open?(pn.open=!1,setTimeout(()=>{pn.message=t,pn.variant=r,pn.svg=e,pn.open=!0,pn.autoClose=n},150)):(pn.message=t,pn.variant=r,pn.svg=e,pn.open=!0,pn.autoClose=n)}},Fe=Qne,Ar=rr({transactions:[],coinbaseTransactions:{},transactionsByYear:{},lastNetworkInView:void 0,loading:!1,empty:!1,next:void 0}),Xne={state:Ar,subscribe(t){return ln(Ar,()=>t(Ar))},setLastNetworkInView(t){Ar.lastNetworkInView=t},async fetchTransactions(t,e){var r,n;if(!t)throw new Error("Transactions can't be fetched without an accountAddress");Ar.loading=!0;try{const i=await Xe.fetchTransactions({account:t,cursor:Ar.next,onramp:e,cache:e==="coinbase"?"no-cache":void 0,chainId:(r=F.state.activeCaipNetwork)==null?void 0:r.caipNetworkId}),s=Dr.filterSpamTransactions(i.data),o=Dr.filterByConnectedChain(s),a=[...Ar.transactions,...o];Ar.loading=!1,e==="coinbase"?Ar.coinbaseTransactions=Dr.groupTransactionsByYearAndMonth(Ar.coinbaseTransactions,i.data):(Ar.transactions=a,Ar.transactionsByYear=Dr.groupTransactionsByYearAndMonth(Ar.transactionsByYear,o)),Ar.empty=a.length===0,Ar.next=i.next?i.next:void 0}catch{const s=F.state.activeChain;Re.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:t,projectId:oe.state.projectId,cursor:Ar.next,isSmartAccount:((n=re.state.preferredAccountTypes)==null?void 0:n[s])===bt.ACCOUNT_TYPES.SMART_ACCOUNT}}),Fe.showError("Failed to fetch transactions"),Ar.loading=!1,Ar.empty=!0,Ar.next=void 0}},groupTransactionsByYearAndMonth(t={},e=[]){const r=t;return e.forEach(n=>{const i=new Date(n.metadata.minedAt).getFullYear(),s=new Date(n.metadata.minedAt).getMonth(),o=r[i]??{},c=(o[s]??[]).filter(u=>u.id!==n.id);r[i]={...o,[s]:[...c,n].sort((u,l)=>new Date(l.metadata.minedAt).getTime()-new Date(u.metadata.minedAt).getTime())}}),r},filterSpamTransactions(t){return t.filter(e=>!e.transfers.every(n=>{var i;return((i=n.nft_info)==null?void 0:i.flags.is_spam)===!0}))},filterByConnectedChain(t){var n;const e=(n=F.state.activeCaipNetwork)==null?void 0:n.caipNetworkId;return t.filter(i=>i.metadata.chain===e)},clearCursor(){Ar.next=void 0},resetTransactions(){Ar.transactions=[],Ar.transactionsByYear={},Ar.lastNetworkInView=void 0,Ar.loading=!1,Ar.empty=!1,Ar.next=void 0}},Dr=Pi(Xne,"API_ERROR"),fr=rr({connections:new Map,wcError:!1,buffering:!1,status:"disconnected"});let ah;const eie={state:fr,subscribeKey(t,e){return dn(fr,t,e)},_getClient(){return fr._client},setClient(t){fr._client=Nf(t)},async connectWalletConnect(){var t,e,r,n;if(ue.isTelegram()||ue.isSafari()&&ue.isIos()){if(ah){await ah,ah=void 0;return}if(!ue.isPairingExpired(fr==null?void 0:fr.wcPairingExpiry)){const i=fr.wcUri;fr.wcUri=i;return}ah=(e=(t=xe._getClient())==null?void 0:t.connectWalletConnect)==null?void 0:e.call(t).catch(()=>{}),xe.state.status="connecting",await ah,ah=void 0,fr.wcPairingExpiry=void 0,xe.state.status="connected"}else await((n=(r=xe._getClient())==null?void 0:r.connectWalletConnect)==null?void 0:n.call(r))},async connectExternal(t,e,r=!0){var n,i;await((i=(n=xe._getClient())==null?void 0:n.connectExternal)==null?void 0:i.call(n,t)),r&&F.setActiveNamespace(e)},async reconnectExternal(t){var r,n;await((n=(r=xe._getClient())==null?void 0:r.reconnectExternal)==null?void 0:n.call(r,t));const e=t.chain||F.state.activeChain;e&&ge.setConnectorId(t.id,e)},async setPreferredAccountType(t,e){var n;We.setLoading(!0,F.state.activeChain);const r=ge.getAuthConnector();r&&(re.setPreferredAccountType(t,e),await r.provider.setPreferredAccount(t),Le.setPreferredAccountTypes(re.state.preferredAccountTypes??{[e]:t}),await xe.reconnectExternal(r),We.setLoading(!1,F.state.activeChain),Re.sendEvent({type:"track",event:"SET_PREFERRED_ACCOUNT_TYPE",properties:{accountType:t,network:((n=F.state.activeCaipNetwork)==null?void 0:n.caipNetworkId)||""}}))},async signMessage(t){var e;return(e=xe._getClient())==null?void 0:e.signMessage(t)},parseUnits(t,e){var r;return(r=xe._getClient())==null?void 0:r.parseUnits(t,e)},formatUnits(t,e){var r;return(r=xe._getClient())==null?void 0:r.formatUnits(t,e)},async sendTransaction(t){var e;return(e=xe._getClient())==null?void 0:e.sendTransaction(t)},async getCapabilities(t){var e;return(e=xe._getClient())==null?void 0:e.getCapabilities(t)},async grantPermissions(t){var e;return(e=xe._getClient())==null?void 0:e.grantPermissions(t)},async walletGetAssets(t){var e;return((e=xe._getClient())==null?void 0:e.walletGetAssets(t))??{}},async estimateGas(t){var e;return(e=xe._getClient())==null?void 0:e.estimateGas(t)},async writeContract(t){var e;return(e=xe._getClient())==null?void 0:e.writeContract(t)},async getEnsAddress(t){var e;return(e=xe._getClient())==null?void 0:e.getEnsAddress(t)},async getEnsAvatar(t){var e;return(e=xe._getClient())==null?void 0:e.getEnsAvatar(t)},checkInstalled(t){var e,r;return((r=(e=xe._getClient())==null?void 0:e.checkInstalled)==null?void 0:r.call(e,t))||!1},resetWcConnection(){fr.wcUri=void 0,fr.wcPairingExpiry=void 0,fr.wcLinking=void 0,fr.recentWallet=void 0,fr.status="disconnected",Dr.resetTransactions(),Le.deleteWalletConnectDeepLink()},resetUri(){fr.wcUri=void 0,fr.wcPairingExpiry=void 0,ah=void 0},finalizeWcConnection(){var r,n;const{wcLinking:t,recentWallet:e}=xe.state;t&&Le.setWalletConnectDeepLink(t),e&&Le.setAppKitRecent(e),Re.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:t?"mobile":"qrcode",name:((n=(r=X.state.data)==null?void 0:r.wallet)==null?void 0:n.name)||"Unknown"}})},setWcBasic(t){fr.wcBasic=t},setUri(t){fr.wcUri=t,fr.wcPairingExpiry=ue.getPairingExpiry()},setWcLinking(t){fr.wcLinking=t},setWcError(t){fr.wcError=t,fr.buffering=!1},setRecentWallet(t){fr.recentWallet=t},setBuffering(t){fr.buffering=t},setStatus(t){fr.status=t},async disconnect(t){var e;try{await((e=xe._getClient())==null?void 0:e.disconnect(t))}catch(r){throw new sm("Failed to disconnect","INTERNAL_SDK_ERROR",r)}},setConnections(t,e){fr.connections.set(e,t)},switchAccount({connection:t,address:e,namespace:r}){if(ge.state.activeConnectorIds[r]===t.connectorId){const s=F.state.activeCaipNetwork;if(s){const o=`${r}:${s.id}:${e}`;re.setCaipAddress(o,r)}else console.warn(`No current network found for namespace "${r}"`)}else{const s=ge.getConnector(t.connectorId);s?xe.connectExternal(s,r):console.warn(`No connector found for namespace "${r}"`)}}},xe=Pi(eie),Wp=rr({loading:!1,open:!1,selectedNetworkId:void 0,activeChain:void 0,initialized:!1}),Ga={state:Wp,subscribe(t){return ln(Wp,()=>t(Wp))},subscribeOpen(t){return dn(Wp,"open",t)},set(t){Object.assign(Wp,{...Wp,...t})}},XR="/docs/contract/encodeFunctionData";function tie(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const s=zre({abi:e,args:r,name:n});if(!s)throw new DR(n,{docsPath:XR});i=s}if(i.type!=="function")throw new DR(void 0,{docsPath:XR});return{abi:[i],functionName:yV(KT(i))}}function ek(t){const{args:e}=t,{abi:r,functionName:n}=(()=>{var a;return t.abi.length===1&&((a=t.functionName)!=null&&a.startsWith("0x"))?t:tie(t)})(),i=r[0],s=n,o="inputs"in i&&i.inputs?T9(i.inputs,e??[]):void 0;return iV([s,o??"0x"])}const rie="modulepreload",nie=function(t){return"/"+t},tk={},ke=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(r.map(c=>{if(c=nie(c),c in tk)return;tk[c]=!0;const u=c.endsWith(".css"),l=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${l}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":rie,u||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((h,f)=>{d.addEventListener("load",h),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};function iie(){let t=()=>{},e=()=>{};return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const o8=new Map;function sie({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const l=c();o();const d=l.map(({args:h})=>h);d.length!==0&&t(d).then(h=>{i&&Array.isArray(h)&&h.sort(i);for(let f=0;f<l.length;f++){const{resolve:g}=l[f];g==null||g([h[f],h])}}).catch(h=>{for(let f=0;f<l.length;f++){const{reject:g}=l[f];g==null||g(h)}})},o=()=>o8.delete(e),a=()=>c().map(({args:l})=>l),c=()=>o8.get(e)||[],u=l=>o8.set(e,[...c(),l]);return{flush:o,async schedule(l){const{promise:d,resolve:h,reject:f}=iie();return(r==null?void 0:r([...a(),l]))&&s(),c().length>0?(u({args:l,resolve:h,reject:f}),d):(u({args:l,resolve:h,reject:f}),setTimeout(s,n),d)}}}async function RV(t){return new Promise(e=>setTimeout(e,t))}const XT=256;let K2=XT,Z2;function oie(t=11){if(!Z2||K2+t>XT*2){Z2="",K2=0;for(let e=0;e<XT;e++)Z2+=(256+Math.random()*256|0).toString(16).substring(1)}return Z2.substring(K2,K2+++t)}const Y2=new S9(8192);function aie(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(Y2.get(r))return Y2.get(r);const n=t().finally(()=>Y2.delete(r));return Y2.set(r,n),n}function cie(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:u})=>{const l=typeof e=="function"?e({count:a,error:u}):e;l&&await RV(l),o({count:a+1})};try{const u=await t();i(u)}catch(u){if(a<r&&await n({count:a,error:u}))return c({error:u});s(u)}};o()})}function uie(t,e={}){return async(r,n={})=>{var d;const{dedupe:i=!1,methods:s,retryDelay:o=150,retryCount:a=3,uid:c}={...e,...n},{method:u}=r;if((d=s==null?void 0:s.exclude)!=null&&d.includes(u))throw new Zh(new Error("method not supported"),{method:u});if(s!=null&&s.include&&!s.include.includes(u))throw new Zh(new Error("method not supported"),{method:u});const l=i?Ib(`${c}.${cd(r)}`):void 0;return aie(()=>cie(async()=>{try{return await t(r)}catch(h){const f=h;switch(f.code){case Rb.code:throw new Rb(f);case kb.code:throw new kb(f);case Nb.code:throw new Nb(f,{method:r.method});case $b.code:throw new $b(f);case rm.code:throw new rm(f);case jb.code:throw new jb(f);case Bb.code:throw new Bb(f);case Db.code:throw new Db(f);case nm.code:throw new nm(f);case Zh.code:throw new Zh(f,{method:r.method});case im.code:throw new im(f);case Mb.code:throw new Mb(f);case xf.code:throw new xf(f);case Lb.code:throw new Lb(f);case Ub.code:throw new Ub(f);case Fb.code:throw new Fb(f);case Hb.code:throw new Hb(f);case qb.code:throw new qb(f);case zb.code:throw new zb(f);case Wb.code:throw new Wb(f);case Vb.code:throw new Vb(f);case Gb.code:throw new Gb(f);case Kb.code:throw new Kb(f);case Zb.code:throw new Zb(f);case Yb.code:throw new Yb(f);case 5e3:throw new xf(f);default:throw h instanceof _r?h:new Vre(f)}}},{delay:({count:h,error:f})=>{var g;if(f&&f instanceof ub){const p=(g=f==null?void 0:f.headers)==null?void 0:g.get("Retry-After");if(p!=null&&p.match(/\d/))return Number.parseInt(p)*1e3}return~~(1<<h)*o},retryCount:a,shouldRetry:({error:h})=>lie(h)}),{enabled:i,id:l})}}function lie(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===im.code||t.code===rm.code:t instanceof ub&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function kV({key:t,methods:e,name:r,request:n,retryCount:i=3,retryDelay:s=150,timeout:o,type:a},c){const u=oie();return{config:{key:t,methods:e,name:r,request:n,retryCount:i,retryDelay:s,timeout:o,type:a},request:uie(n,{methods:e,retryCount:i,retryDelay:s,uid:u}),value:c}}function rk(t,e={}){const{key:r="fallback",name:n="Fallback",rank:i=!1,shouldThrow:s=die,retryCount:o,retryDelay:a}=e;return({chain:c,pollingInterval:u=4e3,timeout:l,...d})=>{let h=t,f=()=>{};const g=kV({key:r,name:n,async request({method:p,params:m}){let b;const v=async(E=0)=>{const w=h[E]({...d,chain:c,retryCount:0,timeout:l});try{const C=await w.request({method:p,params:m});return f({method:p,params:m,response:C,transport:w,status:"success"}),C}catch(C){if(f({error:C,method:p,params:m,transport:w,status:"error"}),s(C)||E===h.length-1||(b??(b=h.slice(E+1).some(y=>{const{include:_,exclude:x}=y({chain:c}).config.methods||{};return _?_.includes(p):x?!x.includes(p):!0})),!b))throw C;return v(E+1)}};return v()},retryCount:o,retryDelay:a,type:"fallback"},{onResponse:p=>f=p,transports:h.map(p=>p({chain:c,retryCount:0}))});if(i){const p=typeof i=="object"?i:{};hie({chain:c,interval:p.interval??u,onTransports:m=>h=m,ping:p.ping,sampleCount:p.sampleCount,timeout:p.timeout,transports:h,weights:p.weights})}return g}}function die(t){return!!("code"in t&&typeof t.code=="number"&&(t.code===nm.code||t.code===xf.code||x9.nodeMessage.test(t.message)||t.code===5e3))}function hie({chain:t,interval:e=4e3,onTransports:r,ping:n,sampleCount:i=10,timeout:s=1e3,transports:o,weights:a={}}){const{stability:c=.7,latency:u=.3}=a,l=[],d=async()=>{const h=await Promise.all(o.map(async p=>{const m=p({chain:t,retryCount:0,timeout:s}),b=Date.now();let v,E;try{await(n?n({transport:m}):m.request({method:"net_listening"})),E=1}catch{E=0}finally{v=Date.now()}return{latency:v-b,success:E}}));l.push(h),l.length>i&&l.shift();const f=Math.max(...l.map(p=>Math.max(...p.map(({latency:m})=>m)))),g=o.map((p,m)=>{const b=l.map(y=>y[m].latency),E=1-b.reduce((y,_)=>y+_,0)/b.length/f,w=l.map(y=>y[m].success),C=w.reduce((y,_)=>y+_,0)/w.length;return C===0?[0,m]:[u*E+c*C,m]}).sort((p,m)=>m[0]-p[0]);r(g.map(([,p])=>o[p])),await RV(e),d()};d()}class fie extends _r{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function pie(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{n&&a.abort()},r)),i(await t({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function gie(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const nk=gie();function mie(t,e={}){return{async request(r){var d;const{body:n,onRequest:i=e.onRequest,onResponse:s=e.onResponse,timeout:o=e.timeout??1e4}=r,a={...e.fetchOptions??{},...r.fetchOptions??{}},{headers:c,method:u,signal:l}=a;try{const h=await pie(async({signal:g})=>{const p={...a,body:Array.isArray(n)?cd(n.map(E=>({jsonrpc:"2.0",id:E.id??nk.take(),...E}))):cd({jsonrpc:"2.0",id:n.id??nk.take(),...n}),headers:{"Content-Type":"application/json",...c},method:u||"POST",signal:l||(o>0?g:null)},m=new Request(t,p),b=await(i==null?void 0:i(m,p))??{...p,url:t};return await fetch(b.url??t,b)},{errorInstance:new LR({body:n,url:t}),timeout:o,signal:!0});s&&await s(h);let f;if((d=h.headers.get("Content-Type"))!=null&&d.startsWith("application/json"))f=await h.json();else{f=await h.text();try{f=JSON.parse(f||"{}")}catch(g){if(h.ok)throw g;f={error:f}}}if(!h.ok)throw new ub({body:n,details:cd(f.error)||h.statusText,headers:h.headers,status:h.status,url:t});return f}catch(h){throw h instanceof ub||h instanceof LR?h:new ub({body:n,cause:h,url:t})}}}}function J2(t,e={}){const{batch:r,fetchOptions:n,key:i="http",methods:s,name:o="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:c,retryDelay:u,raw:l}=e;return({chain:d,retryCount:h,timeout:f})=>{const{batchSize:g=1e3,wait:p=0}=typeof r=="object"?r:{},m=e.retryCount??h,b=f??e.timeout??1e4,v=t||(d==null?void 0:d.rpcUrls.default.http[0]);if(!v)throw new fie;const E=mie(v,{fetchOptions:n,onRequest:a,onResponse:c,timeout:b});return kV({key:i,methods:s,name:o,async request({method:w,params:C}){const y={method:w,params:C},{schedule:_}=sie({id:v,wait:p,shouldSplitBatch(O){return O.length>g},fn:O=>E.request({body:O}),sort:(O,k)=>O.id-k.id}),x=async O=>r?_(O):[await E.request({body:O})],[{error:A,result:T}]=await x(y);if(l)return{error:A,result:T};if(A)throw new EV({body:y,error:A,url:v});return T},retryCount:m,retryDelay:u,timeout:b,type:"http"},{fetchOptions:n,url:v})}}class wie extends _r{constructor({domain:e}){super(`Invalid domain "${cd(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class bie extends _r{constructor({primaryType:e,types:r}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class yie extends _r{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function vie(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:xie({domain:e}),...t.types};Aie({domain:e,message:r,primaryType:n,types:i});const s=["0x1901"];return e&&s.push(_ie({domain:e,types:i})),n!=="EIP712Domain"&&s.push(NV({data:r,primaryType:n,types:i})),qa(md(s))}function _ie({domain:t,types:e}){return NV({data:t,primaryType:"EIP712Domain",types:e})}function NV({data:t,primaryType:e,types:r}){const n=$V({data:t,primaryType:e,types:r});return qa(n)}function $V({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[Eie({primaryType:e,types:r})];for(const s of r[e]){const[o,a]=BV({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(o),i.push(a)}return T9(n,i)}function Eie({primaryType:t,types:e}){const r=Tb(Cie({primaryType:t,types:e}));return qa(r)}function Cie({primaryType:t,types:e}){let r="";const n=jV({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const s of i)r+=`${s}(${e[s].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return r}function jV({primaryType:t,types:e},r=new Set){const n=t.match(/^\w*/u),i=n==null?void 0:n[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(const s of e[i])jV({primaryType:s.type,types:e},r);return r}function BV({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},qa($V({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},qa(n)];if(r==="string")return[{type:"bytes32"},qa(Tb(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(o=>BV({name:e,type:i,types:t,value:o}));return[{type:"bytes32"},qa(T9(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:r},n]}function Aie(t){const{domain:e,message:r,primaryType:n,types:i}=t,s=(o,a)=>{for(const c of o){const{name:u,type:l}=c,d=a[u],h=l.match(vV);if(h&&(typeof d=="number"||typeof d=="bigint")){const[p,m,b]=h;$d(d,{signed:m==="int",size:Number.parseInt(b)/8})}if(l==="address"&&typeof d=="string"&&!Ob(d))throw new cV({address:d});const f=l.match(Nre);if(f){const[p,m]=f;if(m&&Ci(d)!==Number.parseInt(m))throw new Cre({expectedSize:Number.parseInt(m),givenSize:Ci(d)})}const g=i[l];g&&(Sie(l),s(g,d))}};if(i.EIP712Domain&&e){if(typeof e!="object")throw new wie({domain:e});s(i.EIP712Domain,e)}if(n!=="EIP712Domain")if(i[n])s(i[n],r);else throw new bie({primaryType:n,types:i})}function xie({domain:t}){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},(typeof(t==null?void 0:t.chainId)=="number"||typeof(t==null?void 0:t.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Sie(t){if(t==="address"||t==="bool"||t==="string"||t.startsWith("bytes")||t.startsWith("uint")||t.startsWith("int"))throw new yie({type:t})}const Tie=`Ethereum Signed Message:
- `;function Iie(t){const e=typeof t=="string"?Ib(t):typeof t.raw=="string"?t.raw:C9(t.raw),r=Ib(`${Tie}${Ci(e)}`);return md([r,e])}function Pie(t,e){return qa(Iie(t),e)}const a8={createBalance(t,e){const r={name:t.metadata.name||"",symbol:t.metadata.symbol||"",decimals:t.metadata.decimals||0,value:t.metadata.value||0,price:t.metadata.price||0,iconUrl:t.metadata.iconUrl||""};return{name:r.name,symbol:r.symbol,chainId:e,address:t.address==="native"?void 0:this.convertAddressToCAIP10Address(t.address,e),value:r.value,price:r.price,quantity:{decimals:r.decimals.toString(),numeric:this.convertHexToBalance({hex:t.balance,decimals:r.decimals})},iconUrl:r.iconUrl}},convertHexToBalance({hex:t,decimals:e}){return Nte(BigInt(t),e)},convertAddressToCAIP10Address(t,e){return`${e}:${t}`},createCAIP2ChainId(t,e){return`${e}:${parseInt(t,16)}`},getChainIdHexFromCAIP2ChainId(t){const e=t.split(":");if(e.length<2||!e[1])return"0x0";const r=e[1],n=parseInt(r,10);return isNaN(n)?"0x0":`0x${n.toString(16)}`},isWalletGetAssetsResponse(t){return typeof t!="object"||t===null?!1:Object.values(t).every(e=>Array.isArray(e)&&e.every(r=>this.isValidAsset(r)))},isValidAsset(t){return typeof t=="object"&&t!==null&&typeof t.address=="string"&&typeof t.balance=="string"&&(t.type==="ERC20"||t.type==="NATIVE")&&typeof t.metadata=="object"&&t.metadata!==null&&typeof t.metadata.name=="string"&&typeof t.metadata.symbol=="string"&&typeof t.metadata.decimals=="number"&&typeof t.metadata.price=="number"&&typeof t.metadata.iconUrl=="string"}},yC={async getMyTokensWithBalance(t){const e=re.state.address,r=F.state.activeCaipNetwork;if(!e||!r)return[];if(r.chainNamespace==="eip155"){const i=await this.getEIP155Balances(e,r);if(i)return this.filterLowQualityTokens(i)}const n=await Xe.getBalance(e,r.caipNetworkId,t);return this.filterLowQualityTokens(n.balances)},async getEIP155Balances(t,e){var r,n;try{const i=a8.getChainIdHexFromCAIP2ChainId(e.caipNetworkId),s=await xe.getCapabilities(t);if(!((n=(r=s==null?void 0:s[i])==null?void 0:r.assetDiscovery)!=null&&n.supported))return null;const o=await xe.walletGetAssets({account:t,chainFilter:[i]});return a8.isWalletGetAssetsResponse(o)?(o[i]||[]).map(c=>a8.createBalance(c,e.caipNetworkId)):null}catch{return null}},filterLowQualityTokens(t){return t.filter(e=>e.quantity.decimals!=="0")},mapBalancesToSwapTokens(t){return(t==null?void 0:t.map(e=>({...e,address:e!=null&&e.address?e.address:F.getActiveNetworkTokenAddress(),decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1})))||[]}},Yt=rr({tokenBalances:[],loading:!1}),Oie={state:Yt,subscribe(t){return ln(Yt,()=>t(Yt))},subscribeKey(t,e){return dn(Yt,t,e)},setToken(t){t&&(Yt.token=Nf(t))},setTokenAmount(t){Yt.sendTokenAmount=t},setReceiverAddress(t){Yt.receiverAddress=t},setReceiverProfileImageUrl(t){Yt.receiverProfileImageUrl=t},setReceiverProfileName(t){Yt.receiverProfileName=t},setNetworkBalanceInUsd(t){Yt.networkBalanceInUSD=t},setLoading(t){Yt.loading=t},async sendToken(){var t;try{switch(Qe.setLoading(!0),(t=F.state.activeCaipNetwork)==null?void 0:t.chainNamespace){case"eip155":await Qe.sendEvmToken();return;case"solana":await Qe.sendSolanaToken();return;default:throw new Error("Unsupported chain")}}finally{Qe.setLoading(!1)}},async sendEvmToken(){var r,n,i,s;const t=F.state.activeChain,e=(r=re.state.preferredAccountTypes)==null?void 0:r[t];if(!Qe.state.sendTokenAmount||!Qe.state.receiverAddress)throw new Error("An amount and receiver address are required");if(!Qe.state.token)throw new Error("A token is required");(n=Qe.state.token)!=null&&n.address?(Re.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:e===bt.ACCOUNT_TYPES.SMART_ACCOUNT,token:Qe.state.token.address,amount:Qe.state.sendTokenAmount,network:((i=F.state.activeCaipNetwork)==null?void 0:i.caipNetworkId)||""}}),await Qe.sendERC20Token({receiverAddress:Qe.state.receiverAddress,tokenAddress:Qe.state.token.address,sendTokenAmount:Qe.state.sendTokenAmount,decimals:Qe.state.token.quantity.decimals})):(Re.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:e===bt.ACCOUNT_TYPES.SMART_ACCOUNT,token:Qe.state.token.symbol||"",amount:Qe.state.sendTokenAmount,network:((s=F.state.activeCaipNetwork)==null?void 0:s.caipNetworkId)||""}}),await Qe.sendNativeToken({receiverAddress:Qe.state.receiverAddress,sendTokenAmount:Qe.state.sendTokenAmount,decimals:Qe.state.token.quantity.decimals}))},async fetchTokenBalance(t){var s,o;Yt.loading=!0;const e=(s=F.state.activeCaipNetwork)==null?void 0:s.caipNetworkId,r=(o=F.state.activeCaipNetwork)==null?void 0:o.chainNamespace,n=F.state.activeCaipAddress,i=n?ue.getPlainAddress(n):void 0;if(Yt.lastRetry&&!ue.isAllowedRetry(Yt.lastRetry,30*ct.ONE_SEC_MS))return Yt.loading=!1,[];try{if(i&&e&&r){const a=await yC.getMyTokensWithBalance();return Yt.tokenBalances=a,Yt.lastRetry=void 0,a}}catch(a){Yt.lastRetry=Date.now(),t==null||t(a),Fe.showError("Token Balance Unavailable")}finally{Yt.loading=!1}return[]},fetchNetworkBalance(){if(Yt.tokenBalances.length===0)return;const t=yC.mapBalancesToSwapTokens(Yt.tokenBalances);if(!t)return;const e=t.find(r=>r.address===F.getActiveNetworkTokenAddress());e&&(Yt.networkBalanceInUSD=e?Dt.multiply(e.quantity.numeric,e.price).toString():"0")},async sendNativeToken(t){var s,o,a,c;X.pushTransactionStack({});const e=t.receiverAddress,r=re.state.address,n=xe.parseUnits(t.sendTokenAmount.toString(),Number(t.decimals));await xe.sendTransaction({chainNamespace:"eip155",to:e,address:r,data:"0x",value:n??BigInt(0)}),Re.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:((s=re.state.preferredAccountTypes)==null?void 0:s.eip155)===bt.ACCOUNT_TYPES.SMART_ACCOUNT,token:((o=Qe.state.token)==null?void 0:o.symbol)||"",amount:t.sendTokenAmount,network:((a=F.state.activeCaipNetwork)==null?void 0:a.caipNetworkId)||""}}),(c=xe._getClient())==null||c.updateBalance("eip155"),Qe.resetSend()},async sendERC20Token(t){X.pushTransactionStack({onSuccess(){X.replace("Account")}});const e=xe.parseUnits(t.sendTokenAmount.toString(),Number(t.decimals));if(re.state.address&&t.sendTokenAmount&&t.receiverAddress&&t.tokenAddress){const r=ue.getPlainAddress(t.tokenAddress);await xe.writeContract({fromAddress:re.state.address,tokenAddress:r,args:[t.receiverAddress,e??BigInt(0)],method:"transfer",abi:TV.getERC20Abi(r),chainNamespace:"eip155"}),Qe.resetSend()}},async sendSolanaToken(){var t;if(!Qe.state.sendTokenAmount||!Qe.state.receiverAddress)throw new Error("An amount and receiver address are required");X.pushTransactionStack({onSuccess(){X.replace("Account")}}),await xe.sendTransaction({chainNamespace:"solana",to:Qe.state.receiverAddress,value:Qe.state.sendTokenAmount}),(t=xe._getClient())==null||t.updateBalance("solana"),Qe.resetSend()},resetSend(){Yt.token=void 0,Yt.sendTokenAmount=void 0,Yt.receiverAddress=void 0,Yt.receiverProfileImageUrl=void 0,Yt.receiverProfileName=void 0,Yt.loading=!1,Yt.tokenBalances=[]}},Qe=Pi(Oie),c8={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[],user:void 0},Q2={caipNetwork:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},Ue=rr({chains:Xre(),activeCaipAddress:void 0,activeChain:void 0,activeCaipNetwork:void 0,noAdapters:!1,universalAdapter:{networkControllerClient:void 0,connectionControllerClient:void 0},isSwitchingNamespace:!1}),Rie={state:Ue,subscribe(t){return ln(Ue,()=>{t(Ue)})},subscribeKey(t,e){return dn(Ue,t,e)},subscribeChainProp(t,e,r){let n;return ln(Ue.chains,()=>{var s;const i=r||Ue.activeChain;if(i){const o=(s=Ue.chains.get(i))==null?void 0:s[t];n!==o&&(n=o,e(o))}})},initialize(t,e,r){const{chainId:n,namespace:i}=Le.getActiveNetworkProps(),s=e==null?void 0:e.find(l=>l.id.toString()===(n==null?void 0:n.toString())),a=t.find(l=>(l==null?void 0:l.namespace)===i)||(t==null?void 0:t[0]),c=t.map(l=>l.namespace).filter(l=>l!==void 0),u=oe.state.enableEmbedded?new Set([...c]):new Set([...(e==null?void 0:e.map(l=>l.chainNamespace))??[]]);((t==null?void 0:t.length)===0||!a)&&(Ue.noAdapters=!0),Ue.noAdapters||(Ue.activeChain=a==null?void 0:a.namespace,Ue.activeCaipNetwork=s,F.setChainNetworkData(a==null?void 0:a.namespace,{caipNetwork:s}),Ue.activeChain&&Ga.set({activeChain:a==null?void 0:a.namespace})),u.forEach(l=>{const d=e==null?void 0:e.filter(h=>h.chainNamespace===l);F.state.chains.set(l,{namespace:l,networkState:rr({...Q2,caipNetwork:d==null?void 0:d[0]}),accountState:rr(c8),caipNetworks:d??[],...r}),F.setRequestedCaipNetworks(d??[],l)})},removeAdapter(t){var e,r;if(Ue.activeChain===t){const n=Array.from(Ue.chains.entries()).find(([i])=>i!==t);if(n){const i=(r=(e=n[1])==null?void 0:e.caipNetworks)==null?void 0:r[0];i&&F.setActiveCaipNetwork(i)}}Ue.chains.delete(t)},addAdapter(t,{networkControllerClient:e,connectionControllerClient:r},n){Ue.chains.set(t.namespace,{namespace:t.namespace,networkState:{...Q2,caipNetwork:n[0]},accountState:c8,caipNetworks:n,connectionControllerClient:r,networkControllerClient:e}),F.setRequestedCaipNetworks((n==null?void 0:n.filter(i=>i.chainNamespace===t.namespace))??[],t.namespace)},addNetwork(t){var r;const e=Ue.chains.get(t.chainNamespace);if(e){const n=[...e.caipNetworks||[]];(r=e.caipNetworks)!=null&&r.find(i=>i.id===t.id)||n.push(t),Ue.chains.set(t.chainNamespace,{...e,caipNetworks:n}),F.setRequestedCaipNetworks(n,t.chainNamespace),ge.filterByNamespace(t.chainNamespace,!0)}},removeNetwork(t,e){var n,i,s;const r=Ue.chains.get(t);if(r){const o=((n=Ue.activeCaipNetwork)==null?void 0:n.id)===e,a=[...((i=r.caipNetworks)==null?void 0:i.filter(c=>c.id!==e))||[]];o&&((s=r==null?void 0:r.caipNetworks)!=null&&s[0])&&F.setActiveCaipNetwork(r.caipNetworks[0]),Ue.chains.set(t,{...r,caipNetworks:a}),F.setRequestedCaipNetworks(a||[],t),a.length===0&&ge.filterByNamespace(t,!1)}},setAdapterNetworkState(t,e){const r=Ue.chains.get(t);r&&(r.networkState={...r.networkState||Q2,...e},Ue.chains.set(t,r))},setChainAccountData(t,e,r=!0){if(!t)throw new Error("Chain is required to update chain account data");const n=Ue.chains.get(t);if(n){const i={...n.accountState||c8,...e};Ue.chains.set(t,{...n,accountState:i}),(Ue.chains.size===1||Ue.activeChain===t)&&(e.caipAddress&&(Ue.activeCaipAddress=e.caipAddress),re.replaceState(i))}},setChainNetworkData(t,e){if(!t)return;const r=Ue.chains.get(t);if(r){const n={...r.networkState||Q2,...e};Ue.chains.set(t,{...r,networkState:n})}},setAccountProp(t,e,r,n=!0){F.setChainAccountData(r,{[t]:e},n),t==="status"&&e==="disconnected"&&r&&ge.removeConnectorId(r)},setActiveNamespace(t){var n,i;Ue.activeChain=t;const e=t?Ue.chains.get(t):void 0,r=(n=e==null?void 0:e.networkState)==null?void 0:n.caipNetwork;r!=null&&r.id&&t&&(Ue.activeCaipAddress=(i=e==null?void 0:e.accountState)==null?void 0:i.caipAddress,Ue.activeCaipNetwork=r,F.setChainNetworkData(t,{caipNetwork:r}),Le.setActiveCaipNetworkId(r==null?void 0:r.caipNetworkId),Ga.set({activeChain:t,selectedNetworkId:r==null?void 0:r.caipNetworkId}))},setActiveCaipNetwork(t){var n,i,s;if(!t)return;Ue.activeChain!==t.chainNamespace&&F.setIsSwitchingNamespace(!0);const e=Ue.chains.get(t.chainNamespace);Ue.activeChain=t.chainNamespace,Ue.activeCaipNetwork=t,F.setChainNetworkData(t.chainNamespace,{caipNetwork:t}),(n=e==null?void 0:e.accountState)!=null&&n.address?Ue.activeCaipAddress=`${t.chainNamespace}:${t.id}:${(i=e==null?void 0:e.accountState)==null?void 0:i.address}`:Ue.activeCaipAddress=void 0,F.setAccountProp("caipAddress",Ue.activeCaipAddress,t.chainNamespace),e&&re.replaceState(e.accountState),Qe.resetSend(),Ga.set({activeChain:Ue.activeChain,selectedNetworkId:(s=Ue.activeCaipNetwork)==null?void 0:s.caipNetworkId}),Le.setActiveCaipNetworkId(t.caipNetworkId),!F.checkIfSupportedNetwork(t.chainNamespace)&&oe.state.enableNetworkSwitch&&!oe.state.allowUnsupportedChain&&!xe.state.wcBasic&&F.showUnsupportedChainUI()},addCaipNetwork(t){var r;if(!t)return;const e=Ue.chains.get(t.chainNamespace);e&&((r=e==null?void 0:e.caipNetworks)==null||r.push(t))},async switchActiveNamespace(t){var i;if(!t)return;const e=t!==F.state.activeChain,r=(i=F.getNetworkData(t))==null?void 0:i.caipNetwork,n=F.getCaipNetworkByNamespace(t,r==null?void 0:r.id);e&&n&&await F.switchActiveNetwork(n)},async switchActiveNetwork(t){var i;const e=F.state.chains.get(F.state.activeChain),r=!((i=e==null?void 0:e.caipNetworks)!=null&&i.some(s=>{var o;return s.id===((o=Ue.activeCaipNetwork)==null?void 0:o.id)})),n=F.getNetworkControllerClient(t.chainNamespace);if(n){try{await n.switchCaipNetwork(t),r&&We.close()}catch{X.goBack()}Re.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:t.caipNetworkId}})}},getNetworkControllerClient(t){const e=t||Ue.activeChain,r=Ue.chains.get(e);if(!r)throw new Error("Chain adapter not found");if(!r.networkControllerClient)throw new Error("NetworkController client not set");return r.networkControllerClient},getConnectionControllerClient(t){const e=t||Ue.activeChain;if(!e)throw new Error("Chain is required to get connection controller client");const r=Ue.chains.get(e);if(!(r!=null&&r.connectionControllerClient))throw new Error("ConnectionController client not set");return r.connectionControllerClient},getAccountProp(t,e){var i;let r=Ue.activeChain;if(e&&(r=e),!r)return;const n=(i=Ue.chains.get(r))==null?void 0:i.accountState;if(n)return n[t]},getNetworkProp(t,e){var n;const r=(n=Ue.chains.get(e))==null?void 0:n.networkState;if(r)return r[t]},getRequestedCaipNetworks(t){const e=Ue.chains.get(t),{approvedCaipNetworkIds:r=[],requestedCaipNetworks:n=[]}=(e==null?void 0:e.networkState)||{};return ue.sortRequestedNetworks(r,n)},getAllRequestedCaipNetworks(){const t=[];return Ue.chains.forEach(e=>{const r=F.getRequestedCaipNetworks(e.namespace);t.push(...r)}),t},setRequestedCaipNetworks(t,e){F.setAdapterNetworkState(e,{requestedCaipNetworks:t});const n=F.getAllRequestedCaipNetworks().map(s=>s.chainNamespace),i=Array.from(new Set(n));ge.filterByNamespaces(i)},getAllApprovedCaipNetworkIds(){const t=[];return Ue.chains.forEach(e=>{const r=F.getApprovedCaipNetworkIds(e.namespace);t.push(...r)}),t},getActiveCaipNetwork(){return Ue.activeCaipNetwork},getActiveCaipAddress(){return Ue.activeCaipAddress},getApprovedCaipNetworkIds(t){var n;const e=Ue.chains.get(t);return((n=e==null?void 0:e.networkState)==null?void 0:n.approvedCaipNetworkIds)||[]},async setApprovedCaipNetworksData(t){const e=F.getNetworkControllerClient(),r=await(e==null?void 0:e.getApprovedCaipNetworksData());F.setAdapterNetworkState(t,{approvedCaipNetworkIds:r==null?void 0:r.approvedCaipNetworkIds,supportsAllNetworks:r==null?void 0:r.supportsAllNetworks})},checkIfSupportedNetwork(t,e){const r=e||Ue.activeCaipNetwork,n=F.getRequestedCaipNetworks(t);return n.length?n==null?void 0:n.some(i=>i.id===(r==null?void 0:r.id)):!0},checkIfSupportedChainId(t){if(!Ue.activeChain)return!0;const e=F.getRequestedCaipNetworks(Ue.activeChain);return e==null?void 0:e.some(r=>r.id===t)},setSmartAccountEnabledNetworks(t,e){F.setAdapterNetworkState(e,{smartAccountEnabledNetworks:t})},checkIfSmartAccountEnabled(){var n;const t=AV.caipNetworkIdToNumber((n=Ue.activeCaipNetwork)==null?void 0:n.caipNetworkId),e=Ue.activeChain;if(!e||!t)return!1;const r=F.getNetworkProp("smartAccountEnabledNetworks",e);return!!(r!=null&&r.includes(Number(t)))},getActiveNetworkTokenAddress(){var n,i;const t=((n=Ue.activeCaipNetwork)==null?void 0:n.chainNamespace)||"eip155",e=((i=Ue.activeCaipNetwork)==null?void 0:i.id)||1,r=ct.NATIVE_TOKEN_ADDRESS[t];return`${t}:${e}:${r}`},showUnsupportedChainUI(){We.open({view:"UnsupportedChain"})},checkIfNamesSupported(){const t=Ue.activeCaipNetwork;return!!(t!=null&&t.chainNamespace&&ct.NAMES_SUPPORTED_CHAIN_NAMESPACES.includes(t.chainNamespace))},resetNetwork(t){F.setAdapterNetworkState(t,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]})},resetAccount(t){const e=t;if(!e)throw new Error("Chain is required to set account prop");Ue.activeCaipAddress=void 0,F.setChainAccountData(e,{smartAccountDeployed:!1,currentTab:0,caipAddress:void 0,address:void 0,balance:void 0,balanceSymbol:void 0,profileName:void 0,profileImage:void 0,addressExplorerUrl:void 0,tokenBalance:[],connectedWalletInfo:void 0,preferredAccountTypes:void 0,socialProvider:void 0,socialWindow:void 0,farcasterUrl:void 0,allAccounts:[],user:void 0,status:"disconnected"}),ge.removeConnectorId(e)},setIsSwitchingNamespace(t){Ue.isSwitchingNamespace=t},getFirstCaipNetworkSupportsAuthConnector(){var r,n;const t=[];let e;if(Ue.chains.forEach(i=>{_e.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(s=>s===i.namespace)&&i.namespace&&t.push(i.namespace)}),t.length>0){const i=t[0];return e=i?(n=(r=Ue.chains.get(i))==null?void 0:r.caipNetworks)==null?void 0:n[0]:void 0,e}},getAccountData(t){var e;return t?(e=F.state.chains.get(t))==null?void 0:e.accountState:re.state},getNetworkData(t){var r;const e=t||Ue.activeChain;if(e)return(r=F.state.chains.get(e))==null?void 0:r.networkState},getCaipNetworkByNamespace(t,e){var i,s,o;if(!t)return;const r=F.state.chains.get(t),n=(i=r==null?void 0:r.caipNetworks)==null?void 0:i.find(a=>a.id===e);return n||((s=r==null?void 0:r.networkState)==null?void 0:s.caipNetwork)||((o=r==null?void 0:r.caipNetworks)==null?void 0:o[0])},getRequestedCaipNetworkIds(){const t=ge.state.filterByNamespace;return(t?[Ue.chains.get(t)]:Array.from(Ue.chains.values())).flatMap(r=>(r==null?void 0:r.caipNetworks)||[]).map(r=>r.caipNetworkId)},getCaipNetworks(t){return t?F.getRequestedCaipNetworks(t):F.getAllRequestedCaipNetworks()}},F=Pi(Rie),kie={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},DV=ue.getBlockchainApiUrl(),$i=rr({clientId:null,api:new Av({baseUrl:DV,clientId:null}),supportedChains:{http:[],ws:[]}}),Xe={state:$i,async get(t){const{st:e,sv:r}=Xe.getSdkProperties(),n=oe.state.projectId,i={...t.params||{},st:e,sv:r,projectId:n};return $i.api.get({...t,params:i})},getSdkProperties(){const{sdkType:t,sdkVersion:e}=oe.state;return{st:t||"unknown",sv:e||"unknown"}},async isNetworkSupported(t){if(!t)return!1;try{$i.supportedChains.http.length||await Xe.getSupportedNetworks()}catch{return!1}return $i.supportedChains.http.includes(t)},async getSupportedNetworks(){try{const t=await Xe.get({path:"v1/supported-chains"});return $i.supportedChains=t,t}catch{return $i.supportedChains}},async fetchIdentity({address:t,caipNetworkId:e}){if(!await Xe.isNetworkSupported(e))return{avatar:"",name:""};const n=Le.getIdentityFromCacheForAddress(t);if(n)return n;const i=await Xe.get({path:`/v1/identity/${t}`,params:{sender:F.state.activeCaipAddress?ue.getPlainAddress(F.state.activeCaipAddress):void 0}});return Le.updateIdentityCache({address:t,identity:i,timestamp:Date.now()}),i},async fetchTransactions({account:t,cursor:e,onramp:r,signal:n,cache:i,chainId:s}){var a;return await Xe.isNetworkSupported((a=F.state.activeCaipNetwork)==null?void 0:a.caipNetworkId)?Xe.get({path:`/v1/account/${t}/history`,params:{cursor:e,onramp:r,chainId:s},signal:n,cache:i}):{data:[],next:void 0}},async fetchSwapQuote({amount:t,userAddress:e,from:r,to:n,gasPrice:i}){var o;return await Xe.isNetworkSupported((o=F.state.activeCaipNetwork)==null?void 0:o.caipNetworkId)?Xe.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{amount:t,userAddress:e,from:r,to:n,gasPrice:i}}):{quotes:[]}},async fetchSwapTokens({chainId:t}){var r;return await Xe.isNetworkSupported((r=F.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)?Xe.get({path:"/v1/convert/tokens",params:{chainId:t}}):{tokens:[]}},async fetchTokenPrice({addresses:t}){var r;return await Xe.isNetworkSupported((r=F.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)?$i.api.post({path:"/v1/fungible/price",body:{currency:"usd",addresses:t,projectId:oe.state.projectId},headers:{"Content-Type":"application/json"}}):{fungibles:[]}},async fetchSwapAllowance({tokenAddress:t,userAddress:e}){var n;return await Xe.isNetworkSupported((n=F.state.activeCaipNetwork)==null?void 0:n.caipNetworkId)?Xe.get({path:"/v1/convert/allowance",params:{tokenAddress:t,userAddress:e},headers:{"Content-Type":"application/json"}}):{allowance:"0"}},async fetchGasPrice({chainId:t}){var i;const{st:e,sv:r}=Xe.getSdkProperties();if(!await Xe.isNetworkSupported((i=F.state.activeCaipNetwork)==null?void 0:i.caipNetworkId))throw new Error("Network not supported for Gas Price");return Xe.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json"},params:{chainId:t,st:e,sv:r}})},async generateSwapCalldata({amount:t,from:e,to:r,userAddress:n,disableEstimate:i}){var o;if(!await Xe.isNetworkSupported((o=F.state.activeCaipNetwork)==null?void 0:o.caipNetworkId))throw new Error("Network not supported for Swaps");return $i.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:t,eip155:{slippage:ct.CONVERT_SLIPPAGE_TOLERANCE},projectId:oe.state.projectId,from:e,to:r,userAddress:n,disableEstimate:i}})},async generateApproveCalldata({from:t,to:e,userAddress:r}){var o;const{st:n,sv:i}=Xe.getSdkProperties();if(!await Xe.isNetworkSupported((o=F.state.activeCaipNetwork)==null?void 0:o.caipNetworkId))throw new Error("Network not supported for Swaps");return Xe.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json"},params:{userAddress:r,from:t,to:e,st:n,sv:i}})},async getBalance(t,e,r){var u;const{st:n,sv:i}=Xe.getSdkProperties();if(!await Xe.isNetworkSupported((u=F.state.activeCaipNetwork)==null?void 0:u.caipNetworkId))return Fe.showError("Token Balance Unavailable"),{balances:[]};const o=`${e}:${t}`,a=Le.getBalanceCacheForCaipAddress(o);if(a)return a;const c=await Xe.get({path:`/v1/account/${t}/balance`,params:{currency:"usd",chainId:e,forceUpdate:r,st:n,sv:i}});return Le.updateBalanceCache({caipAddress:o,balance:c,timestamp:Date.now()}),c},async lookupEnsName(t){var r;return await Xe.isNetworkSupported((r=F.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)?Xe.get({path:`/v1/profile/account/${t}`,params:{apiVersion:"2"}}):{addresses:{},attributes:[]}},async reverseLookupEnsName({address:t}){var r;return await Xe.isNetworkSupported((r=F.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)?Xe.get({path:`/v1/profile/reverse/${t}`,params:{sender:re.state.address,apiVersion:"2"}}):[]},async getEnsNameSuggestions(t){var r;return await Xe.isNetworkSupported((r=F.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)?Xe.get({path:`/v1/profile/suggestions/${t}`,params:{zone:"reown.id"}}):{suggestions:[]}},async registerEnsName({coinType:t,address:e,message:r,signature:n}){var s;return await Xe.isNetworkSupported((s=F.state.activeCaipNetwork)==null?void 0:s.caipNetworkId)?$i.api.post({path:"/v1/profile/account",body:{coin_type:t,address:e,message:r,signature:n},headers:{"Content-Type":"application/json"}}):{success:!1}},async generateOnRampURL({destinationWallets:t,partnerUserId:e,defaultNetwork:r,purchaseAmount:n,paymentAmount:i}){var a;return await Xe.isNetworkSupported((a=F.state.activeCaipNetwork)==null?void 0:a.caipNetworkId)?(await $i.api.post({path:"/v1/generators/onrampurl",params:{projectId:oe.state.projectId},body:{destinationWallets:t,defaultNetwork:r,partnerUserId:e,defaultExperience:"buy",presetCryptoAmount:n,presetFiatAmount:i}})).url:""},async getOnrampOptions(){var e;if(!await Xe.isNetworkSupported((e=F.state.activeCaipNetwork)==null?void 0:e.caipNetworkId))return{paymentCurrencies:[],purchaseCurrencies:[]};try{return await Xe.get({path:"/v1/onramp/options"})}catch{return kie}},async getOnrampQuote({purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}){var i;try{return await Xe.isNetworkSupported((i=F.state.activeCaipNetwork)==null?void 0:i.caipNetworkId)?await $i.api.post({path:"/v1/onramp/quote",params:{projectId:oe.state.projectId},body:{purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}}):null}catch{return{coinbaseFee:{amount:r,currency:e.id},networkFee:{amount:r,currency:e.id},paymentSubtotal:{amount:r,currency:e.id},paymentTotal:{amount:r,currency:e.id},purchaseAmount:{amount:r,currency:e.id},quoteId:"mocked-quote-id"}}},async getSmartSessions(t){var r;return await Xe.isNetworkSupported((r=F.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)?Xe.get({path:`/v1/sessions/${t}`}):[]},async revokeSmartSession(t,e,r){var i;return await Xe.isNetworkSupported((i=F.state.activeCaipNetwork)==null?void 0:i.caipNetworkId)?$i.api.post({path:`/v1/sessions/${t}/revoke`,params:{projectId:oe.state.projectId},body:{pci:e,signature:r}}):{success:!1}},setClientId(t){$i.clientId=t,$i.api=new Av({baseUrl:DV,clientId:t})}},Ls=rr({currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]}),Nie={state:Ls,replaceState(t){t&&Object.assign(Ls,Nf(t))},subscribe(t){return F.subscribeChainProp("accountState",e=>{if(e)return t(e)})},subscribeKey(t,e,r){let n;return F.subscribeChainProp("accountState",i=>{if(i){const s=i[t];n!==s&&(n=s,e(s))}},r)},setStatus(t,e){F.setAccountProp("status",t,e)},getCaipAddress(t){return F.getAccountProp("caipAddress",t)},setCaipAddress(t,e){const r=t?ue.getPlainAddress(t):void 0;e===F.state.activeChain&&(F.state.activeCaipAddress=t),F.setAccountProp("caipAddress",t,e),F.setAccountProp("address",r,e)},setBalance(t,e,r){F.setAccountProp("balance",t,r),F.setAccountProp("balanceSymbol",e,r)},setProfileName(t,e){F.setAccountProp("profileName",t,e)},setProfileImage(t,e){F.setAccountProp("profileImage",t,e)},setUser(t,e){F.setAccountProp("user",t,e)},setAddressExplorerUrl(t,e){F.setAccountProp("addressExplorerUrl",t,e)},setSmartAccountDeployed(t,e){F.setAccountProp("smartAccountDeployed",t,e)},setCurrentTab(t){F.setAccountProp("currentTab",t,F.state.activeChain)},setTokenBalance(t,e){t&&F.setAccountProp("tokenBalance",t,e)},setShouldUpdateToAddress(t,e){F.setAccountProp("shouldUpdateToAddress",t,e)},setAllAccounts(t,e){F.setAccountProp("allAccounts",t,e)},addAddressLabel(t,e,r){const n=F.getAccountProp("addressLabels",r)||new Map;n.set(t,e),F.setAccountProp("addressLabels",n,r)},removeAddressLabel(t,e){const r=F.getAccountProp("addressLabels",e)||new Map;r.delete(t),F.setAccountProp("addressLabels",r,e)},setConnectedWalletInfo(t,e){F.setAccountProp("connectedWalletInfo",t,e,!1)},setPreferredAccountType(t,e){F.setAccountProp("preferredAccountTypes",{...Ls.preferredAccountTypes,[e]:t},e)},setPreferredAccountTypes(t){Ls.preferredAccountTypes=t},setSocialProvider(t,e){t&&F.setAccountProp("socialProvider",t,e)},setSocialWindow(t,e){F.setAccountProp("socialWindow",t?Nf(t):void 0,e)},setFarcasterUrl(t,e){F.setAccountProp("farcasterUrl",t,e)},async fetchTokenBalance(t){var s,o;Ls.balanceLoading=!0;const e=(s=F.state.activeCaipNetwork)==null?void 0:s.caipNetworkId,r=(o=F.state.activeCaipNetwork)==null?void 0:o.chainNamespace,n=F.state.activeCaipAddress,i=n?ue.getPlainAddress(n):void 0;if(Ls.lastRetry&&!ue.isAllowedRetry(Ls.lastRetry,30*ct.ONE_SEC_MS))return Ls.balanceLoading=!1,[];try{if(i&&e&&r){const c=(await Xe.getBalance(i,e)).balances.filter(u=>u.quantity.decimals!=="0");return re.setTokenBalance(c,r),Ls.lastRetry=void 0,Ls.balanceLoading=!1,c}}catch(a){Ls.lastRetry=Date.now(),t==null||t(a),Fe.showError("Token Balance Unavailable")}finally{Ls.balanceLoading=!1}return[]},resetAccount(t){F.resetAccount(t)}},re=Pi(Nie),MV={onSwitchNetwork({network:t,ignoreSwitchConfirmation:e=!1}){const r=F.state.activeCaipNetwork,n=X.state.data;if(t.id===(r==null?void 0:r.id))return;const s=re.getCaipAddress(F.state.activeChain),o=t.chainNamespace!==F.state.activeChain,a=re.getCaipAddress(t.chainNamespace),u=ge.getConnectorId(F.state.activeChain)===_e.CONNECTOR_ID.AUTH,l=_e.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(d=>d===t.chainNamespace);e||u&&l?X.push("SwitchNetwork",{...n,network:t}):s&&o&&!a?X.push("SwitchActiveChain",{switchToChain:t.chainNamespace,navigateTo:"Connect",navigateWithReplace:!0,network:t}):X.push("SwitchNetwork",{...n,network:t})}},ji=rr({loading:!1,loadingNamespaceMap:new Map,open:!1,shake:!1,namespace:void 0}),$ie={state:ji,subscribe(t){return ln(ji,()=>t(ji))},subscribeKey(t,e){return dn(ji,t,e)},async open(t){var o,a;const e=re.state.status==="connected",r=t==null?void 0:t.namespace,n=F.state.activeChain,i=r&&r!==n,s=(o=F.getAccountData(t==null?void 0:t.namespace))==null?void 0:o.caipAddress;if(xe.state.wcBasic?Ne.prefetch({fetchNetworkImages:!1,fetchConnectorImages:!1}):await Ne.prefetch({fetchConnectorImages:!e,fetchFeaturedWallets:!e,fetchRecommendedWallets:!e}),ge.setFilterByNamespace(t==null?void 0:t.namespace),We.setLoading(!0,r),r&&i){const c=((a=F.getNetworkData(r))==null?void 0:a.caipNetwork)||F.getRequestedCaipNetworks(r)[0];c&&MV.onSwitchNetwork({network:c,ignoreSwitchConfirmation:!0})}else{const c=F.state.noAdapters;oe.state.manualWCControl||c&&!s?ue.isMobile()?X.reset("AllWallets"):X.reset("ConnectingWalletConnectBasic"):t!=null&&t.view?X.reset(t.view,t.data):s?X.reset("Account"):X.reset("Connect")}ji.open=!0,Ga.set({open:!0}),Re.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:!!s}})},close(){const t=oe.state.enableEmbedded,e=!!F.state.activeCaipAddress;ji.open&&Re.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:e}}),ji.open=!1,X.reset("Connect"),We.clearLoading(),t?e?X.replace("Account"):X.push("Connect"):Ga.set({open:!1}),xe.resetUri()},setLoading(t,e){e&&ji.loadingNamespaceMap.set(e,t),ji.loading=t,Ga.set({loading:t})},clearLoading(){ji.loadingNamespaceMap.clear(),ji.loading=!1},shake(){ji.shake||(ji.shake=!0,setTimeout(()=>{ji.shake=!1},500))}},We=Pi($ie),lb={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},eI={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},jie={providers:PV,selectedProvider:null,error:null,purchaseCurrency:lb,paymentCurrency:eI,purchaseCurrencies:[lb],paymentCurrencies:[],quotesLoading:!1},Bt=rr(jie),Bie={state:Bt,subscribe(t){return ln(Bt,()=>t(Bt))},subscribeKey(t,e){return dn(Bt,t,e)},setSelectedProvider(t){if(t&&t.name==="meld"){const e=F.state.activeChain===_e.CHAIN.SOLANA?"SOL":"USDC",r=re.state.address??"",n=new URL(t.url);n.searchParams.append("publicKey",Pne),n.searchParams.append("destinationCurrencyCode",e),n.searchParams.append("walletAddress",r),n.searchParams.append("externalCustomerId",oe.state.projectId),Bt.selectedProvider={...t,url:n.toString()}}else Bt.selectedProvider=t},setOnrampProviders(t){if(Array.isArray(t)&&t.every(e=>typeof e=="string")){const e=t,r=PV.filter(n=>e.includes(n.name));Bt.providers=r}else Bt.providers=[]},setPurchaseCurrency(t){Bt.purchaseCurrency=t},setPaymentCurrency(t){Bt.paymentCurrency=t},setPurchaseAmount(t){$t.state.purchaseAmount=t},setPaymentAmount(t){$t.state.paymentAmount=t},async getAvailableCurrencies(){const t=await Xe.getOnrampOptions();Bt.purchaseCurrencies=t.purchaseCurrencies,Bt.paymentCurrencies=t.paymentCurrencies,Bt.paymentCurrency=t.paymentCurrencies[0]||eI,Bt.purchaseCurrency=t.purchaseCurrencies[0]||lb,await Ne.fetchCurrencyImages(t.paymentCurrencies.map(e=>e.id)),await Ne.fetchTokenImages(t.purchaseCurrencies.map(e=>e.symbol))},async getQuote(){var t,e;Bt.quotesLoading=!0;try{const r=await Xe.getOnrampQuote({purchaseCurrency:Bt.purchaseCurrency,paymentCurrency:Bt.paymentCurrency,amount:((t=Bt.paymentAmount)==null?void 0:t.toString())||"0",network:(e=Bt.purchaseCurrency)==null?void 0:e.symbol});return Bt.quotesLoading=!1,Bt.purchaseAmount=Number(r==null?void 0:r.purchaseAmount.amount),r}catch(r){return Bt.error=r.message,Bt.quotesLoading=!1,null}finally{Bt.quotesLoading=!1}},resetState(){Bt.selectedProvider=null,Bt.error=null,Bt.purchaseCurrency=lb,Bt.paymentCurrency=eI,Bt.purchaseCurrencies=[lb],Bt.paymentCurrencies=[],Bt.paymentAmount=void 0,Bt.purchaseAmount=void 0,Bt.quotesLoading=!1}},$t=Pi(Bie),u8={async getTokenList(){var n;const t=F.state.activeCaipNetwork,e=await Xe.fetchSwapTokens({chainId:t==null?void 0:t.caipNetworkId});return((n=e==null?void 0:e.tokens)==null?void 0:n.map(i=>({...i,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0})))||[]},async fetchGasPrice(){var e;const t=F.state.activeCaipNetwork;if(!t)return null;try{switch(t.chainNamespace){case"solana":const r=(e=await(xe==null?void 0:xe.estimateGas({chainNamespace:"solana"})))==null?void 0:e.toString();return{standard:r,fast:r,instant:r};case"eip155":default:return await Xe.fetchGasPrice({chainId:t.caipNetworkId})}}catch{return null}},async fetchSwapAllowance({tokenAddress:t,userAddress:e,sourceTokenAmount:r,sourceTokenDecimals:n}){const i=await Xe.fetchSwapAllowance({tokenAddress:t,userAddress:e});if(i!=null&&i.allowance&&r&&n){const s=xe.parseUnits(r,n)||0;return BigInt(i.allowance)>=s}return!1},async getMyTokensWithBalance(t){const e=re.state.address,r=F.state.activeCaipNetwork;if(!e||!r)return[];const i=(await Xe.getBalance(e,r.caipNetworkId,t)).balances.filter(s=>s.quantity.decimals!=="0");return re.setTokenBalance(i,F.state.activeChain),this.mapBalancesToSwapTokens(i)},mapBalancesToSwapTokens(t){return(t==null?void 0:t.map(e=>({...e,address:e!=null&&e.address?e.address:F.getActiveNetworkTokenAddress(),decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1})))||[]}},Nl={getGasPriceInEther(t,e){const r=e*t;return Number(r)/1e18},getGasPriceInUSD(t,e,r){const n=Nl.getGasPriceInEther(e,r);return Dt.bigNumber(t).times(n).toNumber()},getPriceImpact({sourceTokenAmount:t,sourceTokenPriceInUSD:e,toTokenPriceInUSD:r,toTokenAmount:n}){const i=Dt.bigNumber(t).times(e),s=Dt.bigNumber(n).times(r);return i.minus(s).div(i).times(100).toNumber()},getMaxSlippage(t,e){const r=Dt.bigNumber(t).div(100);return Dt.multiply(e,r).toNumber()},getProviderFee(t,e=.0085){return Dt.bigNumber(t).times(e).toString()},isInsufficientNetworkTokenForGas(t,e){const r=e||"0";return Dt.bigNumber(t).eq(0)?!0:Dt.bigNumber(Dt.bigNumber(r)).gt(t)},isInsufficientSourceTokenForSwap(t,e,r){var s,o;const n=(o=(s=r==null?void 0:r.find(a=>a.address===e))==null?void 0:s.quantity)==null?void 0:o.numeric;return Dt.bigNumber(n||"0").lt(t)},getToTokenAmount({sourceToken:t,toToken:e,sourceTokenPrice:r,toTokenPrice:n,sourceTokenAmount:i}){if(i==="0"||!t||!e)return"0";const s=t.decimals,o=r,a=e.decimals,c=n;if(c<=0)return"0";const u=Dt.bigNumber(i).times(.0085),d=Dt.bigNumber(i).minus(u).times(Dt.bigNumber(10).pow(s)),h=Dt.bigNumber(o).div(c),f=s-a;return d.times(h).div(Dt.bigNumber(10).pow(f)).div(Dt.bigNumber(10).pow(a)).toFixed(a).toString()}},ik=15e4,Die=6,fi={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:ct.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},le=rr(fi),W4={state:le,subscribe(t){return ln(le,()=>t(le))},subscribeKey(t,e){return dn(le,t,e)},getParams(){var c,u,l,d,h,f,g,p;const t=F.state.activeCaipAddress,e=F.state.activeChain,r=ue.getPlainAddress(t),n=F.getActiveNetworkTokenAddress(),i=ge.getConnectorId(e);if(!r)throw new Error("No address found to swap the tokens from.");const s=!((c=le.toToken)!=null&&c.address)||!((u=le.toToken)!=null&&u.decimals),o=!((l=le.sourceToken)!=null&&l.address)||!((d=le.sourceToken)!=null&&d.decimals)||!Dt.bigNumber(le.sourceTokenAmount).gt(0),a=!le.sourceTokenAmount;return{networkAddress:n,fromAddress:r,fromCaipAddress:t,sourceTokenAddress:(h=le.sourceToken)==null?void 0:h.address,toTokenAddress:(f=le.toToken)==null?void 0:f.address,toTokenAmount:le.toTokenAmount,toTokenDecimals:(g=le.toToken)==null?void 0:g.decimals,sourceTokenAmount:le.sourceTokenAmount,sourceTokenDecimals:(p=le.sourceToken)==null?void 0:p.decimals,invalidToToken:s,invalidSourceToken:o,invalidSourceTokenAmount:a,availableToSwap:t&&!s&&!o&&!a,isAuthConnector:i===_e.CONNECTOR_ID.AUTH}},setSourceToken(t){if(!t){le.sourceToken=t,le.sourceTokenAmount="",le.sourceTokenPriceInUSD=0;return}le.sourceToken=t,ye.setTokenPrice(t.address,"sourceToken")},setSourceTokenAmount(t){le.sourceTokenAmount=t},setToToken(t){if(!t){le.toToken=t,le.toTokenAmount="",le.toTokenPriceInUSD=0;return}le.toToken=t,ye.setTokenPrice(t.address,"toToken")},setToTokenAmount(t){le.toTokenAmount=t?Dt.formatNumberToLocalString(t,Die):""},async setTokenPrice(t,e){let r=le.tokensPriceMap[t]||0;r||(le.loadingPrices=!0,r=await ye.getAddressPrice(t)),e==="sourceToken"?le.sourceTokenPriceInUSD=r:e==="toToken"&&(le.toTokenPriceInUSD=r),le.loadingPrices&&(le.loadingPrices=!1),ye.getParams().availableToSwap&&ye.swapTokens()},switchTokens(){if(le.initializing||!le.initialized)return;const t=le.toToken?{...le.toToken}:void 0,e=le.sourceToken?{...le.sourceToken}:void 0,r=t&&le.toTokenAmount===""?"1":le.toTokenAmount;ye.setSourceToken(t),ye.setToToken(e),ye.setSourceTokenAmount(r),ye.setToTokenAmount(""),ye.swapTokens()},resetState(){le.myTokensWithBalance=fi.myTokensWithBalance,le.tokensPriceMap=fi.tokensPriceMap,le.initialized=fi.initialized,le.sourceToken=fi.sourceToken,le.sourceTokenAmount=fi.sourceTokenAmount,le.sourceTokenPriceInUSD=fi.sourceTokenPriceInUSD,le.toToken=fi.toToken,le.toTokenAmount=fi.toTokenAmount,le.toTokenPriceInUSD=fi.toTokenPriceInUSD,le.networkPrice=fi.networkPrice,le.networkTokenSymbol=fi.networkTokenSymbol,le.networkBalanceInUSD=fi.networkBalanceInUSD,le.inputError=fi.inputError,le.myTokensWithBalance=fi.myTokensWithBalance},resetValues(){var r;const{networkAddress:t}=ye.getParams(),e=(r=le.tokens)==null?void 0:r.find(n=>n.address===t);ye.setSourceToken(e),ye.setToToken(void 0)},getApprovalLoadingState(){return le.loadingApprovalTransaction},clearError(){le.transactionError=void 0},async initializeState(){if(!le.initializing){if(le.initializing=!0,!le.initialized)try{await ye.fetchTokens(),le.initialized=!0}catch{le.initialized=!1,Fe.showError("Failed to initialize swap"),X.goBack()}le.initializing=!1}},async fetchTokens(){var r;const{networkAddress:t}=ye.getParams();await ye.getTokenList(),await ye.getNetworkTokenPrice(),await ye.getMyTokensWithBalance();const e=(r=le.tokens)==null?void 0:r.find(n=>n.address===t);e&&(le.networkTokenSymbol=e.symbol,ye.setSourceToken(e),ye.setSourceTokenAmount("1"))},async getTokenList(){const t=await u8.getTokenList();le.tokens=t,le.popularTokens=t.sort((e,r)=>e.symbol<r.symbol?-1:e.symbol>r.symbol?1:0),le.suggestedTokens=t.filter(e=>!!ct.SWAP_SUGGESTED_TOKENS.includes(e.symbol),{})},async getAddressPrice(t){var c,u;const e=le.tokensPriceMap[t];if(e)return e;const r=await Xe.fetchTokenPrice({addresses:[t]}),n=(r==null?void 0:r.fungibles)||[],i=[...le.tokens||[],...le.myTokensWithBalance||[]],s=(c=i==null?void 0:i.find(l=>l.address===t))==null?void 0:c.symbol,o=((u=n.find(l=>l.symbol.toLowerCase()===(s==null?void 0:s.toLowerCase())))==null?void 0:u.price)||0,a=parseFloat(o.toString());return le.tokensPriceMap[t]=a,a},async getNetworkTokenPrice(){var i;const{networkAddress:t}=ye.getParams(),r=(i=(await Xe.fetchTokenPrice({addresses:[t]}).catch(()=>(Fe.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles)==null?void 0:i[0],n=(r==null?void 0:r.price.toString())||"0";le.tokensPriceMap[t]=parseFloat(n),le.networkTokenSymbol=(r==null?void 0:r.symbol)||"",le.networkPrice=n},async getMyTokensWithBalance(t){const e=await yC.getMyTokensWithBalance(t),r=yC.mapBalancesToSwapTokens(e);r&&(await ye.getInitialGasPrice(),ye.setBalances(r))},setBalances(t){const{networkAddress:e}=ye.getParams(),r=F.state.activeCaipNetwork;if(!r)return;const n=t.find(i=>i.address===e);t.forEach(i=>{le.tokensPriceMap[i.address]=i.price||0}),le.myTokensWithBalance=t.filter(i=>i.address.startsWith(r.caipNetworkId)),le.networkBalanceInUSD=n?Dt.multiply(n.quantity.numeric,n.price).toString():"0"},async getInitialGasPrice(){var e,r;const t=await u8.fetchGasPrice();if(!t)return{gasPrice:null,gasPriceInUSD:null};switch((r=(e=F.state)==null?void 0:e.activeCaipNetwork)==null?void 0:r.chainNamespace){case"solana":return le.gasFee=t.standard??"0",le.gasPriceInUSD=Dt.multiply(t.standard,le.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(le.gasFee),gasPriceInUSD:Number(le.gasPriceInUSD)};case"eip155":default:const n=t.standard??"0",i=BigInt(n),s=BigInt(ik),o=Nl.getGasPriceInUSD(le.networkPrice,s,i);return le.gasFee=n,le.gasPriceInUSD=o,{gasPrice:i,gasPriceInUSD:o}}},async swapTokens(){var s,o;const t=re.state.address,e=le.sourceToken,r=le.toToken,n=Dt.bigNumber(le.sourceTokenAmount).gt(0);if(n||ye.setToTokenAmount(""),!r||!e||le.loadingPrices||!n)return;le.loadingQuote=!0;const i=Dt.bigNumber(le.sourceTokenAmount).times(10**e.decimals).round(0);try{const a=await Xe.fetchSwapQuote({userAddress:t,from:e.address,to:r.address,gasPrice:le.gasFee,amount:i.toString()});le.loadingQuote=!1;const c=(o=(s=a==null?void 0:a.quotes)==null?void 0:s[0])==null?void 0:o.toAmount;if(!c){Fn.open({shortMessage:"Incorrect amount",longMessage:"Please enter a valid amount"},"error");return}const u=Dt.bigNumber(c).div(10**r.decimals).toString();ye.setToTokenAmount(u),ye.hasInsufficientToken(le.sourceTokenAmount,e.address)?le.inputError="Insufficient balance":(le.inputError=void 0,ye.setTransactionDetails())}catch{le.loadingQuote=!1,le.inputError="Insufficient balance"}},async getTransaction(){const{fromCaipAddress:t,availableToSwap:e}=ye.getParams(),r=le.sourceToken,n=le.toToken;if(!(!t||!e||!r||!n||le.loadingQuote))try{le.loadingBuildTransaction=!0;const i=await u8.fetchSwapAllowance({userAddress:t,tokenAddress:r.address,sourceTokenAmount:le.sourceTokenAmount,sourceTokenDecimals:r.decimals});let s;return i?s=await ye.createSwapTransaction():s=await ye.createAllowanceTransaction(),le.loadingBuildTransaction=!1,le.fetchError=!1,s}catch{X.goBack(),Fe.showError("Failed to check allowance"),le.loadingBuildTransaction=!1,le.approvalTransaction=void 0,le.swapTransaction=void 0,le.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:t,sourceTokenAddress:e,toTokenAddress:r}=ye.getParams();if(!(!t||!r)){if(!e)throw new Error("createAllowanceTransaction - No source token address found.");try{const n=await Xe.generateApproveCalldata({from:e,to:r,userAddress:t}),i={data:n.tx.data,to:ue.getPlainAddress(n.tx.from),gasPrice:BigInt(n.tx.eip155.gasPrice),value:BigInt(n.tx.value),toAmount:le.toTokenAmount};return le.swapTransaction=void 0,le.approvalTransaction={data:i.data,to:i.to,gasPrice:i.gasPrice,value:i.value,toAmount:i.toAmount},{data:i.data,to:i.to,gasPrice:i.gasPrice,value:i.value,toAmount:i.toAmount}}catch{X.goBack(),Fe.showError("Failed to create approval transaction"),le.approvalTransaction=void 0,le.swapTransaction=void 0,le.fetchError=!0;return}}},async createSwapTransaction(){var o;const{networkAddress:t,fromCaipAddress:e,sourceTokenAmount:r}=ye.getParams(),n=le.sourceToken,i=le.toToken;if(!e||!r||!n||!i)return;const s=(o=xe.parseUnits(r,n.decimals))==null?void 0:o.toString();try{const a=await Xe.generateSwapCalldata({userAddress:e,from:n.address,to:i.address,amount:s,disableEstimate:!0}),c=n.address===t,u=BigInt(a.tx.eip155.gas),l=BigInt(a.tx.eip155.gasPrice),d={data:a.tx.data,to:ue.getPlainAddress(a.tx.to),gas:u,gasPrice:l,value:BigInt(c?s??"0":"0"),toAmount:le.toTokenAmount};return le.gasPriceInUSD=Nl.getGasPriceInUSD(le.networkPrice,u,l),le.approvalTransaction=void 0,le.swapTransaction=d,d}catch{X.goBack(),Fe.showError("Failed to create transaction"),le.approvalTransaction=void 0,le.swapTransaction=void 0,le.fetchError=!0;return}},async sendTransactionForApproval(t){var i,s,o,a;const{fromAddress:e,isAuthConnector:r}=ye.getParams();le.loadingApprovalTransaction=!0;const n="Approve limit increase in your wallet";r?X.pushTransactionStack({onSuccess(){Fe.showLoading(n)}}):Fe.showLoading(n);try{await xe.sendTransaction({address:e,to:t.to,data:t.data,value:t.value,chainNamespace:"eip155"}),await ye.swapTokens(),await ye.getTransaction(),le.approvalTransaction=void 0,le.loadingApprovalTransaction=!1}catch(c){const u=c;le.transactionError=u==null?void 0:u.shortMessage,le.loadingApprovalTransaction=!1,Fe.showError((u==null?void 0:u.shortMessage)||"Transaction error"),Re.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:(u==null?void 0:u.shortMessage)||(u==null?void 0:u.message)||"Unknown",network:((i=F.state.activeCaipNetwork)==null?void 0:i.caipNetworkId)||"",swapFromToken:((s=ye.state.sourceToken)==null?void 0:s.symbol)||"",swapToToken:((o=ye.state.toToken)==null?void 0:o.symbol)||"",swapFromAmount:ye.state.sourceTokenAmount||"",swapToAmount:ye.state.toTokenAmount||"",isSmartAccount:((a=re.state.preferredAccountTypes)==null?void 0:a.eip155)===bt.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(t){var o,a,c,u,l,d,h,f,g,p,m,b,v,E;if(!t)return;const{fromAddress:e,toTokenAmount:r,isAuthConnector:n}=ye.getParams();le.loadingTransaction=!0;const i=`Swapping ${(o=le.sourceToken)==null?void 0:o.symbol} to ${Dt.formatNumberToLocalString(r,3)} ${(a=le.toToken)==null?void 0:a.symbol}`,s=`Swapped ${(c=le.sourceToken)==null?void 0:c.symbol} to ${Dt.formatNumberToLocalString(r,3)} ${(u=le.toToken)==null?void 0:u.symbol}`;n?X.pushTransactionStack({onSuccess(){X.replace("Account"),Fe.showLoading(i),W4.resetState()}}):Fe.showLoading("Confirm transaction in your wallet");try{const w=[(l=le.sourceToken)==null?void 0:l.address,(d=le.toToken)==null?void 0:d.address].join(","),C=await xe.sendTransaction({address:e,to:t.to,data:t.data,value:t.value,chainNamespace:"eip155"});return le.loadingTransaction=!1,Fe.showSuccess(s),Re.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((h=F.state.activeCaipNetwork)==null?void 0:h.caipNetworkId)||"",swapFromToken:((f=ye.state.sourceToken)==null?void 0:f.symbol)||"",swapToToken:((g=ye.state.toToken)==null?void 0:g.symbol)||"",swapFromAmount:ye.state.sourceTokenAmount||"",swapToAmount:ye.state.toTokenAmount||"",isSmartAccount:((p=re.state.preferredAccountTypes)==null?void 0:p.eip155)===bt.ACCOUNT_TYPES.SMART_ACCOUNT}}),W4.resetState(),n||X.replace("Account"),W4.getMyTokensWithBalance(w),C}catch(w){const C=w;le.transactionError=C==null?void 0:C.shortMessage,le.loadingTransaction=!1,Fe.showError((C==null?void 0:C.shortMessage)||"Transaction error"),Re.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:(C==null?void 0:C.shortMessage)||(C==null?void 0:C.message)||"Unknown",network:((m=F.state.activeCaipNetwork)==null?void 0:m.caipNetworkId)||"",swapFromToken:((b=ye.state.sourceToken)==null?void 0:b.symbol)||"",swapToToken:((v=ye.state.toToken)==null?void 0:v.symbol)||"",swapFromAmount:ye.state.sourceTokenAmount||"",swapToAmount:ye.state.toTokenAmount||"",isSmartAccount:((E=re.state.preferredAccountTypes)==null?void 0:E.eip155)===bt.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(t,e){return Nl.isInsufficientSourceTokenForSwap(t,e,le.myTokensWithBalance)},setTransactionDetails(){const{toTokenAddress:t,toTokenDecimals:e}=ye.getParams();!t||!e||(le.gasPriceInUSD=Nl.getGasPriceInUSD(le.networkPrice,BigInt(le.gasFee),BigInt(ik)),le.priceImpact=Nl.getPriceImpact({sourceTokenAmount:le.sourceTokenAmount,sourceTokenPriceInUSD:le.sourceTokenPriceInUSD,toTokenPriceInUSD:le.toTokenPriceInUSD,toTokenAmount:le.toTokenAmount}),le.maxSlippage=Nl.getMaxSlippage(le.slippage,le.toTokenAmount),le.providerFee=Nl.getProviderFee(le.sourceTokenAmount))}},ye=Pi(W4),wo=rr({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),Mie={state:wo,subscribe(t){return ln(wo,()=>t(wo))},subscribeKey(t,e){return dn(wo,t,e)},showTooltip({message:t,triggerRect:e,variant:r}){wo.open=!0,wo.message=t,wo.triggerRect=e,wo.variant=r},hide(){wo.open=!1,wo.message="",wo.triggerRect={width:0,height:0,top:0,left:0}}},_s=Pi(Mie),sk=2147483648,Lie={convertEVMChainIdToCoinType(t){if(t>=sk)throw new Error("Invalid chainId");return(sk|t)>>>0}},Us=rr({suggestions:[],loading:!1}),Uie={state:Us,subscribe(t){return ln(Us,()=>t(Us))},subscribeKey(t,e){return dn(Us,t,e)},async resolveName(t){var e,r;try{return await Xe.lookupEnsName(t)}catch(n){const i=n;throw new Error(((r=(e=i==null?void 0:i.reasons)==null?void 0:e[0])==null?void 0:r.description)||"Error resolving name")}},async isNameRegistered(t){try{return await Xe.lookupEnsName(t),!0}catch{return!1}},async getSuggestions(t){try{Us.loading=!0,Us.suggestions=[];const e=await Xe.getEnsNameSuggestions(t);return Us.suggestions=e.suggestions.map(r=>({...r,name:r.name}))||[],Us.suggestions}catch(e){const r=ys.parseEnsApiError(e,"Error fetching name suggestions");throw new Error(r)}finally{Us.loading=!1}},async getNamesForAddress(t){try{if(!F.state.activeCaipNetwork)return[];const r=Le.getEnsFromCacheForAddress(t);if(r)return r;const n=await Xe.reverseLookupEnsName({address:t});return Le.updateEnsCache({address:t,ens:n,timestamp:Date.now()}),n}catch(e){const r=ys.parseEnsApiError(e,"Error fetching names for address");throw new Error(r)}},async registerName(t){const e=F.state.activeCaipNetwork;if(!e)throw new Error("Network not found");const r=re.state.address,n=ge.getAuthConnector();if(!r||!n)throw new Error("Address or auth connector not found");Us.loading=!0;try{const i=JSON.stringify({name:t,attributes:{},timestamp:Math.floor(Date.now()/1e3)});X.pushTransactionStack({onCancel(){X.replace("RegisterAccountName")}});const s=await xe.signMessage(i);Us.loading=!1;const o=e.id;if(!o)throw new Error("Network not found");const a=Lie.convertEVMChainIdToCoinType(Number(o));await Xe.registerEnsName({coinType:a,address:r,signature:s,message:i}),re.setProfileName(t,e.chainNamespace),X.replace("RegisterAccountNameSuccess")}catch(i){const s=ys.parseEnsApiError(i,`Error registering name ${t}`);throw X.replace("RegisterAccountName"),new Error(s)}finally{Us.loading=!1}},validateName(t){return/^[a-zA-Z0-9-]{4,}$/u.test(t)},parseEnsApiError(t,e){var n,i;const r=t;return((i=(n=r==null?void 0:r.reasons)==null?void 0:n[0])==null?void 0:i.description)||e}},ys=Pi(Uie),$1=rr({isLegalCheckboxChecked:!1}),As={state:$1,subscribe(t){return ln($1,()=>t($1))},subscribeKey(t,e){return dn($1,t,e)},setIsLegalCheckboxChecked(t){$1.isLegalCheckboxChecked=t}};var X2={exports:{}},ok;function LV(){if(ok)return X2.exports;ok=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(C,y,_){return Function.prototype.apply.call(C,y,_)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:r=function(C){return Object.getOwnPropertyNames(C)};function n(w){console&&console.warn&&console.warn(w)}var i=Number.isNaN||function(C){return C!==C};function s(){s.init.call(this)}X2.exports=s,X2.exports.once=b,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(w){if(typeof w!="number"||w<0||i(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");o=w}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function c(w){return w._maxListeners===void 0?s.defaultMaxListeners:w._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(C){for(var y=[],_=1;_<arguments.length;_++)y.push(arguments[_]);var x=C==="error",A=this._events;if(A!==void 0)x=x&&A.error===void 0;else if(!x)return!1;if(x){var T;if(y.length>0&&(T=y[0]),T instanceof Error)throw T;var O=new Error("Unhandled error."+(T?" ("+T.message+")":""));throw O.context=T,O}var k=A[C];if(k===void 0)return!1;if(typeof k=="function")e(k,this,y);else for(var j=k.length,N=g(k,j),_=0;_<j;++_)e(N[_],this,y);return!0};function u(w,C,y,_){var x,A,T;if(a(y),A=w._events,A===void 0?(A=w._events=Object.create(null),w._eventsCount=0):(A.newListener!==void 0&&(w.emit("newListener",C,y.listener?y.listener:y),A=w._events),T=A[C]),T===void 0)T=A[C]=y,++w._eventsCount;else if(typeof T=="function"?T=A[C]=_?[y,T]:[T,y]:_?T.unshift(y):T.push(y),x=c(w),x>0&&T.length>x&&!T.warned){T.warned=!0;var O=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");O.name="MaxListenersExceededWarning",O.emitter=w,O.type=C,O.count=T.length,n(O)}return w}s.prototype.addListener=function(C,y){return u(this,C,y,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(C,y){return u(this,C,y,!0)};function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(w,C,y){var _={fired:!1,wrapFn:void 0,target:w,type:C,listener:y},x=l.bind(_);return x.listener=y,_.wrapFn=x,x}s.prototype.once=function(C,y){return a(y),this.on(C,d(this,C,y)),this},s.prototype.prependOnceListener=function(C,y){return a(y),this.prependListener(C,d(this,C,y)),this},s.prototype.removeListener=function(C,y){var _,x,A,T,O;if(a(y),x=this._events,x===void 0)return this;if(_=x[C],_===void 0)return this;if(_===y||_.listener===y)--this._eventsCount===0?this._events=Object.create(null):(delete x[C],x.removeListener&&this.emit("removeListener",C,_.listener||y));else if(typeof _!="function"){for(A=-1,T=_.length-1;T>=0;T--)if(_[T]===y||_[T].listener===y){O=_[T].listener,A=T;break}if(A<0)return this;A===0?_.shift():p(_,A),_.length===1&&(x[C]=_[0]),x.removeListener!==void 0&&this.emit("removeListener",C,O||y)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(C){var y,_,x;if(_=this._events,_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[C]),this;if(arguments.length===0){var A=Object.keys(_),T;for(x=0;x<A.length;++x)T=A[x],T!=="removeListener"&&this.removeAllListeners(T);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(y=_[C],typeof y=="function")this.removeListener(C,y);else if(y!==void 0)for(x=y.length-1;x>=0;x--)this.removeListener(C,y[x]);return this};function h(w,C,y){var _=w._events;if(_===void 0)return[];var x=_[C];return x===void 0?[]:typeof x=="function"?y?[x.listener||x]:[x]:y?m(x):g(x,x.length)}s.prototype.listeners=function(C){return h(this,C,!0)},s.prototype.rawListeners=function(C){return h(this,C,!1)},s.listenerCount=function(w,C){return typeof w.listenerCount=="function"?w.listenerCount(C):f.call(w,C)},s.prototype.listenerCount=f;function f(w){var C=this._events;if(C!==void 0){var y=C[w];if(typeof y=="function")return 1;if(y!==void 0)return y.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function g(w,C){for(var y=new Array(C),_=0;_<C;++_)y[_]=w[_];return y}function p(w,C){for(;C+1<w.length;C++)w[C]=w[C+1];w.pop()}function m(w){for(var C=new Array(w.length),y=0;y<C.length;++y)C[y]=w[y].listener||w[y];return C}function b(w,C){return new Promise(function(y,_){function x(T){w.removeListener(C,A),_(T)}function A(){typeof w.removeListener=="function"&&w.removeListener("error",x),y([].slice.call(arguments))}E(w,C,A,{once:!0}),C!=="error"&&v(w,x,{once:!0})})}function v(w,C,y){typeof w.on=="function"&&E(w,"error",C,y)}function E(w,C,y,_){if(typeof w.on=="function")_.once?w.once(C,y):w.on(C,y);else if(typeof w.addEventListener=="function")w.addEventListener(C,function x(A){_.once&&w.removeEventListener(C,x),y(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}return X2.exports}var ao=LV();const R9=cc(ao);var l8={};/*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */var tI=function(t,e){return tI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},tI(t,e)};function Fie(t,e){tI(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var rI=function(){return rI=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},rI.apply(this,arguments)};function Hie(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function qie(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function zie(t,e){return function(r,n){e(r,n,t)}}function Wie(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Vie(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(l){try{u(n.next(l))}catch(d){o(d)}}function c(l){try{u(n.throw(l))}catch(d){o(d)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((n=n.apply(t,e||[])).next())})}function Gie(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(l){u=[6,l],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Kie(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Zie(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function nI(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function UV(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Yie(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(UV(arguments[e]));return t}function Jie(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Qb(t){return this instanceof Qb?(this.v=t,this):new Qb(t)}function Qie(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(h){n[h]&&(i[h]=function(f){return new Promise(function(g,p){s.push([h,f,g,p])>1||a(h,f)})})}function a(h,f){try{c(n[h](f))}catch(g){d(s[0][3],g)}}function c(h){h.value instanceof Qb?Promise.resolve(h.value.v).then(u,l):d(s[0][2],h)}function u(h){a("next",h)}function l(h){a("throw",h)}function d(h,f){h(f),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Xie(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Qb(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function ese(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof nI=="function"?nI(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function tse(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function rse(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function nse(t){return t&&t.__esModule?t:{default:t}}function ise(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function sse(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const ose=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return rI},__asyncDelegator:Xie,__asyncGenerator:Qie,__asyncValues:ese,__await:Qb,__awaiter:Vie,__classPrivateFieldGet:ise,__classPrivateFieldSet:sse,__createBinding:Kie,__decorate:qie,__exportStar:Zie,__extends:Fie,__generator:Gie,__importDefault:nse,__importStar:rse,__makeTemplateObject:tse,__metadata:Wie,__param:zie,__read:UV,__rest:Hie,__spread:Yie,__spreadArrays:Jie,__values:nI},Symbol.toStringTag,{value:"Module"})),xv=CV(ose);var d8={},j1={},ak;function ase(){if(ak)return j1;ak=1,Object.defineProperty(j1,"__esModule",{value:!0}),j1.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return j1.delay=t,j1}var ch={},h8={},uh={},ck;function cse(){return ck||(ck=1,Object.defineProperty(uh,"__esModule",{value:!0}),uh.ONE_THOUSAND=uh.ONE_HUNDRED=void 0,uh.ONE_HUNDRED=100,uh.ONE_THOUSAND=1e3),uh}var f8={},uk;function use(){return uk||(uk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(f8)),f8}var lk;function FV(){return lk||(lk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=xv;e.__exportStar(cse(),t),e.__exportStar(use(),t)}(h8)),h8}var dk;function lse(){if(dk)return ch;dk=1,Object.defineProperty(ch,"__esModule",{value:!0}),ch.fromMiliseconds=ch.toMiliseconds=void 0;const t=FV();function e(n){return n*t.ONE_THOUSAND}ch.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return ch.fromMiliseconds=r,ch}var hk;function dse(){return hk||(hk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=xv;e.__exportStar(ase(),t),e.__exportStar(lse(),t)}(d8)),d8}var Vp={},fk;function hse(){if(fk)return Vp;fk=1,Object.defineProperty(Vp,"__esModule",{value:!0}),Vp.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return Vp.Watch=t,Vp.default=t,Vp}var p8={},B1={},pk;function fse(){if(pk)return B1;pk=1,Object.defineProperty(B1,"__esModule",{value:!0}),B1.IWatch=void 0;class t{}return B1.IWatch=t,B1}var gk;function pse(){return gk||(gk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),xv.__exportStar(fse(),t)}(p8)),p8}var mk;function gse(){return mk||(mk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=xv;e.__exportStar(dse(),t),e.__exportStar(hse(),t),e.__exportStar(pse(),t),e.__exportStar(FV(),t)}(l8)),l8}var Be=gse();class yp{}let mse=class extends yp{constructor(e){super()}};const wk=Be.FIVE_SECONDS,vp={pulse:"heartbeat_pulse"};let wse=class HV extends mse{constructor(e){super(e),this.events=new ao.EventEmitter,this.interval=wk,this.interval=(e==null?void 0:e.interval)||wk}static async init(e){const r=new HV(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),Be.toMiliseconds(this.interval))}pulse(){this.events.emit(vp.pulse)}};const bse=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,yse=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,vse=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function _se(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){Ese(t);return}return e}function Ese(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function e3(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const r=t.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!vse.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(bse.test(t)||yse.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,_se)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function Cse(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function yn(t,...e){try{return Cse(t(...e))}catch(r){return Promise.reject(r)}}function Ase(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function xse(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function V4(t){if(Ase(t))return String(t);if(xse(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return V4(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const iI="base64:";function Sse(t){return typeof t=="string"?t:iI+Pse(t)}function Tse(t){return typeof t!="string"||!t.startsWith(iI)?t:Ise(t.slice(iI.length))}function Ise(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function Pse(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function Ui(t){var e;return t&&((e=t.split("?")[0])==null?void 0:e.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function Ose(...t){return Ui(t.join(":"))}function t3(t){return t=Ui(t),t?t+":":""}function Rse(t,e){if(e===void 0)return!0;let r=0,n=t.indexOf(":");for(;n>-1;)r++,n=t.indexOf(":",n+1);return r<=e}function kse(t,e){return e?t.startsWith(e)&&t[t.length-1]!=="$":t[t.length-1]!=="$"}const Nse="memory",$se=()=>{const t=new Map;return{name:Nse,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function jse(t={}){const e={mounts:{"":t.driver||$se()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=u=>{for(const l of e.mountpoints)if(u.startsWith(l))return{base:l,relativeKey:u.slice(l.length),driver:e.mounts[l]};return{base:"",relativeKey:u,driver:e.mounts[""]}},n=(u,l)=>e.mountpoints.filter(d=>d.startsWith(u)||l&&u.startsWith(d)).map(d=>({relativeBase:u.length>d.length?u.slice(d.length):void 0,mountpoint:d,driver:e.mounts[d]})),i=(u,l)=>{if(e.watching){l=Ui(l);for(const d of e.watchListeners)d(u,l)}},s=async()=>{if(!e.watching){e.watching=!0;for(const u in e.mounts)e.unwatch[u]=await bk(e.mounts[u],i,u)}},o=async()=>{if(e.watching){for(const u in e.unwatch)await e.unwatch[u]();e.unwatch={},e.watching=!1}},a=(u,l,d)=>{const h=new Map,f=g=>{let p=h.get(g.base);return p||(p={driver:g.driver,base:g.base,items:[]},h.set(g.base,p)),p};for(const g of u){const p=typeof g=="string",m=Ui(p?g:g.key),b=p?void 0:g.value,v=p||!g.options?l:{...l,...g.options},E=r(m);f(E).items.push({key:m,value:b,relativeKey:E.relativeKey,options:v})}return Promise.all([...h.values()].map(g=>d(g))).then(g=>g.flat())},c={hasItem(u,l={}){u=Ui(u);const{relativeKey:d,driver:h}=r(u);return yn(h.hasItem,d,l)},getItem(u,l={}){u=Ui(u);const{relativeKey:d,driver:h}=r(u);return yn(h.getItem,d,l).then(f=>e3(f))},getItems(u,l={}){return a(u,l,d=>d.driver.getItems?yn(d.driver.getItems,d.items.map(h=>({key:h.relativeKey,options:h.options})),l).then(h=>h.map(f=>({key:Ose(d.base,f.key),value:e3(f.value)}))):Promise.all(d.items.map(h=>yn(d.driver.getItem,h.relativeKey,h.options).then(f=>({key:h.key,value:e3(f)})))))},getItemRaw(u,l={}){u=Ui(u);const{relativeKey:d,driver:h}=r(u);return h.getItemRaw?yn(h.getItemRaw,d,l):yn(h.getItem,d,l).then(f=>Tse(f))},async setItem(u,l,d={}){if(l===void 0)return c.removeItem(u);u=Ui(u);const{relativeKey:h,driver:f}=r(u);f.setItem&&(await yn(f.setItem,h,V4(l),d),f.watch||i("update",u))},async setItems(u,l){await a(u,l,async d=>{if(d.driver.setItems)return yn(d.driver.setItems,d.items.map(h=>({key:h.relativeKey,value:V4(h.value),options:h.options})),l);d.driver.setItem&&await Promise.all(d.items.map(h=>yn(d.driver.setItem,h.relativeKey,V4(h.value),h.options)))})},async setItemRaw(u,l,d={}){if(l===void 0)return c.removeItem(u,d);u=Ui(u);const{relativeKey:h,driver:f}=r(u);if(f.setItemRaw)await yn(f.setItemRaw,h,l,d);else if(f.setItem)await yn(f.setItem,h,Sse(l),d);else return;f.watch||i("update",u)},async removeItem(u,l={}){typeof l=="boolean"&&(l={removeMeta:l}),u=Ui(u);const{relativeKey:d,driver:h}=r(u);h.removeItem&&(await yn(h.removeItem,d,l),(l.removeMeta||l.removeMata)&&await yn(h.removeItem,d+"$",l),h.watch||i("remove",u))},async getMeta(u,l={}){typeof l=="boolean"&&(l={nativeOnly:l}),u=Ui(u);const{relativeKey:d,driver:h}=r(u),f=Object.create(null);if(h.getMeta&&Object.assign(f,await yn(h.getMeta,d,l)),!l.nativeOnly){const g=await yn(h.getItem,d+"$",l).then(p=>e3(p));g&&typeof g=="object"&&(typeof g.atime=="string"&&(g.atime=new Date(g.atime)),typeof g.mtime=="string"&&(g.mtime=new Date(g.mtime)),Object.assign(f,g))}return f},setMeta(u,l,d={}){return this.setItem(u+"$",l,d)},removeMeta(u,l={}){return this.removeItem(u+"$",l)},async getKeys(u,l={}){var m;u=t3(u);const d=n(u,!0);let h=[];const f=[];let g=!0;for(const b of d){(m=b.driver.flags)!=null&&m.maxDepth||(g=!1);const v=await yn(b.driver.getKeys,b.relativeBase,l);for(const E of v){const w=b.mountpoint+Ui(E);h.some(C=>w.startsWith(C))||f.push(w)}h=[b.mountpoint,...h.filter(E=>!E.startsWith(b.mountpoint))]}const p=l.maxDepth!==void 0&&!g;return f.filter(b=>(!p||Rse(b,l.maxDepth))&&kse(b,u))},async clear(u,l={}){u=t3(u),await Promise.all(n(u,!1).map(async d=>{if(d.driver.clear)return yn(d.driver.clear,d.relativeBase,l);if(d.driver.removeItem){const h=await d.driver.getKeys(d.relativeBase||"",l);return Promise.all(h.map(f=>d.driver.removeItem(f,l)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(u=>yk(u)))},async watch(u){return await s(),e.watchListeners.push(u),async()=>{e.watchListeners=e.watchListeners.filter(l=>l!==u),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(u,l){if(u=t3(u),u&&e.mounts[u])throw new Error(`already mounted at ${u}`);return u&&(e.mountpoints.push(u),e.mountpoints.sort((d,h)=>h.length-d.length)),e.mounts[u]=l,e.watching&&Promise.resolve(bk(l,i,u)).then(d=>{e.unwatch[u]=d}).catch(console.error),c},async unmount(u,l=!0){var d,h;u=t3(u),!(!u||!e.mounts[u])&&(e.watching&&u in e.unwatch&&((h=(d=e.unwatch)[u])==null||h.call(d),delete e.unwatch[u]),l&&await yk(e.mounts[u]),e.mountpoints=e.mountpoints.filter(f=>f!==u),delete e.mounts[u])},getMount(u=""){u=Ui(u)+":";const l=r(u);return{driver:l.driver,base:l.base}},getMounts(u="",l={}){return u=Ui(u),n(u,l.parents).map(h=>({driver:h.driver,base:h.mountpoint}))},keys:(u,l={})=>c.getKeys(u,l),get:(u,l={})=>c.getItem(u,l),set:(u,l,d={})=>c.setItem(u,l,d),has:(u,l={})=>c.hasItem(u,l),del:(u,l={})=>c.removeItem(u,l),remove:(u,l={})=>c.removeItem(u,l)};return c}function bk(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function yk(t){typeof t.dispose=="function"&&await yn(t.dispose)}function _p(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function qV(t,e){let r;const n=()=>{if(r)return r;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),r=_p(i),r.then(s=>{s.onclose=()=>r=void 0},()=>{}),r};return(i,s)=>n().then(o=>s(o.transaction(e,i).objectStore(e)))}let g8;function Sv(){return g8||(g8=qV("keyval-store","keyval")),g8}function vk(t,e=Sv()){return e("readonly",r=>_p(r.get(t)))}function Bse(t,e,r=Sv()){return r("readwrite",n=>(n.put(e,t),_p(n.transaction)))}function Dse(t,e=Sv()){return e("readwrite",r=>(r.delete(t),_p(r.transaction)))}function Mse(t=Sv()){return t("readwrite",e=>(e.clear(),_p(e.transaction)))}function Lse(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},_p(t.transaction)}function Use(t=Sv()){return t("readonly",e=>{if(e.getAllKeys)return _p(e.getAllKeys());const r=[];return Lse(e,n=>r.push(n.key)).then(()=>r)})}const Fse=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),Hse=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function jf(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return Hse(t)}catch{return t}}function Tu(t){return typeof t=="string"?t:Fse(t)||""}const qse="idb-keyval";var zse=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=qV(t.dbName,t.storeName)),{name:qse,options:t,async hasItem(i){return!(typeof await vk(r(i),n)>"u")},async getItem(i){return await vk(r(i),n)??null},setItem(i,s){return Bse(r(i),s,n)},removeItem(i){return Dse(r(i),n)},getKeys(){return Use(n)},clear(){return Mse(n)}}};const Wse="WALLET_CONNECT_V2_INDEXED_DB",Vse="keyvaluestorage";let Gse=class{constructor(){this.indexedDb=jse({driver:zse({dbName:Wse,storeName:Vse})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Tu(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var m8=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},G4={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof m8<"u"&&m8.localStorage?G4.exports=m8.localStorage:typeof window<"u"&&window.localStorage?G4.exports=window.localStorage:G4.exports=new e})();function Kse(t){var e;return[t[0],jf((e=t[1])!=null?e:"")]}let Zse=class{constructor(){this.localStorage=G4.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Kse)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return jf(r)}async setItem(e,r){this.localStorage.setItem(e,Tu(r))}async removeItem(e){this.localStorage.removeItem(e)}};const Yse="wc_storage_version",_k=1,Jse=async(t,e,r)=>{const n=Yse,i=await e.getItem(n);if(i&&i>=_k){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const o=[];for(;s.length;){const a=s.shift();if(!a)continue;const c=a.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const u=await t.getItem(a);await e.setItem(a,u),o.push(a)}}await e.setItem(n,_k),r(e),Qse(t,o)},Qse=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let Xse=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new Zse;this.storage=e;try{const r=new Gse;Jse(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};var w8,Ek;function eoe(){if(Ek)return w8;Ek=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}w8=e;function e(r,n,i){var s=i&&i.stringify||t,o=1;if(typeof r=="object"&&r!==null){var a=n.length+o;if(a===1)return r;var c=new Array(a);c[0]=s(r);for(var u=1;u<a;u++)c[u]=s(n[u]);return c.join(" ")}if(typeof r!="string")return r;var l=n.length;if(l===0)return r;for(var d="",h=1-o,f=-1,g=r&&r.length||0,p=0;p<g;){if(r.charCodeAt(p)===37&&p+1<g){switch(f=f>-1?f:0,r.charCodeAt(p+1)){case 100:case 102:if(h>=l||n[h]==null)break;f<p&&(d+=r.slice(f,p)),d+=Number(n[h]),f=p+2,p++;break;case 105:if(h>=l||n[h]==null)break;f<p&&(d+=r.slice(f,p)),d+=Math.floor(Number(n[h])),f=p+2,p++;break;case 79:case 111:case 106:if(h>=l||n[h]===void 0)break;f<p&&(d+=r.slice(f,p));var m=typeof n[h];if(m==="string"){d+="'"+n[h]+"'",f=p+2,p++;break}if(m==="function"){d+=n[h].name||"<anonymous>",f=p+2,p++;break}d+=s(n[h]),f=p+2,p++;break;case 115:if(h>=l)break;f<p&&(d+=r.slice(f,p)),d+=String(n[h]),f=p+2,p++;break;case 37:f<p&&(d+=r.slice(f,p)),d+="%",f=p+2,p++,h--;break}++h}++p}return f===-1?r:(f<g&&(d+=r.slice(f)),d)}return w8}var b8,Ck;function toe(){if(Ck)return b8;Ck=1;const t=eoe();b8=i;const e=C().console||{},r={mapHttpRequest:g,mapHttpResponse:g,wrapRequestSerializer:p,wrapResponseSerializer:p,wrapErrorSerializer:p,req:g,res:g,err:h};function n(y,_){return Array.isArray(y)?y.filter(function(A){return A!=="!stdSerializers.err"}):y===!0?Object.keys(_):!1}function i(y){y=y||{},y.browser=y.browser||{};const _=y.browser.transmit;if(_&&typeof _.send!="function")throw Error("pino: transmit option must have a send function");const x=y.browser.write||e;y.browser.write&&(y.browser.asObject=!0);const A=y.serializers||{},T=n(y.browser.serialize,A);let O=y.browser.serialize;Array.isArray(y.browser.serialize)&&y.browser.serialize.indexOf("!stdSerializers.err")>-1&&(O=!1);const k=["error","fatal","warn","info","debug","trace"];typeof x=="function"&&(x.error=x.fatal=x.warn=x.info=x.debug=x.trace=x),y.enabled===!1&&(y.level="silent");const j=y.level||"info",N=Object.create(x);N.log||(N.log=m),Object.defineProperty(N,"levelVal",{get:P}),Object.defineProperty(N,"level",{get:I,set:B});const S={transmit:_,serialize:T,asObject:y.browser.asObject,levels:k,timestamp:f(y)};N.levels=i.levels,N.level=j,N.setMaxListeners=N.getMaxListeners=N.emit=N.addListener=N.on=N.prependListener=N.once=N.prependOnceListener=N.removeListener=N.removeAllListeners=N.listeners=N.listenerCount=N.eventNames=N.write=N.flush=m,N.serializers=A,N._serialize=T,N._stdErrSerialize=O,N.child=$,_&&(N._logEvent=d());function P(){return this.level==="silent"?1/0:this.levels.values[this.level]}function I(){return this._level}function B(R){if(R!=="silent"&&!this.levels.values[R])throw Error("unknown level "+R);this._level=R,s(S,N,"error","log"),s(S,N,"fatal","error"),s(S,N,"warn","error"),s(S,N,"info","log"),s(S,N,"debug","log"),s(S,N,"trace","log")}function $(R,D){if(!R)throw new Error("missing bindings for child Pino");D=D||{},T&&R.serializers&&(D.serializers=R.serializers);const L=D.serializers;if(T&&L){var U=Object.assign({},A,L),z=y.browser.serialize===!0?Object.keys(U):T;delete R.serializers,c([R],z,U,this._stdErrSerialize)}function W(K){this._childLevel=(K._childLevel|0)+1,this.error=u(K,R,"error"),this.fatal=u(K,R,"fatal"),this.warn=u(K,R,"warn"),this.info=u(K,R,"info"),this.debug=u(K,R,"debug"),this.trace=u(K,R,"trace"),U&&(this.serializers=U,this._serialize=z),_&&(this._logEvent=d([].concat(K._logEvent.bindings,R)))}return W.prototype=this,new W(this)}return N}i.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},i.stdSerializers=r,i.stdTimeFunctions=Object.assign({},{nullTime:b,epochTime:v,unixTime:E,isoTime:w});function s(y,_,x,A){const T=Object.getPrototypeOf(_);_[x]=_.levelVal>_.levels.values[x]?m:T[x]?T[x]:e[x]||e[A]||m,o(y,_,x)}function o(y,_,x){!y.transmit&&_[x]===m||(_[x]=function(A){return function(){const O=y.timestamp(),k=new Array(arguments.length),j=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var N=0;N<k.length;N++)k[N]=arguments[N];if(y.serialize&&!y.asObject&&c(k,this._serialize,this.serializers,this._stdErrSerialize),y.asObject?A.call(j,a(this,x,k,O)):A.apply(j,k),y.transmit){const S=y.transmit.level||_.level,P=i.levels.values[S],I=i.levels.values[x];if(I<P)return;l(this,{ts:O,methodLevel:x,methodValue:I,transmitValue:i.levels.values[y.transmit.level||_.level],send:y.transmit.send,val:_.levelVal},k)}}}(_[x]))}function a(y,_,x,A){y._serialize&&c(x,y._serialize,y.serializers,y._stdErrSerialize);const T=x.slice();let O=T[0];const k={};A&&(k.time=A),k.level=i.levels.values[_];let j=(y._childLevel|0)+1;if(j<1&&(j=1),O!==null&&typeof O=="object"){for(;j--&&typeof T[0]=="object";)Object.assign(k,T.shift());O=T.length?t(T.shift(),T):void 0}else typeof O=="string"&&(O=t(T.shift(),T));return O!==void 0&&(k.msg=O),k}function c(y,_,x,A){for(const T in y)if(A&&y[T]instanceof Error)y[T]=i.stdSerializers.err(y[T]);else if(typeof y[T]=="object"&&!Array.isArray(y[T]))for(const O in y[T])_&&_.indexOf(O)>-1&&O in x&&(y[T][O]=x[O](y[T][O]))}function u(y,_,x){return function(){const A=new Array(1+arguments.length);A[0]=_;for(var T=1;T<A.length;T++)A[T]=arguments[T-1];return y[x].apply(this,A)}}function l(y,_,x){const A=_.send,T=_.ts,O=_.methodLevel,k=_.methodValue,j=_.val,N=y._logEvent.bindings;c(x,y._serialize||Object.keys(y.serializers),y.serializers,y._stdErrSerialize===void 0?!0:y._stdErrSerialize),y._logEvent.ts=T,y._logEvent.messages=x.filter(function(S){return N.indexOf(S)===-1}),y._logEvent.level.label=O,y._logEvent.level.value=k,A(O,y._logEvent,j),y._logEvent=d(N)}function d(y){return{ts:0,messages:[],bindings:y||[],level:{label:"",value:0}}}function h(y){const _={type:y.constructor.name,msg:y.message,stack:y.stack};for(const x in y)_[x]===void 0&&(_[x]=y[x]);return _}function f(y){return typeof y.timestamp=="function"?y.timestamp:y.timestamp===!1?b:v}function g(){return{}}function p(y){return y}function m(){}function b(){return!1}function v(){return Date.now()}function E(){return Math.round(Date.now()/1e3)}function w(){return new Date(Date.now()).toISOString()}function C(){function y(_){return typeof _<"u"&&_}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return y(self)||y(window)||y(this)||{}}}return b8}var B0=toe();const Tv=cc(B0),roe={level:"info"},Iv="custom_context",k9=1e3*1024;let noe=class{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},Ak=class{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new noe(e);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}},zV=class{constructor(e,r=k9){this.level=e??"error",this.levelValue=B0.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new Ak(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===B0.levels.values.error?console.error(e):r===B0.levels.values.warn?console.warn(e):r===B0.levels.values.debug?console.debug(e):r===B0.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Tu({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new Ak(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Tu({extraMetadata:e})),new Blob(r,{type:"application/json"})}},ioe=class{constructor(e,r=k9){this.baseChunkLogger=new zV(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}},soe=class{constructor(e,r=k9){this.baseChunkLogger=new zV(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var ooe=Object.defineProperty,aoe=Object.defineProperties,coe=Object.getOwnPropertyDescriptors,xk=Object.getOwnPropertySymbols,uoe=Object.prototype.hasOwnProperty,loe=Object.prototype.propertyIsEnumerable,Sk=(t,e,r)=>e in t?ooe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vC=(t,e)=>{for(var r in e||(e={}))uoe.call(e,r)&&Sk(t,r,e[r]);if(xk)for(var r of xk(e))loe.call(e,r)&&Sk(t,r,e[r]);return t},_C=(t,e)=>aoe(t,coe(e));function Xm(t){return _C(vC({},t),{level:(t==null?void 0:t.level)||roe.level})}function doe(t,e=Iv){return t[e]||""}function hoe(t,e,r=Iv){return t[r]=e,t}function es(t,e=Iv){let r="";return typeof t.bindings>"u"?r=doe(t,e):r=t.bindings().context||"",r}function foe(t,e,r=Iv){const n=es(t,r);return n.trim()?`${n}/${e}`:e}function si(t,e,r=Iv){const n=foe(t,e,r),i=t.child({context:n});return hoe(i,n,r)}function poe(t){var e,r;const n=new ioe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:Tv(_C(vC({},t.opts),{level:"trace",browser:_C(vC({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function goe(t){var e;const r=new soe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:Tv(_C(vC({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function N9(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?poe(t):goe(t)}var moe=Object.defineProperty,woe=(t,e,r)=>e in t?moe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Tk=(t,e,r)=>woe(t,typeof e!="symbol"?e+"":e,r);let boe=class extends yp{constructor(e){super(),this.opts=e,Tk(this,"protocol","wc"),Tk(this,"version",2)}};var yoe=Object.defineProperty,voe=(t,e,r)=>e in t?yoe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_oe=(t,e,r)=>voe(t,e+"",r);let Eoe=class extends yp{constructor(e,r){super(),this.core=e,this.logger=r,_oe(this,"records",new Map)}},Coe=class{constructor(e,r){this.logger=e,this.core=r}},Aoe=class extends yp{constructor(e,r){super(),this.relayer=e,this.logger=r}},xoe=class extends yp{constructor(e){super()}},Soe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},Toe=class extends yp{constructor(e,r){super(),this.relayer=e,this.logger=r}},Ioe=class extends yp{constructor(e,r){super(),this.core=e,this.logger=r}},Poe=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},Ooe=class{constructor(e,r){this.projectId=e,this.logger=r}},Roe=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}};var koe=Object.defineProperty,Noe=(t,e,r)=>e in t?koe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ik=(t,e,r)=>Noe(t,typeof e!="symbol"?e+"":e,r);let $oe=class{constructor(e){this.opts=e,Ik(this,"protocol","wc"),Ik(this,"version",2)}},joe=class{constructor(e){this.client=e}};function Boe(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function WV(t,...e){if(!Boe(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Pk(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Doe(t,e){WV(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const Gp=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const y8=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);function Moe(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function VV(t){return typeof t=="string"&&(t=Moe(t)),WV(t),t}let Loe=class{clone(){return this._cloneInto()}};function Uoe(t){const e=n=>t().update(VV(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function GV(t=32){if(Gp&&typeof Gp.getRandomValues=="function")return Gp.getRandomValues(new Uint8Array(t));if(Gp&&typeof Gp.randomBytes=="function")return Gp.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function Foe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+u,a,n)}let Hoe=class extends Loe{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=y8(this.buffer)}update(e){Pk(this);const{view:r,buffer:n,blockLen:i}=this;e=VV(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=y8(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Pk(this),Doe(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(n,0),o=0);for(let d=o;d<i;d++)r[d]=0;Foe(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=y8(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)a.setUint32(4*d,l[d],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%r&&e.buffer.set(n),e}};const r3=BigInt(2**32-1),sI=BigInt(32);function KV(t,e=!1){return e?{h:Number(t&r3),l:Number(t>>sI&r3)}:{h:Number(t>>sI&r3)|0,l:Number(t&r3)|0}}function qoe(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=KV(t[i],e);[r[i],n[i]]=[s,o]}return[r,n]}const zoe=(t,e)=>BigInt(t>>>0)<<sI|BigInt(e>>>0),Woe=(t,e,r)=>t>>>r,Voe=(t,e,r)=>t<<32-r|e>>>r,Goe=(t,e,r)=>t>>>r|e<<32-r,Koe=(t,e,r)=>t<<32-r|e>>>r,Zoe=(t,e,r)=>t<<64-r|e>>>r-32,Yoe=(t,e,r)=>t>>>r-32|e<<64-r,Joe=(t,e)=>e,Qoe=(t,e)=>t,Xoe=(t,e,r)=>t<<r|e>>>32-r,eae=(t,e,r)=>e<<r|t>>>32-r,tae=(t,e,r)=>e<<r-32|t>>>64-r,rae=(t,e,r)=>t<<r-32|e>>>64-r;function nae(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const iae=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),sae=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,oae=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),aae=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,cae=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),uae=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,At={fromBig:KV,split:qoe,toBig:zoe,shrSH:Woe,shrSL:Voe,rotrSH:Goe,rotrSL:Koe,rotrBH:Zoe,rotrBL:Yoe,rotr32H:Joe,rotr32L:Qoe,rotlSH:Xoe,rotlSL:eae,rotlBH:tae,rotlBL:rae,add:nae,add3L:iae,add3H:sae,add4L:oae,add4H:aae,add5H:uae,add5L:cae},[lae,dae]=At.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),pl=new Uint32Array(80),gl=new Uint32Array(80);let hae=class extends Hoe{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:u,El:l,Fh:d,Fl:h,Gh:f,Gl:g,Hh:p,Hl:m}=this;return[e,r,n,i,s,o,a,c,u,l,d,h,f,g,p,m]}set(e,r,n,i,s,o,a,c,u,l,d,h,f,g,p,m){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=d|0,this.Fl=h|0,this.Gh=f|0,this.Gl=g|0,this.Hh=p|0,this.Hl=m|0}process(e,r){for(let E=0;E<16;E++,r+=4)pl[E]=e.getUint32(r),gl[E]=e.getUint32(r+=4);for(let E=16;E<80;E++){const w=pl[E-15]|0,C=gl[E-15]|0,y=At.rotrSH(w,C,1)^At.rotrSH(w,C,8)^At.shrSH(w,C,7),_=At.rotrSL(w,C,1)^At.rotrSL(w,C,8)^At.shrSL(w,C,7),x=pl[E-2]|0,A=gl[E-2]|0,T=At.rotrSH(x,A,19)^At.rotrBH(x,A,61)^At.shrSH(x,A,6),O=At.rotrSL(x,A,19)^At.rotrBL(x,A,61)^At.shrSL(x,A,6),k=At.add4L(_,O,gl[E-7],gl[E-16]),j=At.add4H(k,y,T,pl[E-7],pl[E-16]);pl[E]=j|0,gl[E]=k|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:u,Dl:l,Eh:d,El:h,Fh:f,Fl:g,Gh:p,Gl:m,Hh:b,Hl:v}=this;for(let E=0;E<80;E++){const w=At.rotrSH(d,h,14)^At.rotrSH(d,h,18)^At.rotrBH(d,h,41),C=At.rotrSL(d,h,14)^At.rotrSL(d,h,18)^At.rotrBL(d,h,41),y=d&f^~d&p,_=h&g^~h&m,x=At.add5L(v,C,_,dae[E],gl[E]),A=At.add5H(x,b,w,y,lae[E],pl[E]),T=x|0,O=At.rotrSH(n,i,28)^At.rotrBH(n,i,34)^At.rotrBH(n,i,39),k=At.rotrSL(n,i,28)^At.rotrBL(n,i,34)^At.rotrBL(n,i,39),j=n&s^n&a^s&a,N=i&o^i&c^o&c;b=p|0,v=m|0,p=f|0,m=g|0,f=d|0,g=h|0,{h:d,l:h}=At.add(u|0,l|0,A|0,T|0),u=a|0,l=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const S=At.add3L(T,k,N);n=At.add3H(S,A,O,j),i=S|0}({h:n,l:i}=At.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=At.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=At.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=At.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:d,l:h}=At.add(this.Eh|0,this.El|0,d|0,h|0),{h:f,l:g}=At.add(this.Fh|0,this.Fl|0,f|0,g|0),{h:p,l:m}=At.add(this.Gh|0,this.Gl|0,p|0,m|0),{h:b,l:v}=At.add(this.Hh|0,this.Hl|0,b|0,v|0),this.set(n,i,s,o,a,c,u,l,d,h,f,g,p,m,b,v)}roundClean(){pl.fill(0),gl.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const fae=Uoe(()=>new hae);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const $9=BigInt(0),ZV=BigInt(1),pae=BigInt(2);function j9(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function B9(t){if(!j9(t))throw new Error("Uint8Array expected")}function v8(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const gae=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function D9(t){B9(t);let e="";for(let r=0;r<t.length;r++)e+=gae[t[r]];return e}function YV(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?$9:BigInt("0x"+t)}const yc={_0:48,_9:57,A:65,F:70,a:97,f:102};function Ok(t){if(t>=yc._0&&t<=yc._9)return t-yc._0;if(t>=yc.A&&t<=yc.F)return t-(yc.A-10);if(t>=yc.a&&t<=yc.f)return t-(yc.a-10)}function JV(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let i=0,s=0;i<r;i++,s+=2){const o=Ok(t.charCodeAt(s)),a=Ok(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[i]=o*16+a}return n}function mae(t){return YV(D9(t))}function K4(t){return B9(t),YV(D9(Uint8Array.from(t).reverse()))}function QV(t,e){return JV(t.toString(16).padStart(e*2,"0"))}function oI(t,e){return QV(t,e).reverse()}function vc(t,e,r){let n;if(typeof e=="string")try{n=JV(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(j9(e))n=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(t+" of length "+r+" expected, got "+i);return n}function Rk(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];B9(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}const _8=t=>typeof t=="bigint"&&$9<=t;function wae(t,e,r){return _8(t)&&_8(e)&&_8(r)&&e<=t&&t<r}function D1(t,e,r,n){if(!wae(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function bae(t){let e;for(e=0;t>$9;t>>=ZV,e+=1);return e}const yae=t=>(pae<<BigInt(t-1))-ZV,vae={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||j9(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function M9(t,e,r={}){const n=(i,s,o)=>{const a=vae[s];if(typeof a!="function")throw new Error("invalid validator function");const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+c)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}function kk(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const s=t(r,...n);return e.set(r,s),s}}const Sn=BigInt(0),Kr=BigInt(1),Mh=BigInt(2),_ae=BigInt(3),aI=BigInt(4),Nk=BigInt(5),$k=BigInt(8);function mn(t,e){const r=t%e;return r>=Sn?r:e+r}function Eae(t,e,r){if(e<Sn)throw new Error("invalid exponent, negatives unsupported");if(r<=Sn)throw new Error("invalid modulus");if(r===Kr)return Sn;let n=Kr;for(;e>Sn;)e&Kr&&(n=n*t%r),t=t*t%r,e>>=Kr;return n}function ma(t,e,r){let n=t;for(;e-- >Sn;)n*=n,n%=r;return n}function jk(t,e){if(t===Sn)throw new Error("invert: expected non-zero number");if(e<=Sn)throw new Error("invert: expected positive modulus, got "+e);let r=mn(t,e),n=e,i=Sn,s=Kr;for(;r!==Sn;){const o=n/r,a=n%r,c=i-s*o;n=r,r=a,i=s,s=c}if(n!==Kr)throw new Error("invert: does not exist");return mn(i,e)}function Cae(t){const e=(t-Kr)/Mh;let r,n,i;for(r=t-Kr,n=0;r%Mh===Sn;r/=Mh,n++);for(i=Mh;i<t&&Eae(i,e,t)!==t-Kr;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const o=(t+Kr)/aI;return function(a,c){const u=a.pow(c,o);if(!a.eql(a.sqr(u),c))throw new Error("Cannot find square root");return u}}const s=(r+Kr)/Mh;return function(o,a){if(o.pow(a,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let c=n,u=o.pow(o.mul(o.ONE,i),r),l=o.pow(a,s),d=o.pow(a,r);for(;!o.eql(d,o.ONE);){if(o.eql(d,o.ZERO))return o.ZERO;let h=1;for(let g=o.sqr(d);h<c&&!o.eql(g,o.ONE);h++)g=o.sqr(g);const f=o.pow(u,Kr<<BigInt(c-h-1));u=o.sqr(f),l=o.mul(l,f),d=o.mul(d,u),c=h}return l}}function Aae(t){if(t%aI===_ae){const e=(t+Kr)/aI;return function(r,n){const i=r.pow(n,e);if(!r.eql(r.sqr(i),n))throw new Error("Cannot find square root");return i}}if(t%$k===Nk){const e=(t-Nk)/$k;return function(r,n){const i=r.mul(n,Mh),s=r.pow(i,e),o=r.mul(n,s),a=r.mul(r.mul(o,Mh),s),c=r.mul(o,r.sub(a,r.ONE));if(!r.eql(r.sqr(c),n))throw new Error("Cannot find square root");return c}}return Cae(t)}const xae=(t,e)=>(mn(t,e)&Kr)===Kr,Sae=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Tae(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Sae.reduce((n,i)=>(n[i]="function",n),e);return M9(t,r)}function Iae(t,e,r){if(r<Sn)throw new Error("invalid exponent, negatives unsupported");if(r===Sn)return t.ONE;if(r===Kr)return e;let n=t.ONE,i=e;for(;r>Sn;)r&Kr&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Kr;return n}function Pae(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function XV(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function eG(t,e,r=!1,n={}){if(t<=Sn)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=XV(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:t,isLE:r,BITS:i,BYTES:s,MASK:yae(i),ZERO:Sn,ONE:Kr,create:c=>mn(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Sn<=c&&c<t},is0:c=>c===Sn,isOdd:c=>(c&Kr)===Kr,neg:c=>mn(-c,t),eql:(c,u)=>c===u,sqr:c=>mn(c*c,t),add:(c,u)=>mn(c+u,t),sub:(c,u)=>mn(c-u,t),mul:(c,u)=>mn(c*u,t),pow:(c,u)=>Iae(a,c,u),div:(c,u)=>mn(c*jk(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>jk(c,t),sqrt:n.sqrt||(c=>(o||(o=Aae(t)),o(a,c))),invertBatch:c=>Pae(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>r?oI(c,s):QV(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return r?K4(c):mae(c)}});return Object.freeze(a)}const Bk=BigInt(0),n3=BigInt(1);function E8(t,e){const r=e.negate();return t?r:e}function tG(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function C8(t,e){tG(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1);return{windows:r,windowSize:n}}function Oae(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function Rae(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}const A8=new WeakMap,rG=new WeakMap;function x8(t){return rG.get(t)||1}function kae(t,e){return{constTimeNegate:E8,hasPrecomputes(r){return x8(r)!==1},unsafeLadder(r,n,i=t.ZERO){let s=r;for(;n>Bk;)n&n3&&(i=i.add(s)),s=s.double(),n>>=n3;return i},precomputeWindow(r,n){const{windows:i,windowSize:s}=C8(n,e),o=[];let a=r,c=a;for(let u=0;u<i;u++){c=a,o.push(c);for(let l=1;l<s;l++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(r,n,i){const{windows:s,windowSize:o}=C8(r,e);let a=t.ZERO,c=t.BASE;const u=BigInt(2**r-1),l=2**r,d=BigInt(r);for(let h=0;h<s;h++){const f=h*o;let g=Number(i&u);i>>=d,g>o&&(g-=l,i+=n3);const p=f,m=f+Math.abs(g)-1,b=h%2!==0,v=g<0;g===0?c=c.add(E8(b,n[p])):a=a.add(E8(v,n[m]))}return{p:a,f:c}},wNAFUnsafe(r,n,i,s=t.ZERO){const{windows:o,windowSize:a}=C8(r,e),c=BigInt(2**r-1),u=2**r,l=BigInt(r);for(let d=0;d<o;d++){const h=d*a;if(i===Bk)break;let f=Number(i&c);if(i>>=l,f>a&&(f-=u,i+=n3),f===0)continue;let g=n[h+Math.abs(f)-1];f<0&&(g=g.negate()),s=s.add(g)}return s},getPrecomputes(r,n,i){let s=A8.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&A8.set(n,i(s))),s},wNAFCached(r,n,i){const s=x8(r);return this.wNAF(s,this.getPrecomputes(s,r,i),n)},wNAFCachedUnsafe(r,n,i,s){const o=x8(r);return o===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(o,this.getPrecomputes(o,r,i),n,s)},setWindowSize(r,n){tG(n,e),rG.set(r,n),A8.delete(r)}}}function Nae(t,e,r,n){if(Oae(r,t),Rae(n,e),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,s=bae(BigInt(r.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<<o)-1,c=new Array(a+1).fill(i),u=Math.floor((e.BITS-1)/o)*o;let l=i;for(let d=u;d>=0;d-=o){c.fill(i);for(let f=0;f<n.length;f++){const g=n[f],p=Number(g>>BigInt(d)&BigInt(a));c[p]=c[p].add(r[f])}let h=i;for(let f=c.length-1,g=i;f>0;f--)g=g.add(c[f]),h=h.add(g);if(l=l.add(h),d!==0)for(let f=0;f<o;f++)l=l.double()}return l}function $ae(t){return Tae(t.Fp),M9(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...XV(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}const bo=BigInt(0),Bi=BigInt(1),i3=BigInt(2),jae=BigInt(8),Bae={zip215:!0};function Dae(t){const e=$ae(t);return M9(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Mae(t){const e=Dae(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,u=i3<<BigInt(a*8)-Bi,l=r.create,d=eG(e.n,e.nBitLength),h=e.uvRatio||((S,P)=>{try{return{isValid:!0,value:r.sqrt(S*r.inv(P))}}catch{return{isValid:!1,value:bo}}}),f=e.adjustScalarBytes||(S=>S),g=e.domain||((S,P,I)=>{if(v8("phflag",I),P.length||I)throw new Error("Contexts/pre-hash are not supported");return S});function p(S,P){D1("coordinate "+S,P,bo,u)}function m(S){if(!(S instanceof E))throw new Error("ExtendedPoint expected")}const b=kk((S,P)=>{const{ex:I,ey:B,ez:$}=S,R=S.is0();P==null&&(P=R?jae:r.inv($));const D=l(I*P),L=l(B*P),U=l($*P);if(R)return{x:bo,y:Bi};if(U!==Bi)throw new Error("invZ was invalid");return{x:D,y:L}}),v=kk(S=>{const{a:P,d:I}=e;if(S.is0())throw new Error("bad point: ZERO");const{ex:B,ey:$,ez:R,et:D}=S,L=l(B*B),U=l($*$),z=l(R*R),W=l(z*z),K=l(L*P),J=l(z*l(K+U)),ne=l(W+l(I*l(L*U)));if(J!==ne)throw new Error("bad point: equation left != right (1)");const ae=l(B*$),he=l(R*D);if(ae!==he)throw new Error("bad point: equation left != right (2)");return!0});class E{constructor(P,I,B,$){this.ex=P,this.ey=I,this.ez=B,this.et=$,p("x",P),p("y",I),p("z",B),p("t",$),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(P){if(P instanceof E)throw new Error("extended point not allowed");const{x:I,y:B}=P||{};return p("x",I),p("y",B),new E(I,B,Bi,l(I*B))}static normalizeZ(P){const I=r.invertBatch(P.map(B=>B.ez));return P.map((B,$)=>B.toAffine(I[$])).map(E.fromAffine)}static msm(P,I){return Nae(E,d,P,I)}_setWindowSize(P){y.setWindowSize(this,P)}assertValidity(){v(this)}equals(P){m(P);const{ex:I,ey:B,ez:$}=this,{ex:R,ey:D,ez:L}=P,U=l(I*L),z=l(R*$),W=l(B*L),K=l(D*$);return U===z&&W===K}is0(){return this.equals(E.ZERO)}negate(){return new E(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){const{a:P}=e,{ex:I,ey:B,ez:$}=this,R=l(I*I),D=l(B*B),L=l(i3*l($*$)),U=l(P*R),z=I+B,W=l(l(z*z)-R-D),K=U+D,J=K-L,ne=U-D,ae=l(W*J),he=l(K*ne),ie=l(W*ne),Ee=l(J*K);return new E(ae,he,Ee,ie)}add(P){m(P);const{a:I,d:B}=e,{ex:$,ey:R,ez:D,et:L}=this,{ex:U,ey:z,ez:W,et:K}=P;if(I===BigInt(-1)){const ft=l((R-$)*(z+U)),Wt=l((R+$)*(z-U)),lr=l(Wt-ft);if(lr===bo)return this.double();const dr=l(D*i3*K),hr=l(L*i3*W),Er=hr+dr,be=Wt+ft,Te=hr-dr,Me=l(Er*lr),st=l(be*Te),Cr=l(Er*Te),hn=l(lr*be);return new E(Me,st,hn,Cr)}const J=l($*U),ne=l(R*z),ae=l(L*B*K),he=l(D*W),ie=l(($+R)*(U+z)-J-ne),Ee=he-ae,pe=he+ae,ve=l(ne-I*J),je=l(ie*Ee),rt=l(pe*ve),Ce=l(ie*ve),fe=l(Ee*pe);return new E(je,rt,fe,Ce)}subtract(P){return this.add(P.negate())}wNAF(P){return y.wNAFCached(this,P,E.normalizeZ)}multiply(P){const I=P;D1("scalar",I,Bi,n);const{p:B,f:$}=this.wNAF(I);return E.normalizeZ([B,$])[0]}multiplyUnsafe(P,I=E.ZERO){const B=P;return D1("scalar",B,bo,n),B===bo?C:this.is0()||B===Bi?this:y.wNAFCachedUnsafe(this,B,E.normalizeZ,I)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return y.unsafeLadder(this,n).is0()}toAffine(P){return b(this,P)}clearCofactor(){const{h:P}=e;return P===Bi?this:this.multiplyUnsafe(P)}static fromHex(P,I=!1){const{d:B,a:$}=e,R=r.BYTES;P=vc("pointHex",P,R),v8("zip215",I);const D=P.slice(),L=P[R-1];D[R-1]=L&-129;const U=K4(D),z=I?u:r.ORDER;D1("pointHex.y",U,bo,z);const W=l(U*U),K=l(W-Bi),J=l(B*W-$);let{isValid:ne,value:ae}=h(K,J);if(!ne)throw new Error("Point.fromHex: invalid y coordinate");const he=(ae&Bi)===Bi,ie=(L&128)!==0;if(!I&&ae===bo&&ie)throw new Error("Point.fromHex: x=0 and x_0=1");return ie!==he&&(ae=l(-ae)),E.fromAffine({x:ae,y:U})}static fromPrivateKey(P){return A(P).point}toRawBytes(){const{x:P,y:I}=this.toAffine(),B=oI(I,r.BYTES);return B[B.length-1]|=P&Bi?128:0,B}toHex(){return D9(this.toRawBytes())}}E.BASE=new E(e.Gx,e.Gy,Bi,l(e.Gx*e.Gy)),E.ZERO=new E(bo,Bi,Bi,bo);const{BASE:w,ZERO:C}=E,y=kae(E,a*8);function _(S){return mn(S,n)}function x(S){return _(K4(S))}function A(S){const P=r.BYTES;S=vc("private key",S,P);const I=vc("hashed private key",s(S),2*P),B=f(I.slice(0,P)),$=I.slice(P,2*P),R=x(B),D=w.multiply(R),L=D.toRawBytes();return{head:B,prefix:$,scalar:R,point:D,pointBytes:L}}function T(S){return A(S).pointBytes}function O(S=new Uint8Array,...P){const I=Rk(...P);return x(s(g(I,vc("context",S),!!i)))}function k(S,P,I={}){S=vc("message",S),i&&(S=i(S));const{prefix:B,scalar:$,pointBytes:R}=A(P),D=O(I.context,B,S),L=w.multiply(D).toRawBytes(),U=O(I.context,L,R,S),z=_(D+U*$);D1("signature.s",z,bo,n);const W=Rk(L,oI(z,r.BYTES));return vc("result",W,r.BYTES*2)}const j=Bae;function N(S,P,I,B=j){const{context:$,zip215:R}=B,D=r.BYTES;S=vc("signature",S,2*D),P=vc("message",P),I=vc("publicKey",I,D),R!==void 0&&v8("zip215",R),i&&(P=i(P));const L=K4(S.slice(D,2*D));let U,z,W;try{U=E.fromHex(I,R),z=E.fromHex(S.slice(0,D),R),W=w.multiplyUnsafe(L)}catch{return!1}if(!R&&U.isSmallOrder())return!1;const K=O($,z.toRawBytes(),U.toRawBytes(),P);return z.add(U.multiplyUnsafe(K)).subtract(W).clearCofactor().equals(E.ZERO)}return w._setWindowSize(8),{CURVE:e,getPublicKey:T,sign:k,verify:N,ExtendedPoint:E,utils:{getExtendedPublicKey:A,randomPrivateKey:()=>o(r.BYTES),precompute(S=8,P=E.BASE){return P._setWindowSize(S),P.multiply(BigInt(3)),P}}}}BigInt(0),BigInt(1);const L9=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Dk=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const Lae=BigInt(1),Mk=BigInt(2);BigInt(3);const Uae=BigInt(5),Fae=BigInt(8);function Hae(t){const e=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),s=L9,o=t*t%s*t%s,a=ma(o,Mk,s)*o%s,c=ma(a,Lae,s)*t%s,u=ma(c,Uae,s)*c%s,l=ma(u,e,s)*u%s,d=ma(l,r,s)*l%s,h=ma(d,n,s)*d%s,f=ma(h,i,s)*h%s,g=ma(f,i,s)*h%s,p=ma(g,e,s)*u%s;return{pow_p_5_8:ma(p,Mk,s)*t%s,b2:o}}function qae(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function zae(t,e){const r=L9,n=mn(e*e*e,r),i=mn(n*n*e,r),s=Hae(t*i).pow_p_5_8;let o=mn(t*n*s,r);const a=mn(e*o*o,r),c=o,u=mn(o*Dk,r),l=a===t,d=a===mn(-t,r),h=a===mn(-t*Dk,r);return l&&(o=c),(d||h)&&(o=u),xae(o,r)&&(o=mn(-o,r)),{isValid:l||d,value:o}}const Wae=eG(L9,void 0,!0),Vae={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Wae,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:Fae,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:fae,randomBytes:GV,adjustScalarBytes:qae,uvRatio:zae},nG=Mae(Vae),Gae="EdDSA",Kae="JWT",EC=".",H6="base64url",iG="utf8",sG="utf8",Zae=":",Yae="did",Jae="key",Lk="base58btc",Qae="z",Xae="K36",ece=32;function U9(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function oG(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?U9(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function aG(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=oG(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return U9(r)}function tce(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=t.length,c=t.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function d(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var p=0,m=0,b=0,v=g.length;b!==v&&g[b]===0;)b++,p++;for(var E=(v-b)*l+1>>>0,w=new Uint8Array(E);b!==v;){for(var C=g[b],y=0,_=E-1;(C!==0||y<m)&&_!==-1;_--,y++)C+=256*w[_]>>>0,w[_]=C%a>>>0,C=C/a>>>0;if(C!==0)throw new Error("Non-zero carry");m=y,b++}for(var x=E-m;x!==E&&w[x]===0;)x++;for(var A=c.repeat(p);x<E;++x)A+=t.charAt(w[x]);return A}function h(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var p=0;if(g[p]!==" "){for(var m=0,b=0;g[p]===c;)m++,p++;for(var v=(g.length-p)*u+1>>>0,E=new Uint8Array(v);g[p];){var w=r[g.charCodeAt(p)];if(w===255)return;for(var C=0,y=v-1;(w!==0||C<b)&&y!==-1;y--,C++)w+=a*E[y]>>>0,E[y]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");b=C,p++}if(g[p]!==" "){for(var _=v-b;_!==v&&E[_]===0;)_++;for(var x=new Uint8Array(m+(v-_)),A=m;_!==v;)x[A++]=E[_++];return x}}}function f(g){var p=h(g);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:h,decode:f}}var rce=tce,nce=rce;const cG=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},ice=t=>new TextEncoder().encode(t),sce=t=>new TextDecoder().decode(t);let oce=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},ace=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return uG(this,e)}},cce=class{constructor(e){this.decoders=e}or(e){return uG(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const uG=(t,e)=>new cce({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let uce=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new oce(e,r,n),this.decoder=new ace(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const q6=({name:t,prefix:e,encode:r,decode:n})=>new uce(t,e,r,n),Pv=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=nce(r,e);return q6({prefix:t,name:e,encode:n,decode:s=>cG(i(s))})},lce=(t,e,r,n)=>{const i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,u=0;for(let l=0;l<s;++l){const d=i[t[l]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,a+=r,a>=8&&(a-=8,o[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},dce=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},qn=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>q6({prefix:e,name:t,encode(i){return dce(i,n,r)},decode(i){return lce(i,n,r,t)}}),hce=q6({prefix:"\0",name:"identity",encode:t=>sce(t),decode:t=>ice(t)});var fce=Object.freeze({__proto__:null,identity:hce});const pce=qn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var gce=Object.freeze({__proto__:null,base2:pce});const mce=qn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var wce=Object.freeze({__proto__:null,base8:mce});const bce=Pv({prefix:"9",name:"base10",alphabet:"0123456789"});var yce=Object.freeze({__proto__:null,base10:bce});const vce=qn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),_ce=qn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Ece=Object.freeze({__proto__:null,base16:vce,base16upper:_ce});const Cce=qn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ace=qn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),xce=qn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Sce=qn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Tce=qn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ice=qn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Pce=qn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Oce=qn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Rce=qn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var kce=Object.freeze({__proto__:null,base32:Cce,base32upper:Ace,base32pad:xce,base32padupper:Sce,base32hex:Tce,base32hexupper:Ice,base32hexpad:Pce,base32hexpadupper:Oce,base32z:Rce});const Nce=Pv({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),$ce=Pv({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var jce=Object.freeze({__proto__:null,base36:Nce,base36upper:$ce});const Bce=Pv({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Dce=Pv({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Mce=Object.freeze({__proto__:null,base58btc:Bce,base58flickr:Dce});const Lce=qn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Uce=qn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Fce=qn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Hce=qn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var qce=Object.freeze({__proto__:null,base64:Lce,base64pad:Uce,base64url:Fce,base64urlpad:Hce});const lG=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),zce=lG.reduce((t,e,r)=>(t[r]=e,t),[]),Wce=lG.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Vce(t){return t.reduce((e,r)=>(e+=zce[r],e),"")}function Gce(t){const e=[];for(const r of t){const n=Wce[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Kce=q6({prefix:"🚀",name:"base256emoji",encode:Vce,decode:Gce});var Zce=Object.freeze({__proto__:null,base256emoji:Kce}),Yce=dG,Uk=128,Jce=-128,Qce=Math.pow(2,31);function dG(t,e,r){e=e||[],r=r||0;for(var n=r;t>=Qce;)e[r++]=t&255|Uk,t/=128;for(;t&Jce;)e[r++]=t&255|Uk,t>>>=7;return e[r]=t|0,dG.bytes=r-n+1,e}var Xce=cI,eue=128,Fk=127;function cI(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw cI.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&Fk)<<i:(o&Fk)*Math.pow(2,i),i+=7}while(o>=eue);return cI.bytes=s-n,r}var tue=Math.pow(2,7),rue=Math.pow(2,14),nue=Math.pow(2,21),iue=Math.pow(2,28),sue=Math.pow(2,35),oue=Math.pow(2,42),aue=Math.pow(2,49),cue=Math.pow(2,56),uue=Math.pow(2,63),lue=function(t){return t<tue?1:t<rue?2:t<nue?3:t<iue?4:t<sue?5:t<oue?6:t<aue?7:t<cue?8:t<uue?9:10},due={encode:Yce,decode:Xce,encodingLength:lue},hG=due;const Hk=(t,e,r=0)=>(hG.encode(t,e,r),e),qk=t=>hG.encodingLength(t),uI=(t,e)=>{const r=e.byteLength,n=qk(t),i=n+qk(r),s=new Uint8Array(i+r);return Hk(t,s,0),Hk(r,s,n),s.set(e,i),new hue(t,r,e,s)};let hue=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};const fG=({name:t,code:e,encode:r})=>new fue(t,e,r);let fue=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?uI(this.code,r):r.then(n=>uI(this.code,n))}else throw Error("Unknown type, must be binary type")}};const pG=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),pue=fG({name:"sha2-256",code:18,encode:pG("SHA-256")}),gue=fG({name:"sha2-512",code:19,encode:pG("SHA-512")});var mue=Object.freeze({__proto__:null,sha256:pue,sha512:gue});const gG=0,wue="identity",mG=cG,bue=t=>uI(gG,mG(t)),yue={code:gG,name:wue,encode:mG,digest:bue};var vue=Object.freeze({__proto__:null,identity:yue});new TextEncoder,new TextDecoder;const zk={...fce,...gce,...wce,...yce,...Ece,...kce,...jce,...Mce,...qce,...Zce};({...mue,...vue});function wG(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Wk=wG("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),S8=wG("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=oG(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),bG={utf8:Wk,"utf-8":Wk,hex:zk.base16,latin1:S8,ascii:S8,binary:S8,...zk};function z6(t,e="utf8"){const r=bG[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}function e1(t,e="utf8"){const r=bG[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?U9(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Vk(t){return jf(z6(e1(t,H6),iG))}function CC(t){return z6(e1(Tu(t),iG),H6)}function yG(t){const e=e1(Xae,Lk),r=Qae+z6(aG([e,t]),Lk);return[Yae,Jae,r].join(Zae)}function _ue(t){return z6(t,H6)}function Eue(t){return e1(t,H6)}function Cue(t){return e1([CC(t.header),CC(t.payload)].join(EC),sG)}function Aue(t){return[CC(t.header),CC(t.payload),_ue(t.signature)].join(EC)}function lI(t){const e=t.split(EC),r=Vk(e[0]),n=Vk(e[1]),i=Eue(e[2]),s=e1(e.slice(0,2).join(EC),sG);return{header:r,payload:n,signature:i,data:s}}function Gk(t=GV(ece)){const e=nG.getPublicKey(t);return{secretKey:aG([t,e]),publicKey:e}}async function xue(t,e,r,n,i=Be.fromMiliseconds(Date.now())){const s={alg:Gae,typ:Kae},o=yG(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},u=Cue({header:s,payload:c}),l=nG.sign(u,n.secretKey.slice(0,32));return Aue({header:s,payload:c,signature:l})}var Kk=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))},Sue=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),Tue=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),Iue=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),Pue=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Oue=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Rue=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,kue=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Zk=3,Nue=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Rue]],Yk=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function $ue(t){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Oue:typeof navigator<"u"?Bue(navigator.userAgent):Mue()}function jue(t){return t!==""&&Nue.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function Bue(t){var e=jue(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new Pue;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Zk&&(i=Kk(Kk([],i,!0),Lue(Zk-i.length),!0)):i=[];var s=i.join("."),o=Due(t),a=kue.exec(t);return a&&a[1]?new Iue(r,s,o,a[1]):new Sue(r,s,o)}function Due(t){for(var e=0,r=Yk.length;e<r;e++){var n=Yk[e],i=n[0],s=n[1],o=s.exec(t);if(o)return i}return null}function Mue(){var t=typeof process<"u"&&process.version;return t?new Tue(process.version.slice(1)):null}function Lue(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var pr={},Jk;function vG(){if(Jk)return pr;Jk=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.getLocalStorage=pr.getLocalStorageOrThrow=pr.getCrypto=pr.getCryptoOrThrow=pr.getLocation=pr.getLocationOrThrow=pr.getNavigator=pr.getNavigatorOrThrow=pr.getDocument=pr.getDocumentOrThrow=pr.getFromWindowOrThrow=pr.getFromWindow=void 0;function t(h){let f;return typeof window<"u"&&typeof window[h]<"u"&&(f=window[h]),f}pr.getFromWindow=t;function e(h){const f=t(h);if(!f)throw new Error(`${h} is not defined in Window`);return f}pr.getFromWindowOrThrow=e;function r(){return e("document")}pr.getDocumentOrThrow=r;function n(){return t("document")}pr.getDocument=n;function i(){return e("navigator")}pr.getNavigatorOrThrow=i;function s(){return t("navigator")}pr.getNavigator=s;function o(){return e("location")}pr.getLocationOrThrow=o;function a(){return t("location")}pr.getLocation=a;function c(){return e("crypto")}pr.getCryptoOrThrow=c;function u(){return t("crypto")}pr.getCrypto=u;function l(){return e("localStorage")}pr.getLocalStorageOrThrow=l;function d(){return t("localStorage")}return pr.getLocalStorage=d,pr}var Iu=vG(),M1={},Qk;function Uue(){if(Qk)return M1;Qk=1,Object.defineProperty(M1,"__esModule",{value:!0}),M1.getWindowMetadata=void 0;const t=vG();function e(){let r,n;try{r=t.getDocumentOrThrow(),n=t.getLocationOrThrow()}catch{return null}function i(){const f=r.getElementsByTagName("link"),g=[];for(let p=0;p<f.length;p++){const m=f[p],b=m.getAttribute("rel");if(b&&b.toLowerCase().indexOf("icon")>-1){const v=m.getAttribute("href");if(v)if(v.toLowerCase().indexOf("https:")===-1&&v.toLowerCase().indexOf("http:")===-1&&v.indexOf("//")!==0){let E=n.protocol+"//"+n.host;if(v.indexOf("/")===0)E+=v;else{const w=n.pathname.split("/");w.pop();const C=w.join("/");E+=C+"/"+v}g.push(E)}else if(v.indexOf("//")===0){const E=n.protocol+v;g.push(E)}else g.push(v)}}return g}function s(...f){const g=r.getElementsByTagName("meta");for(let p=0;p<g.length;p++){const m=g[p],b=["itemprop","property","name"].map(v=>m.getAttribute(v)).filter(v=>v?f.includes(v):!1);if(b.length&&b){const v=m.getAttribute("content");if(v)return v}}return""}function o(){let f=s("name","og:site_name","og:title","twitter:title");return f||(f=r.title),f}function a(){return s("description","og:description","twitter:description","keywords")}const c=o(),u=a(),l=n.origin,d=i();return{description:u,url:l,icons:d,name:c}}return M1.getWindowMetadata=e,M1}var Fue=Uue();function Xb(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function Xk(t){return Xb(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const _G="2.23.2";let L1={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${_G}`};class Bf extends Error{constructor(e,r={}){var a;const n=(()=>{var c;return r.cause instanceof Bf?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),i=r.cause instanceof Bf&&r.cause.docsPath||r.docsPath,s=(a=L1.getDocsUrl)==null?void 0:a.call(L1,{...r,docsPath:i}),o=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...L1.version?[`Version: ${L1.version}`]:[]].join(`
- `);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=_G}walk(e){return EG(this,e)}}function EG(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?EG(t.cause,e):e?null:t}class CG extends Bf{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}function t1(t,{dir:e,size:r=32}={}){return typeof t=="string"?Hue(t,{dir:e,size:r}):que(t,{dir:e,size:r})}function Hue(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new CG({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function que(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new CG({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;i<r;i++){const s=e==="right";n[s?i:r-i-1]=t[s?i:t.length-i-1]}return n}class zue extends Bf{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}}class Wue extends Bf{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function r1(t,{size:e}){if(Xk(t)>e)throw new Wue({givenSize:Xk(t),maxSize:e})}function dI(t,e={}){const{signed:r}=e;e.size&&r1(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n-1n)-1n;return n<=s?n:n-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function Vue(t,e={}){return Number(dI(t,e))}const Gue=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function hI(t,e={}){return typeof t=="number"||typeof t=="bigint"?xG(t,e):typeof t=="string"?Yue(t,e):typeof t=="boolean"?Kue(t,e):AG(t,e)}function Kue(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(r1(r,{size:e.size}),t1(r,{size:e.size})):r}function AG(t,e={}){let r="";for(let i=0;i<t.length;i++)r+=Gue[t[i]];const n=`0x${r}`;return typeof e.size=="number"?(r1(n,{size:e.size}),t1(n,{dir:"right",size:e.size})):n}function xG(t,e={}){const{signed:r,size:n}=e,i=BigInt(t);let s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&r?-s-1n:0;if(s&&i>s||i<o){const c=typeof t=="bigint"?"n":"";throw new zue({max:s?`${s}${c}`:void 0,min:`${o}${c}`,signed:r,size:n,value:`${t}${c}`})}const a=`0x${(r&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?t1(a,{size:n}):a}const Zue=new TextEncoder;function Yue(t,e={}){const r=Zue.encode(t);return AG(r,e)}const Jue=new TextEncoder;function Que(t,e={}){return typeof t=="number"||typeof t=="bigint"?ele(t,e):typeof t=="boolean"?Xue(t,e):Xb(t)?SG(t,e):TG(t,e)}function Xue(t,e={}){const r=new Uint8Array(1);return r[0]=Number(t),typeof e.size=="number"?(r1(r,{size:e.size}),t1(r,{size:e.size})):r}const _c={zero:48,nine:57,A:65,F:70,a:97,f:102};function eN(t){if(t>=_c.zero&&t<=_c.nine)return t-_c.zero;if(t>=_c.A&&t<=_c.F)return t-(_c.A-10);if(t>=_c.a&&t<=_c.f)return t-(_c.a-10)}function SG(t,e={}){let r=t;e.size&&(r1(r,{size:e.size}),r=t1(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,s=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const c=eN(n.charCodeAt(a++)),u=eN(n.charCodeAt(a++));if(c===void 0||u===void 0)throw new Bf(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);s[o]=c*16+u}return s}function ele(t,e){const r=xG(t,e);return SG(r)}function TG(t,e={}){const r=Jue.encode(t);return typeof e.size=="number"?(r1(r,{size:e.size}),t1(r,{dir:"right",size:e.size})):r}function AC(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function tle(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Ov(t,...e){if(!tle(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function rle(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");AC(t.outputLen),AC(t.blockLen)}function am(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function IG(t,e){Ov(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const s3=BigInt(2**32-1),tN=BigInt(32);function nle(t,e=!1){return e?{h:Number(t&s3),l:Number(t>>tN&s3)}:{h:Number(t>>tN&s3)|0,l:Number(t&s3)|0}}function ile(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=nle(t[i],e);[r[i],n[i]]=[s,o]}return[r,n]}const sle=(t,e,r)=>t<<r|e>>>32-r,ole=(t,e,r)=>e<<r|t>>>32-r,ale=(t,e,r)=>e<<r-32|t>>>64-r,cle=(t,e,r)=>t<<r-32|e>>>64-r,Kp=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function ule(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function T8(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function wa(t,e){return t<<32-e|t>>>e}const rN=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function lle(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function nN(t){for(let e=0;e<t.length;e++)t[e]=lle(t[e])}function dle(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function W6(t){return typeof t=="string"&&(t=dle(t)),Ov(t),t}function hle(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];Ov(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}let F9=class{clone(){return this._cloneInto()}};function PG(t){const e=n=>t().update(W6(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function fle(t=32){if(Kp&&typeof Kp.getRandomValues=="function")return Kp.getRandomValues(new Uint8Array(t));if(Kp&&typeof Kp.randomBytes=="function")return Kp.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const OG=[],RG=[],kG=[],ple=BigInt(0),U1=BigInt(1),gle=BigInt(2),mle=BigInt(7),wle=BigInt(256),ble=BigInt(113);for(let t=0,e=U1,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],OG.push(2*(5*n+r)),RG.push((t+1)*(t+2)/2%64);let i=ple;for(let s=0;s<7;s++)e=(e<<U1^(e>>mle)*ble)%wle,e&gle&&(i^=U1<<(U1<<BigInt(s))-U1);kG.push(i)}const[yle,vle]=ile(kG,!0),iN=(t,e,r)=>r>32?ale(t,e,r):sle(t,e,r),sN=(t,e,r)=>r>32?cle(t,e,r):ole(t,e,r);function _le(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=r[c],l=r[c+1],d=iN(u,l,1)^r[a],h=sN(u,l,1)^r[a+1];for(let f=0;f<50;f+=10)t[o+f]^=d,t[o+f+1]^=h}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=RG[o],c=iN(i,s,a),u=sN(i,s,a),l=OG[o];i=t[l],s=t[l+1],t[l]=c,t[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=yle[n],t[1]^=vle[n]}r.fill(0)}let Ele=class NG extends F9{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,AC(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=ule(this.state)}keccak(){rN||nN(this.state32),_le(this.state32,this.rounds),rN||nN(this.state32),this.posOut=0,this.pos=0}update(e){am(this);const{blockLen:r,state:n}=this;e=W6(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);for(let a=0;a<o;a++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){am(this,!1),Ov(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return AC(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(IG(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new NG(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}};const Cle=(t,e,r)=>PG(()=>new Ele(e,t,r)),Ale=Cle(1,136,256/8);function $G(t,e){const r=e||"hex",n=Ale(Xb(t,{strict:!1})?Que(t):t);return r==="bytes"?n:hI(n)}class xle extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const I8=new xle(8192);function Sle(t,e){if(I8.has(`${t}.${e}`))return I8.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),n=$G(TG(r),"bytes"),i=r.split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(n[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return I8.set(`${t}.${e}`,s),s}function Tle(t){const e=$G(`0x${t.substring(4)}`).substring(26);return Sle(`0x${e}`)}async function Ile({hash:t,signature:e}){const r=Xb(t)?t:hI(t),{secp256k1:n}=await ke(async()=>{const{secp256k1:o}=await Promise.resolve().then(()=>wde);return{secp256k1:o}},void 0);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:u,s:l,v:d,yParity:h}=e,f=Number(h??d),g=oN(f);return new n.Signature(dI(u),dI(l)).addRecoveryBit(g)}const o=Xb(e)?e:hI(e),a=Vue(`0x${o.slice(130)}`),c=oN(a);return n.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function oN(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function Ple({hash:t,signature:e}){return Tle(await Ile({hash:t,signature:e}))}function Ole(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+u,a,n)}function Rle(t,e,r){return t&e^~t&r}function kle(t,e,r){return t&e^t&r^e&r}class Nle extends F9{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=T8(this.buffer)}update(e){am(this);const{view:r,buffer:n,blockLen:i}=this;e=W6(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=T8(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){am(this),IG(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(n,0),o=0);for(let d=o;d<i;d++)r[d]=0;Ole(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=T8(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)a.setUint32(4*d,l[d],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%r&&e.buffer.set(n),e}}const $le=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]),ml=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),wl=new Uint32Array(64);let jle=class extends Nle{constructor(){super(64,32,8,!1),this.A=ml[0]|0,this.B=ml[1]|0,this.C=ml[2]|0,this.D=ml[3]|0,this.E=ml[4]|0,this.F=ml[5]|0,this.G=ml[6]|0,this.H=ml[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let d=0;d<16;d++,r+=4)wl[d]=e.getUint32(r,!1);for(let d=16;d<64;d++){const h=wl[d-15],f=wl[d-2],g=wa(h,7)^wa(h,18)^h>>>3,p=wa(f,17)^wa(f,19)^f>>>10;wl[d]=p+wl[d-7]+g+wl[d-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:u,H:l}=this;for(let d=0;d<64;d++){const h=wa(a,6)^wa(a,11)^wa(a,25),f=l+h+Rle(a,c,u)+$le[d]+wl[d]|0,p=(wa(n,2)^wa(n,13)^wa(n,22))+kle(n,i,s)|0;l=u,u=c,c=a,a=o+f|0,o=s,s=i,i=n,n=f+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,i,s,o,a,c,u,l)}roundClean(){wl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const Ble=PG(()=>new jle);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const V6=BigInt(0),G6=BigInt(1),Dle=BigInt(2);function Df(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Rv(t){if(!Df(t))throw new Error("Uint8Array expected")}function cm(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const Mle=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function um(t){Rv(t);let e="";for(let r=0;r<t.length;r++)e+=Mle[t[r]];return e}function z0(t){const e=t.toString(16);return e.length&1?"0"+e:e}function H9(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?V6:BigInt("0x"+t)}const Ec={_0:48,_9:57,A:65,F:70,a:97,f:102};function aN(t){if(t>=Ec._0&&t<=Ec._9)return t-Ec._0;if(t>=Ec.A&&t<=Ec.F)return t-(Ec.A-10);if(t>=Ec.a&&t<=Ec.f)return t-(Ec.a-10)}function lm(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let i=0,s=0;i<r;i++,s+=2){const o=aN(t.charCodeAt(s)),a=aN(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[i]=o*16+a}return n}function Sf(t){return H9(um(t))}function q9(t){return Rv(t),H9(um(Uint8Array.from(t).reverse()))}function dm(t,e){return lm(t.toString(16).padStart(e*2,"0"))}function z9(t,e){return dm(t,e).reverse()}function Lle(t){return lm(z0(t))}function Oo(t,e,r){let n;if(typeof e=="string")try{n=lm(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(Df(e))n=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(t+" of length "+r+" expected, got "+i);return n}function ey(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];Rv(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}function Ule(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}function Fle(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}const P8=t=>typeof t=="bigint"&&V6<=t;function K6(t,e,r){return P8(t)&&P8(e)&&P8(r)&&e<=t&&t<r}function Tf(t,e,r,n){if(!K6(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function jG(t){let e;for(e=0;t>V6;t>>=G6,e+=1);return e}function Hle(t,e){return t>>BigInt(e)&G6}function qle(t,e,r){return t|(r?G6:V6)<<BigInt(e)}const W9=t=>(Dle<<BigInt(t-1))-G6,O8=t=>new Uint8Array(t),cN=t=>Uint8Array.from(t);function BG(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=O8(t),i=O8(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...d)=>r(i,n,...d),c=(d=O8())=>{i=a(cN([0]),d),n=a(),d.length!==0&&(i=a(cN([1]),d),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const h=[];for(;d<e;){n=a();const f=n.slice();h.push(f),d+=n.length}return ey(...h)};return(d,h)=>{o(),c(d);let f;for(;!(f=h(u()));)c();return o(),f}}const zle={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Df(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function kv(t,e,r={}){const n=(i,s,o)=>{const a=zle[s];if(typeof a!="function")throw new Error("invalid validator function");const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+c)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const Wle=()=>{throw new Error("not implemented")};function fI(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const s=t(r,...n);return e.set(r,s),s}}const Vle=Object.freeze(Object.defineProperty({__proto__:null,aInRange:Tf,abool:cm,abytes:Rv,bitGet:Hle,bitLen:jG,bitMask:W9,bitSet:qle,bytesToHex:um,bytesToNumberBE:Sf,bytesToNumberLE:q9,concatBytes:ey,createHmacDrbg:BG,ensureBytes:Oo,equalBytes:Ule,hexToBytes:lm,hexToNumber:H9,inRange:K6,isBytes:Df,memoized:fI,notImplemented:Wle,numberToBytesBE:dm,numberToBytesLE:z9,numberToHexUnpadded:z0,numberToVarBytesBE:Lle,utf8ToBytes:Fle,validateObject:kv},Symbol.toStringTag,{value:"Module"}));let DG=class extends F9{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,rle(e);const n=W6(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return am(this),this.iHash.update(e),this}digestInto(e){am(this),Ov(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const MG=(t,e,r)=>new DG(t,e).update(r).digest();MG.create=(t,e)=>new DG(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Tn=BigInt(0),Zr=BigInt(1),Lh=BigInt(2),Gle=BigInt(3),pI=BigInt(4),uN=BigInt(5),lN=BigInt(8);function zi(t,e){const r=t%e;return r>=Tn?r:e+r}function Kle(t,e,r){if(e<Tn)throw new Error("invalid exponent, negatives unsupported");if(r<=Tn)throw new Error("invalid modulus");if(r===Zr)return Tn;let n=Zr;for(;e>Tn;)e&Zr&&(n=n*t%r),t=t*t%r,e>>=Zr;return n}function Fs(t,e,r){let n=t;for(;e-- >Tn;)n*=n,n%=r;return n}function gI(t,e){if(t===Tn)throw new Error("invert: expected non-zero number");if(e<=Tn)throw new Error("invert: expected positive modulus, got "+e);let r=zi(t,e),n=e,i=Tn,s=Zr;for(;r!==Tn;){const a=n/r,c=n%r,u=i-s*a;n=r,r=c,i=s,s=u}if(n!==Zr)throw new Error("invert: does not exist");return zi(i,e)}function Zle(t){const e=(t-Zr)/Lh;let r,n,i;for(r=t-Zr,n=0;r%Lh===Tn;r/=Lh,n++);for(i=Lh;i<t&&Kle(i,e,t)!==t-Zr;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const o=(t+Zr)/pI;return function(c,u){const l=c.pow(u,o);if(!c.eql(c.sqr(l),u))throw new Error("Cannot find square root");return l}}const s=(r+Zr)/Lh;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=n,l=a.pow(a.mul(a.ONE,i),r),d=a.pow(c,s),h=a.pow(c,r);for(;!a.eql(h,a.ONE);){if(a.eql(h,a.ZERO))return a.ZERO;let f=1;for(let p=a.sqr(h);f<u&&!a.eql(p,a.ONE);f++)p=a.sqr(p);const g=a.pow(l,Zr<<BigInt(u-f-1));l=a.sqr(g),d=a.mul(d,g),h=a.mul(h,l),u=f}return d}}function Yle(t){if(t%pI===Gle){const e=(t+Zr)/pI;return function(n,i){const s=n.pow(i,e);if(!n.eql(n.sqr(s),i))throw new Error("Cannot find square root");return s}}if(t%lN===uN){const e=(t-uN)/lN;return function(n,i){const s=n.mul(i,Lh),o=n.pow(s,e),a=n.mul(i,o),c=n.mul(n.mul(a,Lh),o),u=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),i))throw new Error("Cannot find square root");return u}}return Zle(t)}const Jle=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Qle(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Jle.reduce((n,i)=>(n[i]="function",n),e);return kv(t,r)}function Xle(t,e,r){if(r<Tn)throw new Error("invalid exponent, negatives unsupported");if(r===Tn)return t.ONE;if(r===Zr)return e;let n=t.ONE,i=e;for(;r>Tn;)r&Zr&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Zr;return n}function ede(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function LG(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function UG(t,e,r=!1,n={}){if(t<=Tn)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=LG(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:t,isLE:r,BITS:i,BYTES:s,MASK:W9(i),ZERO:Tn,ONE:Zr,create:c=>zi(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Tn<=c&&c<t},is0:c=>c===Tn,isOdd:c=>(c&Zr)===Zr,neg:c=>zi(-c,t),eql:(c,u)=>c===u,sqr:c=>zi(c*c,t),add:(c,u)=>zi(c+u,t),sub:(c,u)=>zi(c-u,t),mul:(c,u)=>zi(c*u,t),pow:(c,u)=>Xle(a,c,u),div:(c,u)=>zi(c*gI(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>gI(c,t),sqrt:n.sqrt||(c=>(o||(o=Yle(t)),o(a,c))),invertBatch:c=>ede(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>r?z9(c,s):dm(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return r?q9(c):Sf(c)}});return Object.freeze(a)}function FG(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function HG(t){const e=FG(t);return e+Math.ceil(e/2)}function tde(t,e,r=!1){const n=t.length,i=FG(e),s=HG(e);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);const o=r?q9(t):Sf(t),a=zi(o,e-Zr)+Zr;return r?z9(a,i):dm(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const dN=BigInt(0),o3=BigInt(1);function R8(t,e){const r=e.negate();return t?r:e}function qG(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function k8(t,e){qG(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1);return{windows:r,windowSize:n}}function rde(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function nde(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}const N8=new WeakMap,zG=new WeakMap;function $8(t){return zG.get(t)||1}function ide(t,e){return{constTimeNegate:R8,hasPrecomputes(r){return $8(r)!==1},unsafeLadder(r,n,i=t.ZERO){let s=r;for(;n>dN;)n&o3&&(i=i.add(s)),s=s.double(),n>>=o3;return i},precomputeWindow(r,n){const{windows:i,windowSize:s}=k8(n,e),o=[];let a=r,c=a;for(let u=0;u<i;u++){c=a,o.push(c);for(let l=1;l<s;l++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(r,n,i){const{windows:s,windowSize:o}=k8(r,e);let a=t.ZERO,c=t.BASE;const u=BigInt(2**r-1),l=2**r,d=BigInt(r);for(let h=0;h<s;h++){const f=h*o;let g=Number(i&u);i>>=d,g>o&&(g-=l,i+=o3);const p=f,m=f+Math.abs(g)-1,b=h%2!==0,v=g<0;g===0?c=c.add(R8(b,n[p])):a=a.add(R8(v,n[m]))}return{p:a,f:c}},wNAFUnsafe(r,n,i,s=t.ZERO){const{windows:o,windowSize:a}=k8(r,e),c=BigInt(2**r-1),u=2**r,l=BigInt(r);for(let d=0;d<o;d++){const h=d*a;if(i===dN)break;let f=Number(i&c);if(i>>=l,f>a&&(f-=u,i+=o3),f===0)continue;let g=n[h+Math.abs(f)-1];f<0&&(g=g.negate()),s=s.add(g)}return s},getPrecomputes(r,n,i){let s=N8.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&N8.set(n,i(s))),s},wNAFCached(r,n,i){const s=$8(r);return this.wNAF(s,this.getPrecomputes(s,r,i),n)},wNAFCachedUnsafe(r,n,i,s){const o=$8(r);return o===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(o,this.getPrecomputes(o,r,i),n,s)},setWindowSize(r,n){qG(n,e),zG.set(r,n),N8.delete(r)}}}function sde(t,e,r,n){if(rde(r,t),nde(n,e),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,s=jG(BigInt(r.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<<o)-1,c=new Array(a+1).fill(i),u=Math.floor((e.BITS-1)/o)*o;let l=i;for(let d=u;d>=0;d-=o){c.fill(i);for(let f=0;f<n.length;f++){const g=n[f],p=Number(g>>BigInt(d)&BigInt(a));c[p]=c[p].add(r[f])}let h=i;for(let f=c.length-1,g=i;f>0;f--)g=g.add(c[f]),h=h.add(g);if(l=l.add(h),d!==0)for(let f=0;f<o;f++)l=l.double()}return l}function WG(t){return Qle(t.Fp),kv(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...LG(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function hN(t){t.lowS!==void 0&&cm("lowS",t.lowS),t.prehash!==void 0&&cm("prehash",t.prehash)}function ode(t){const e=WG(t);kv(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:ade,hexToBytes:cde}=Vle;class ude extends Error{constructor(e=""){super(e)}}const Jc={Err:ude,_tlv:{encode:(t,e)=>{const{Err:r}=Jc;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length&1)throw new r("tlv.encode: unpadded data");const n=e.length/2,i=z0(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const s=n>127?z0(i.length/2|128):"";return z0(t)+s+i+e},decode(t,e){const{Err:r}=Jc;let n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");const i=e[n++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");const u=e.subarray(n,n+c);if(u.length!==c)throw new r("tlv.decode: length bytes not complete");if(u[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const l of u)o=o<<8|l;if(n+=c,o<128)throw new r("tlv.decode(long): not minimal encoding")}const a=e.subarray(n,n+o);if(a.length!==o)throw new r("tlv.decode: wrong value length");return{v:a,l:e.subarray(n+o)}}},_int:{encode(t){const{Err:e}=Jc;if(t<pu)throw new e("integer: negative integers are not allowed");let r=z0(t);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){const{Err:e}=Jc;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return ade(t)}},toSig(t){const{Err:e,_int:r,_tlv:n}=Jc,i=typeof t=="string"?cde(t):t;Rv(i);const{v:s,l:o}=n.decode(48,i);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=n.decode(2,s),{v:u,l}=n.decode(2,c);if(l.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(t){const{_tlv:e,_int:r}=Jc,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s)),s=n+i;return e.encode(48,s)}},pu=BigInt(0),_n=BigInt(1);BigInt(2);const fN=BigInt(3);BigInt(4);function lde(t){const e=ode(t),{Fp:r}=e,n=UG(e.n,e.nBitLength),i=e.toBytes||((p,m,b)=>{const v=m.toAffine();return ey(Uint8Array.from([4]),r.toBytes(v.x),r.toBytes(v.y))}),s=e.fromBytes||(p=>{const m=p.subarray(1),b=r.fromBytes(m.subarray(0,r.BYTES)),v=r.fromBytes(m.subarray(r.BYTES,2*r.BYTES));return{x:b,y:v}});function o(p){const{a:m,b}=e,v=r.sqr(p),E=r.mul(v,p);return r.add(r.add(E,r.mul(p,m)),b)}if(!r.eql(r.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(p){return K6(p,_n,e.n)}function c(p){const{allowedPrivateKeyLengths:m,nByteLength:b,wrapPrivateKey:v,n:E}=e;if(m&&typeof p!="bigint"){if(Df(p)&&(p=um(p)),typeof p!="string"||!m.includes(p.length))throw new Error("invalid private key");p=p.padStart(b*2,"0")}let w;try{w=typeof p=="bigint"?p:Sf(Oo("private key",p,b))}catch{throw new Error("invalid private key, expected hex or "+b+" bytes, got "+typeof p)}return v&&(w=zi(w,E)),Tf("private key",w,_n,E),w}function u(p){if(!(p instanceof h))throw new Error("ProjectivePoint expected")}const l=fI((p,m)=>{const{px:b,py:v,pz:E}=p;if(r.eql(E,r.ONE))return{x:b,y:v};const w=p.is0();m==null&&(m=w?r.ONE:r.inv(E));const C=r.mul(b,m),y=r.mul(v,m),_=r.mul(E,m);if(w)return{x:r.ZERO,y:r.ZERO};if(!r.eql(_,r.ONE))throw new Error("invZ was invalid");return{x:C,y}}),d=fI(p=>{if(p.is0()){if(e.allowInfinityPoint&&!r.is0(p.py))return;throw new Error("bad point: ZERO")}const{x:m,y:b}=p.toAffine();if(!r.isValid(m)||!r.isValid(b))throw new Error("bad point: x or y not FE");const v=r.sqr(b),E=o(m);if(!r.eql(v,E))throw new Error("bad point: equation left != right");if(!p.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(m,b,v){if(this.px=m,this.py=b,this.pz=v,m==null||!r.isValid(m))throw new Error("x required");if(b==null||!r.isValid(b))throw new Error("y required");if(v==null||!r.isValid(v))throw new Error("z required");Object.freeze(this)}static fromAffine(m){const{x:b,y:v}=m||{};if(!m||!r.isValid(b)||!r.isValid(v))throw new Error("invalid affine point");if(m instanceof h)throw new Error("projective point not allowed");const E=w=>r.eql(w,r.ZERO);return E(b)&&E(v)?h.ZERO:new h(b,v,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const b=r.invertBatch(m.map(v=>v.pz));return m.map((v,E)=>v.toAffine(b[E])).map(h.fromAffine)}static fromHex(m){const b=h.fromAffine(s(Oo("pointHex",m)));return b.assertValidity(),b}static fromPrivateKey(m){return h.BASE.multiply(c(m))}static msm(m,b){return sde(h,n,m,b)}_setWindowSize(m){g.setWindowSize(this,m)}assertValidity(){d(this)}hasEvenY(){const{y:m}=this.toAffine();if(r.isOdd)return!r.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){u(m);const{px:b,py:v,pz:E}=this,{px:w,py:C,pz:y}=m,_=r.eql(r.mul(b,y),r.mul(w,E)),x=r.eql(r.mul(v,y),r.mul(C,E));return _&&x}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){const{a:m,b}=e,v=r.mul(b,fN),{px:E,py:w,pz:C}=this;let y=r.ZERO,_=r.ZERO,x=r.ZERO,A=r.mul(E,E),T=r.mul(w,w),O=r.mul(C,C),k=r.mul(E,w);return k=r.add(k,k),x=r.mul(E,C),x=r.add(x,x),y=r.mul(m,x),_=r.mul(v,O),_=r.add(y,_),y=r.sub(T,_),_=r.add(T,_),_=r.mul(y,_),y=r.mul(k,y),x=r.mul(v,x),O=r.mul(m,O),k=r.sub(A,O),k=r.mul(m,k),k=r.add(k,x),x=r.add(A,A),A=r.add(x,A),A=r.add(A,O),A=r.mul(A,k),_=r.add(_,A),O=r.mul(w,C),O=r.add(O,O),A=r.mul(O,k),y=r.sub(y,A),x=r.mul(O,T),x=r.add(x,x),x=r.add(x,x),new h(y,_,x)}add(m){u(m);const{px:b,py:v,pz:E}=this,{px:w,py:C,pz:y}=m;let _=r.ZERO,x=r.ZERO,A=r.ZERO;const T=e.a,O=r.mul(e.b,fN);let k=r.mul(b,w),j=r.mul(v,C),N=r.mul(E,y),S=r.add(b,v),P=r.add(w,C);S=r.mul(S,P),P=r.add(k,j),S=r.sub(S,P),P=r.add(b,E);let I=r.add(w,y);return P=r.mul(P,I),I=r.add(k,N),P=r.sub(P,I),I=r.add(v,E),_=r.add(C,y),I=r.mul(I,_),_=r.add(j,N),I=r.sub(I,_),A=r.mul(T,P),_=r.mul(O,N),A=r.add(_,A),_=r.sub(j,A),A=r.add(j,A),x=r.mul(_,A),j=r.add(k,k),j=r.add(j,k),N=r.mul(T,N),P=r.mul(O,P),j=r.add(j,N),N=r.sub(k,N),N=r.mul(T,N),P=r.add(P,N),k=r.mul(j,P),x=r.add(x,k),k=r.mul(I,P),_=r.mul(S,_),_=r.sub(_,k),k=r.mul(S,j),A=r.mul(I,A),A=r.add(A,k),new h(_,x,A)}subtract(m){return this.add(m.negate())}is0(){return this.equals(h.ZERO)}wNAF(m){return g.wNAFCached(this,m,h.normalizeZ)}multiplyUnsafe(m){const{endo:b,n:v}=e;Tf("scalar",m,pu,v);const E=h.ZERO;if(m===pu)return E;if(this.is0()||m===_n)return this;if(!b||g.hasPrecomputes(this))return g.wNAFCachedUnsafe(this,m,h.normalizeZ);let{k1neg:w,k1:C,k2neg:y,k2:_}=b.splitScalar(m),x=E,A=E,T=this;for(;C>pu||_>pu;)C&_n&&(x=x.add(T)),_&_n&&(A=A.add(T)),T=T.double(),C>>=_n,_>>=_n;return w&&(x=x.negate()),y&&(A=A.negate()),A=new h(r.mul(A.px,b.beta),A.py,A.pz),x.add(A)}multiply(m){const{endo:b,n:v}=e;Tf("scalar",m,_n,v);let E,w;if(b){const{k1neg:C,k1:y,k2neg:_,k2:x}=b.splitScalar(m);let{p:A,f:T}=this.wNAF(y),{p:O,f:k}=this.wNAF(x);A=g.constTimeNegate(C,A),O=g.constTimeNegate(_,O),O=new h(r.mul(O.px,b.beta),O.py,O.pz),E=A.add(O),w=T.add(k)}else{const{p:C,f:y}=this.wNAF(m);E=C,w=y}return h.normalizeZ([E,w])[0]}multiplyAndAddUnsafe(m,b,v){const E=h.BASE,w=(y,_)=>_===pu||_===_n||!y.equals(E)?y.multiplyUnsafe(_):y.multiply(_),C=w(this,b).add(w(m,v));return C.is0()?void 0:C}toAffine(m){return l(this,m)}isTorsionFree(){const{h:m,isTorsionFree:b}=e;if(m===_n)return!0;if(b)return b(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:b}=e;return m===_n?this:b?b(h,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return cm("isCompressed",m),this.assertValidity(),i(h,this,m)}toHex(m=!0){return cm("isCompressed",m),um(this.toRawBytes(m))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const f=e.nBitLength,g=ide(h,e.endo?Math.ceil(f/2):f);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:a}}function dde(t){const e=WG(t);return kv(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function hde(t){const e=dde(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(N){return zi(N,n)}function a(N){return gI(N,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:l,isWithinCurveOrder:d}=lde({...e,toBytes(N,S,P){const I=S.toAffine(),B=r.toBytes(I.x),$=ey;return cm("isCompressed",P),P?$(Uint8Array.from([S.hasEvenY()?2:3]),B):$(Uint8Array.from([4]),B,r.toBytes(I.y))},fromBytes(N){const S=N.length,P=N[0],I=N.subarray(1);if(S===i&&(P===2||P===3)){const B=Sf(I);if(!K6(B,_n,r.ORDER))throw new Error("Point is not on curve");const $=l(B);let R;try{R=r.sqrt($)}catch(U){const z=U instanceof Error?": "+U.message:"";throw new Error("Point is not on curve"+z)}const D=(R&_n)===_n;return(P&1)===1!==D&&(R=r.neg(R)),{x:B,y:R}}else if(S===s&&P===4){const B=r.fromBytes(I.subarray(0,r.BYTES)),$=r.fromBytes(I.subarray(r.BYTES,2*r.BYTES));return{x:B,y:$}}else{const B=i,$=s;throw new Error("invalid Point, expected length of "+B+", or uncompressed "+$+", got "+S)}}}),h=N=>um(dm(N,e.nByteLength));function f(N){const S=n>>_n;return N>S}function g(N){return f(N)?o(-N):N}const p=(N,S,P)=>Sf(N.slice(S,P));class m{constructor(S,P,I){this.r=S,this.s=P,this.recovery=I,this.assertValidity()}static fromCompact(S){const P=e.nByteLength;return S=Oo("compactSignature",S,P*2),new m(p(S,0,P),p(S,P,2*P))}static fromDER(S){const{r:P,s:I}=Jc.toSig(Oo("DER",S));return new m(P,I)}assertValidity(){Tf("r",this.r,_n,n),Tf("s",this.s,_n,n)}addRecoveryBit(S){return new m(this.r,this.s,S)}recoverPublicKey(S){const{r:P,s:I,recovery:B}=this,$=y(Oo("msgHash",S));if(B==null||![0,1,2,3].includes(B))throw new Error("recovery id invalid");const R=B===2||B===3?P+e.n:P;if(R>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const D=(B&1)===0?"02":"03",L=c.fromHex(D+h(R)),U=a(R),z=o(-$*U),W=o(I*U),K=c.BASE.multiplyAndAddUnsafe(L,z,W);if(!K)throw new Error("point at infinify");return K.assertValidity(),K}hasHighS(){return f(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return lm(this.toDERHex())}toDERHex(){return Jc.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return lm(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const b={isValidPrivateKey(N){try{return u(N),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const N=HG(e.n);return tde(e.randomBytes(N),e.n)},precompute(N=8,S=c.BASE){return S._setWindowSize(N),S.multiply(BigInt(3)),S}};function v(N,S=!0){return c.fromPrivateKey(N).toRawBytes(S)}function E(N){const S=Df(N),P=typeof N=="string",I=(S||P)&&N.length;return S?I===i||I===s:P?I===2*i||I===2*s:N instanceof c}function w(N,S,P=!0){if(E(N))throw new Error("first arg must be private key");if(!E(S))throw new Error("second arg must be public key");return c.fromHex(S).multiply(u(N)).toRawBytes(P)}const C=e.bits2int||function(N){if(N.length>8192)throw new Error("input is too large");const S=Sf(N),P=N.length*8-e.nBitLength;return P>0?S>>BigInt(P):S},y=e.bits2int_modN||function(N){return o(C(N))},_=W9(e.nBitLength);function x(N){return Tf("num < 2^"+e.nBitLength,N,pu,_),dm(N,e.nByteLength)}function A(N,S,P=T){if(["recovered","canonical"].some(ne=>ne in P))throw new Error("sign() legacy options not supported");const{hash:I,randomBytes:B}=e;let{lowS:$,prehash:R,extraEntropy:D}=P;$==null&&($=!0),N=Oo("msgHash",N),hN(P),R&&(N=Oo("prehashed msgHash",I(N)));const L=y(N),U=u(S),z=[x(U),x(L)];if(D!=null&&D!==!1){const ne=D===!0?B(r.BYTES):D;z.push(Oo("extraEntropy",ne))}const W=ey(...z),K=L;function J(ne){const ae=C(ne);if(!d(ae))return;const he=a(ae),ie=c.BASE.multiply(ae).toAffine(),Ee=o(ie.x);if(Ee===pu)return;const pe=o(he*o(K+Ee*U));if(pe===pu)return;let ve=(ie.x===Ee?0:2)|Number(ie.y&_n),je=pe;return $&&f(pe)&&(je=g(pe),ve^=1),new m(Ee,je,ve)}return{seed:W,k2sig:J}}const T={lowS:e.lowS,prehash:!1},O={lowS:e.lowS,prehash:!1};function k(N,S,P=T){const{seed:I,k2sig:B}=A(N,S,P),$=e;return BG($.hash.outputLen,$.nByteLength,$.hmac)(I,B)}c.BASE._setWindowSize(8);function j(N,S,P,I=O){var ve;const B=N;S=Oo("msgHash",S),P=Oo("publicKey",P);const{lowS:$,prehash:R,format:D}=I;if(hN(I),"strict"in I)throw new Error("options.strict was renamed to lowS");if(D!==void 0&&D!=="compact"&&D!=="der")throw new Error("format must be compact or der");const L=typeof B=="string"||Df(B),U=!L&&!D&&typeof B=="object"&&B!==null&&typeof B.r=="bigint"&&typeof B.s=="bigint";if(!L&&!U)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let z,W;try{if(U&&(z=new m(B.r,B.s)),L){try{D!=="compact"&&(z=m.fromDER(B))}catch(je){if(!(je instanceof Jc.Err))throw je}!z&&D!=="der"&&(z=m.fromCompact(B))}W=c.fromHex(P)}catch{return!1}if(!z||$&&z.hasHighS())return!1;R&&(S=e.hash(S));const{r:K,s:J}=z,ne=y(S),ae=a(J),he=o(ne*ae),ie=o(K*ae),Ee=(ve=c.BASE.multiplyAndAddUnsafe(W,he,ie))==null?void 0:ve.toAffine();return Ee?o(Ee.x)===K:!1}return{CURVE:e,getPublicKey:v,getSharedSecret:w,sign:k,verify:j,ProjectivePoint:c,Signature:m,utils:b}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function fde(t){return{hash:t,hmac:(e,...r)=>MG(t,e,hle(...r)),randomBytes:fle}}function pde(t,e){const r=n=>hde({...t,...fde(n)});return{...r(e),create:r}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const VG=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),pN=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),gde=BigInt(1),mI=BigInt(2),gN=(t,e)=>(t+e/mI)/e;function mde(t){const e=VG,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=t*t*t%e,l=u*u*t%e,d=Fs(l,r,e)*l%e,h=Fs(d,r,e)*l%e,f=Fs(h,mI,e)*u%e,g=Fs(f,i,e)*f%e,p=Fs(g,s,e)*g%e,m=Fs(p,a,e)*p%e,b=Fs(m,c,e)*m%e,v=Fs(b,a,e)*p%e,E=Fs(v,r,e)*l%e,w=Fs(E,o,e)*g%e,C=Fs(w,n,e)*u%e,y=Fs(C,mI,e);if(!wI.eql(wI.sqr(y),t))throw new Error("Cannot find square root");return y}const wI=UG(VG,void 0,void 0,{sqrt:mde}),GG=pde({a:BigInt(0),b:BigInt(7),Fp:wI,n:pN,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=pN,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-gde*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=gN(s*t,e),c=gN(-n*t,e);let u=zi(t-a*r-c*i,e),l=zi(-a*n-c*s,e);const d=u>o,h=l>o;if(d&&(u=e-u),h&&(l=e-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:d,k1:u,k2neg:h,k2:l}}}},Ble);BigInt(0);GG.ProjectivePoint;const wde=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:GG},Symbol.toStringTag,{value:"Module"}));function bde(t){if(t.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);for(let u=0;u<e.length;u++)e[u]=255;for(let u=0;u<t.length;u++){const l=t.charAt(u),d=l.charCodeAt(0);if(e[d]!==255)throw new TypeError(l+" is ambiguous");e[d]=u}const r=t.length,n=t.charAt(0),i=Math.log(r)/Math.log(256),s=Math.log(256)/Math.log(r);function o(u){if(u instanceof Uint8Array||(ArrayBuffer.isView(u)?u=new Uint8Array(u.buffer,u.byteOffset,u.byteLength):Array.isArray(u)&&(u=Uint8Array.from(u))),!(u instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(u.length===0)return"";let l=0,d=0,h=0;const f=u.length;for(;h!==f&&u[h]===0;)h++,l++;const g=(f-h)*s+1>>>0,p=new Uint8Array(g);for(;h!==f;){let v=u[h],E=0;for(let w=g-1;(v!==0||E<d)&&w!==-1;w--,E++)v+=256*p[w]>>>0,p[w]=v%r>>>0,v=v/r>>>0;if(v!==0)throw new Error("Non-zero carry");d=E,h++}let m=g-d;for(;m!==g&&p[m]===0;)m++;let b=n.repeat(l);for(;m<g;++m)b+=t.charAt(p[m]);return b}function a(u){if(typeof u!="string")throw new TypeError("Expected String");if(u.length===0)return new Uint8Array;let l=0,d=0,h=0;for(;u[l]===n;)d++,l++;const f=(u.length-l)*i+1>>>0,g=new Uint8Array(f);for(;l<u.length;){const v=u.charCodeAt(l);if(v>255)return;let E=e[v];if(E===255)return;let w=0;for(let C=f-1;(E!==0||w<h)&&C!==-1;C--,w++)E+=r*g[C]>>>0,g[C]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");h=w,l++}let p=f-h;for(;p!==f&&g[p]===0;)p++;const m=new Uint8Array(d+(f-p));let b=d;for(;p!==f;)m[b++]=g[p++];return m}function c(u){const l=a(u);if(l)return l;throw new Error("Non-base"+r+" character")}return{encode:o,decodeUnsafe:a,decode:c}}var yde="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const KG=bde(yde);function ZG(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function db(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=ZG(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function vde(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=t.length,c=t.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function d(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var p=0,m=0,b=0,v=g.length;b!==v&&g[b]===0;)b++,p++;for(var E=(v-b)*l+1>>>0,w=new Uint8Array(E);b!==v;){for(var C=g[b],y=0,_=E-1;(C!==0||y<m)&&_!==-1;_--,y++)C+=256*w[_]>>>0,w[_]=C%a>>>0,C=C/a>>>0;if(C!==0)throw new Error("Non-zero carry");m=y,b++}for(var x=E-m;x!==E&&w[x]===0;)x++;for(var A=c.repeat(p);x<E;++x)A+=t.charAt(w[x]);return A}function h(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var p=0;if(g[p]!==" "){for(var m=0,b=0;g[p]===c;)m++,p++;for(var v=(g.length-p)*u+1>>>0,E=new Uint8Array(v);g[p];){var w=r[g.charCodeAt(p)];if(w===255)return;for(var C=0,y=v-1;(w!==0||C<b)&&y!==-1;y--,C++)w+=a*E[y]>>>0,E[y]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");b=C,p++}if(g[p]!==" "){for(var _=v-b;_!==v&&E[_]===0;)_++;for(var x=new Uint8Array(m+(v-_)),A=m;_!==v;)x[A++]=E[_++];return x}}}function f(g){var p=h(g);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:h,decode:f}}var _de=vde,Ede=_de;const Cde=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Ade=t=>new TextEncoder().encode(t),xde=t=>new TextDecoder().decode(t);class Sde{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Tde{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return YG(this,e)}}class Ide{constructor(e){this.decoders=e}or(e){return YG(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const YG=(t,e)=>new Ide({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Pde{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Sde(e,r,n),this.decoder=new Tde(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Z6=({name:t,prefix:e,encode:r,decode:n})=>new Pde(t,e,r,n),Nv=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Ede(r,e);return Z6({prefix:t,name:e,encode:n,decode:s=>Cde(i(s))})},Ode=(t,e,r,n)=>{const i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,u=0;for(let l=0;l<s;++l){const d=i[t[l]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,a+=r,a>=8&&(a-=8,o[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Rde=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},zn=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Z6({prefix:e,name:t,encode(i){return Rde(i,n,r)},decode(i){return Ode(i,n,r,t)}}),kde=Z6({prefix:"\0",name:"identity",encode:t=>xde(t),decode:t=>Ade(t)}),Nde=Object.freeze(Object.defineProperty({__proto__:null,identity:kde},Symbol.toStringTag,{value:"Module"})),$de=zn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),jde=Object.freeze(Object.defineProperty({__proto__:null,base2:$de},Symbol.toStringTag,{value:"Module"})),Bde=zn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Dde=Object.freeze(Object.defineProperty({__proto__:null,base8:Bde},Symbol.toStringTag,{value:"Module"})),Mde=Nv({prefix:"9",name:"base10",alphabet:"0123456789"}),Lde=Object.freeze(Object.defineProperty({__proto__:null,base10:Mde},Symbol.toStringTag,{value:"Module"})),Ude=zn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Fde=zn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Hde=Object.freeze(Object.defineProperty({__proto__:null,base16:Ude,base16upper:Fde},Symbol.toStringTag,{value:"Module"})),qde=zn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),zde=zn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Wde=zn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Vde=zn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gde=zn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Kde=zn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zde=zn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Yde=zn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Jde=zn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Qde=Object.freeze(Object.defineProperty({__proto__:null,base32:qde,base32hex:Gde,base32hexpad:Zde,base32hexpadupper:Yde,base32hexupper:Kde,base32pad:Wde,base32padupper:Vde,base32upper:zde,base32z:Jde},Symbol.toStringTag,{value:"Module"})),Xde=Nv({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ehe=Nv({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),the=Object.freeze(Object.defineProperty({__proto__:null,base36:Xde,base36upper:ehe},Symbol.toStringTag,{value:"Module"})),rhe=Nv({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),nhe=Nv({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),ihe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:rhe,base58flickr:nhe},Symbol.toStringTag,{value:"Module"})),she=zn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ohe=zn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ahe=zn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),che=zn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),uhe=Object.freeze(Object.defineProperty({__proto__:null,base64:she,base64pad:ohe,base64url:ahe,base64urlpad:che},Symbol.toStringTag,{value:"Module"})),JG=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),lhe=JG.reduce((t,e,r)=>(t[r]=e,t),[]),dhe=JG.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function hhe(t){return t.reduce((e,r)=>(e+=lhe[r],e),"")}function fhe(t){const e=[];for(const r of t){const n=dhe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const phe=Z6({prefix:"🚀",name:"base256emoji",encode:hhe,decode:fhe}),ghe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:phe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const mN={...Nde,...jde,...Dde,...Lde,...Hde,...Qde,...the,...ihe,...uhe,...ghe};function QG(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const wN=QG("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),j8=QG("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=ZG(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),XG={utf8:wN,"utf-8":wN,hex:mN.base16,latin1:j8,ascii:j8,binary:j8,...mN};function ro(t,e="utf8"){const r=XG[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}function Ki(t,e="utf8"){const r=XG[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}const mhe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var whe={};const bhe=":";function ig(t){const[e,r]=t.split(bhe);return{namespace:e,reference:r}}function eK(t,e){return t.includes(":")?[t]:e.chains||[]}var yhe=Object.defineProperty,vhe=Object.defineProperties,_he=Object.getOwnPropertyDescriptors,bN=Object.getOwnPropertySymbols,Ehe=Object.prototype.hasOwnProperty,Che=Object.prototype.propertyIsEnumerable,yN=(t,e,r)=>e in t?yhe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vN=(t,e)=>{for(var r in e||(e={}))Ehe.call(e,r)&&yN(t,r,e[r]);if(bN)for(var r of bN(e))Che.call(e,r)&&yN(t,r,e[r]);return t},Ahe=(t,e)=>vhe(t,_he(e));const xhe="ReactNative",Cs={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},She="js";function xC(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function jd(){return!Iu.getDocument()&&!!Iu.getNavigator()&&navigator.product===xhe}function The(){return jd()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function Ihe(){return jd()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function n1(){return!xC()&&!!Iu.getNavigator()&&!!Iu.getDocument()}function $v(){return jd()?Cs.reactNative:xC()?Cs.node:n1()?Cs.browser:Cs.unknown}function _N(){var t;try{return jd()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function Phe(t,e){const r=new URLSearchParams(t);for(const n of Object.keys(e).sort())if(e.hasOwnProperty(n)){const i=e[n];i!==void 0&&r.set(n,i)}return r.toString()}function Ohe(t){var e,r;const n=tK();try{return t!=null&&t.url&&n.url&&new URL(t.url).host!==new URL(n.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${t.url} differs from the actual page url:${n.url}. This is probably unintended and can lead to issues.`),t.url=n.url),(e=t==null?void 0:t.icons)!=null&&e.length&&t.icons.length>0&&(t.icons=t.icons.filter(i=>i!=="")),Ahe(vN(vN({},n),t),{url:(t==null?void 0:t.url)||n.url,name:(t==null?void 0:t.name)||n.name,description:(t==null?void 0:t.description)||n.description,icons:(r=t==null?void 0:t.icons)!=null&&r.length&&t.icons.length>0?t.icons:n.icons})}catch(i){return console.warn("Error populating app metadata",i),t||n}}function tK(){return Fue.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function Rhe(){if($v()===Cs.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=$ue();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function khe(){var t;const e=$v();return e===Cs.browser?[e,((t=Iu.getLocation())==null?void 0:t.host)||"unknown"].join(":"):e}function rK(t,e,r){const n=Rhe(),i=khe();return[[t,e].join("-"),[She,r].join("-"),n,i].join("/")}function Nhe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o,bundleId:a,packageName:c}){const u=r.split("?"),l=rK(t,e,n),d={auth:i,ua:l,projectId:s,useOnCloseEvent:o,packageName:c||void 0,bundleId:a||void 0},h=Phe(u[1]||"",d);return u[0]+"?"+h}function Yh(t,e){return t.filter(r=>e.includes(r)).length===t.length}function bI(t){return Object.fromEntries(t.entries())}function yI(t){return new Map(Object.entries(t))}function jh(t=Be.FIVE_MINUTES,e){const r=Be.toMiliseconds(t||Be.FIVE_MINUTES);let n,i,s,o;return{resolve:a=>{s&&n&&(clearTimeout(s),n(a),o=Promise.resolve(a))},reject:a=>{s&&i&&(clearTimeout(s),i(a))},done:()=>new Promise((a,c)=>{if(o)return a(o);s=setTimeout(()=>{const u=new Error(e);o=Promise.reject(u),c(u)},r),n=a,i=c})}}function id(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function nK(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function $he(t){return nK("topic",t)}function jhe(t){return nK("id",t)}function iK(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function gn(t,e){return Be.fromMiliseconds(Date.now()+Be.toMiliseconds(t))}function Bl(t){return Date.now()>=Be.toMiliseconds(t)}function Kt(t,e){return`${t}${e?`:${e}`:""}`}function Ka(t=[],e=[]){return[...new Set([...t,...e])]}async function Bhe({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r,s=i==null?void 0:i.href;if(typeof s!="string")return;const o=Dhe(s,t,e),a=$v();if(a===Cs.browser){if(!((n=Iu.getDocument())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}Mhe(o)}else a===Cs.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(i){console.error(i)}}function Dhe(t,e,r){const n=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const s=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${s}${Hhe(n,!0)}`}else i=`${i}/wc?${n}`;return i}function Mhe(t){let e="_self";Fhe()?e="_top":(Uhe()||t.startsWith("https://")||t.startsWith("http://"))&&(e="_blank"),window.open(t,e,"noreferrer noopener")}async function Lhe(t,e){let r="";try{if(n1()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function EN(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function CN(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function V9(){return typeof process<"u"&&whe.IS_VITEST==="true"}function Uhe(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function Fhe(){try{return window.self!==window.top}catch{return!1}}function Hhe(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function sK(t){return Buffer.from(t,"base64").toString("utf-8")}function qhe(t){return new Promise(e=>setTimeout(e,t))}function ty(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function zhe(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function jv(t,...e){if(!zhe(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function G9(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ty(t.outputLen),ty(t.blockLen)}function hm(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function oK(t,e){jv(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const a3=BigInt(2**32-1),AN=BigInt(32);function Whe(t,e=!1){return e?{h:Number(t&a3),l:Number(t>>AN&a3)}:{h:Number(t>>AN&a3)|0,l:Number(t&a3)|0}}function Vhe(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=Whe(t[i],e);[r[i],n[i]]=[s,o]}return[r,n]}const Ghe=(t,e,r)=>t<<r|e>>>32-r,Khe=(t,e,r)=>e<<r|t>>>32-r,Zhe=(t,e,r)=>e<<r-32|t>>>64-r,Yhe=(t,e,r)=>t<<r-32|e>>>64-r,Zp=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function Jhe(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function B8(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function ba(t,e){return t<<32-e|t>>>e}const xN=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Qhe(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function SN(t){for(let e=0;e<t.length;e++)t[e]=Qhe(t[e])}function Xhe(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function fm(t){return typeof t=="string"&&(t=Xhe(t)),jv(t),t}function efe(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];jv(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}let K9=class{clone(){return this._cloneInto()}};function aK(t){const e=n=>t().update(fm(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function i1(t=32){if(Zp&&typeof Zp.getRandomValues=="function")return Zp.getRandomValues(new Uint8Array(t));if(Zp&&typeof Zp.randomBytes=="function")return Zp.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}const cK=[],uK=[],lK=[],tfe=BigInt(0),F1=BigInt(1),rfe=BigInt(2),nfe=BigInt(7),ife=BigInt(256),sfe=BigInt(113);for(let t=0,e=F1,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],cK.push(2*(5*n+r)),uK.push((t+1)*(t+2)/2%64);let i=tfe;for(let s=0;s<7;s++)e=(e<<F1^(e>>nfe)*sfe)%ife,e&rfe&&(i^=F1<<(F1<<BigInt(s))-F1);lK.push(i)}const[ofe,afe]=Vhe(lK,!0),TN=(t,e,r)=>r>32?Zhe(t,e,r):Ghe(t,e,r),IN=(t,e,r)=>r>32?Yhe(t,e,r):Khe(t,e,r);function cfe(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=r[c],l=r[c+1],d=TN(u,l,1)^r[a],h=IN(u,l,1)^r[a+1];for(let f=0;f<50;f+=10)t[o+f]^=d,t[o+f+1]^=h}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=uK[o],c=TN(i,s,a),u=IN(i,s,a),l=cK[o];i=t[l],s=t[l+1],t[l]=c,t[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=ofe[n],t[1]^=afe[n]}r.fill(0)}let ufe=class dK extends K9{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ty(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Jhe(this.state)}keccak(){xN||SN(this.state32),cfe(this.state32,this.rounds),xN||SN(this.state32),this.posOut=0,this.pos=0}update(e){hm(this);const{blockLen:r,state:n}=this;e=fm(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);for(let a=0;a<o;a++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){hm(this,!1),jv(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ty(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(oK(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new dK(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}};const lfe=(t,e,r)=>aK(()=>new ufe(e,t,r)),dfe=lfe(1,136,256/8),hfe="https://rpc.walletconnect.org/v1";function hK(t){const e=`Ethereum Signed Message:
- ${t.length}`,r=new TextEncoder().encode(e+t);return"0x"+Buffer.from(dfe(r)).toString("hex")}async function ffe(t,e,r,n,i,s){switch(r.t){case"eip191":return await pfe(t,e,r.s);case"eip1271":return await gfe(t,e,r.s,n,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}async function pfe(t,e,r){return(await Ple({hash:hK(e),signature:r})).toLowerCase()===t.toLowerCase()}async function gfe(t,e,r,n,i,s){const o=ig(n);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const a="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",u="0000000000000000000000000000000000000000000000000000000000000041",l=r.substring(2),d=hK(e).substring(2),h=a+d+c+u+l,f=await fetch(`${s||hfe}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:mfe(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:h},"latest"]})}),{result:g}=await f.json();return g?g.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function mfe(){return Date.now()+Math.floor(Math.random()*1e3)}function wfe(t){const e=atob(t),r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o);const n=r[0];if(n===0)throw new Error("No signatures found");const i=1+n*64;if(r.length<i)throw new Error("Transaction data too short for claimed signature count");if(r.length<100)throw new Error("Transaction too short");const s=Buffer.from(t,"base64").slice(1,65);return KG.encode(s)}var bfe=Object.defineProperty,yfe=Object.defineProperties,vfe=Object.getOwnPropertyDescriptors,PN=Object.getOwnPropertySymbols,_fe=Object.prototype.hasOwnProperty,Efe=Object.prototype.propertyIsEnumerable,ON=(t,e,r)=>e in t?bfe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cfe=(t,e)=>{for(var r in e||(e={}))_fe.call(e,r)&&ON(t,r,e[r]);if(PN)for(var r of PN(e))Efe.call(e,r)&&ON(t,r,e[r]);return t},Afe=(t,e)=>yfe(t,vfe(e));const xfe="did:pkh:",Z9=t=>t==null?void 0:t.split(":"),Sfe=t=>{const e=t&&Z9(t);if(e)return t.includes(xfe)?e[3]:e[1]},vI=t=>{const e=t&&Z9(t);if(e)return e[2]+":"+e[3]},SC=t=>{const e=t&&Z9(t);if(e)return e.pop()};async function RN(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,s=fK(i,i.iss),o=SC(i.iss);return await ffe(o,s,n,vI(i.iss),r)}const fK=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=SC(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const s=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,a=`Chain ID: ${Sfe(e)}`,c=`Nonce: ${t.nonce}`,u=`Issued At: ${t.iat}`,l=t.exp?`Expiration Time: ${t.exp}`:void 0,d=t.nbf?`Not Before: ${t.nbf}`:void 0,h=t.requestId?`Request ID: ${t.requestId}`:void 0,f=t.resources?`Resources:${t.resources.map(p=>`
- - ${p}`).join("")}`:void 0,g=Z4(t.resources);if(g){const p=ry(g);i=jfe(i,p)}return[r,n,"",i,"",s,o,a,c,u,l,d,h,f].filter(p=>p!=null).join(`
- `)};function Tfe(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function Ife(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Mf(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const n=t.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const s=n[i];if(!Array.isArray(s))throw new Error(`Ability limits ${i} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);s.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${o}`)})})})}function Pfe(t,e,r,n={}){return r==null||r.sort((i,s)=>i.localeCompare(s)),{att:{[t]:Ofe(e,r,n)}}}function Ofe(t,e,r={}){e=e==null?void 0:e.sort((i,s)=>i.localeCompare(s));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function pK(t){return Mf(t),`urn:recap:${Tfe(t).replace(/=/g,"")}`}function ry(t){const e=Ife(t.replace("urn:recap:",""));return Mf(e),e}function Rfe(t,e,r){const n=Pfe(t,e,r);return pK(n)}function kfe(t){return t&&t.includes("urn:recap:")}function Nfe(t,e){const r=ry(t),n=ry(e),i=$fe(r,n);return pK(i)}function $fe(t,e){Mf(t),Mf(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,s)=>i.localeCompare(s)),n={att:{}};return r.forEach(i=>{var s,o;Object.keys(((s=t.att)==null?void 0:s[i])||{}).concat(Object.keys(((o=e.att)==null?void 0:o[i])||{})).sort((a,c)=>a.localeCompare(c)).forEach(a=>{var c,u;n.att[i]=Afe(Cfe({},n.att[i]),{[a]:((c=t.att[i])==null?void 0:c[a])||((u=e.att[i])==null?void 0:u[a])})})}),n}function jfe(t="",e){Mf(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach(a=>{const c=Object.keys(e.att[a]).map(d=>({ability:d.split("/")[0],action:d.split("/")[1]}));c.sort((d,h)=>d.action.localeCompare(h.action));const u={};c.forEach(d=>{u[d.ability]||(u[d.ability]=[]),u[d.ability].push(d.action)});const l=Object.keys(u).map(d=>(i++,`(${i}) '${d}': '${u[d].join("', '")}' for '${a}'.`));n.push(l.join(", ").replace(".,","."))});const s=n.join(" "),o=`${r}${s}`;return`${t?t+" ":""}${o}`}function kN(t){var e;const r=ry(t);Mf(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function NN(t){const e=ry(t);Mf(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var s;(s=i==null?void 0:i[0])!=null&&s.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function Z4(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return kfe(e)?e:void 0}function D8(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function gK(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Es(t,...e){if(!gK(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function $N(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Bfe(t,e){Es(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function jN(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}const ud=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Dfe=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Mfe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Mfe)throw new Error("Non little-endian hardware is not supported");function Lfe(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function _I(t){if(typeof t=="string")t=Lfe(t);else if(gK(t))t=EI(t);else throw new Error("Uint8Array expected, got "+typeof t);return t}function Ufe(t,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(t,e)}function Ffe(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}const Hfe=(t,e)=>{function r(n,...i){if(Es(n),t.nonceLength!==void 0){const u=i[0];if(!u)throw new Error("nonce / iv required");t.varSizeNonce?Es(u):Es(u,t.nonceLength)}const s=t.tagLength;s&&i[1]!==void 0&&Es(i[1]);const o=e(n,...i),a=(u,l)=>{if(l!==void 0){if(u!==2)throw new Error("cipher output not supported");Es(l)}};let c=!1;return{encrypt(u,l){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,Es(u),a(o.encrypt.length,l),o.encrypt(u,l)},decrypt(u,l){if(Es(u),s&&u.length<s)throw new Error("invalid ciphertext length: smaller than tagLength="+s);return a(o.decrypt.length,l),o.decrypt(u,l)}}}return Object.assign(r,t),r};function BN(t,e,r=!0){if(e===void 0)return new Uint8Array(t);if(e.length!==t)throw new Error("invalid output length, expected "+t+", got: "+e.length);if(r&&!qfe(e))throw new Error("invalid output, must be aligned");return e}function DN(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s);t.setUint32(e+4,o,n),t.setUint32(e+0,a,n)}function qfe(t){return t.byteOffset%4===0}function EI(t){return Uint8Array.from(t)}function pm(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}const mK=t=>Uint8Array.from(t.split("").map(e=>e.charCodeAt(0))),zfe=mK("expand 16-byte k"),Wfe=mK("expand 32-byte k"),Vfe=ud(zfe),Gfe=ud(Wfe);function Ut(t,e){return t<<e|t>>>32-e}function CI(t){return t.byteOffset%4===0}const c3=64,Kfe=16,wK=2**32-1,MN=new Uint32Array;function Zfe(t,e,r,n,i,s,o,a){const c=i.length,u=new Uint8Array(c3),l=ud(u),d=CI(i)&&CI(s),h=d?ud(i):MN,f=d?ud(s):MN;for(let g=0;g<c;o++){if(t(e,r,n,l,o,a),o>=wK)throw new Error("arx: counter overflow");const p=Math.min(c3,c-g);if(d&&p===c3){const m=g/4;if(g%4!==0)throw new Error("arx: invalid block position");for(let b=0,v;b<Kfe;b++)v=m+b,f[v]=h[v]^l[b];g+=c3;continue}for(let m=0,b;m<p;m++)b=g+m,s[b]=i[b]^u[m];g+=p}}function Yfe(t,e){const{allowShortKeys:r,extendNonceFn:n,counterLength:i,counterRight:s,rounds:o}=Ufe({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if(typeof t!="function")throw new Error("core must be a function");return D8(i),D8(o),jN(s),jN(r),(a,c,u,l,d=0)=>{Es(a),Es(c),Es(u);const h=u.length;if(l===void 0&&(l=new Uint8Array(h)),Es(l),D8(d),d<0||d>=wK)throw new Error("arx: counter overflow");if(l.length<h)throw new Error(`arx: output (${l.length}) is shorter than data (${h})`);const f=[];let g=a.length,p,m;if(g===32)f.push(p=EI(a)),m=Gfe;else if(g===16&&r)p=new Uint8Array(32),p.set(a),p.set(a,16),m=Vfe,f.push(p);else throw new Error(`arx: invalid 32-byte key, got length=${g}`);CI(c)||f.push(c=EI(c));const b=ud(p);if(n){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");n(m,b,ud(c.subarray(0,16)),b),c=c.subarray(16)}const v=16-i;if(v!==c.length)throw new Error(`arx: nonce must be ${v} or 16 bytes`);if(v!==12){const w=new Uint8Array(12);w.set(c,s?0:12-c.length),c=w,f.push(c)}const E=ud(c);return Zfe(t,m,b,E,u,l,d,o),pm(...f),l}}const kn=(t,e)=>t[e++]&255|(t[e++]&255)<<8;class Jfe{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=_I(e),Es(e,32);const r=kn(e,0),n=kn(e,2),i=kn(e,4),s=kn(e,6),o=kn(e,8),a=kn(e,10),c=kn(e,12),u=kn(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|u<<8)&8191,this.r[9]=u>>>5&127;for(let l=0;l<8;l++)this.pad[l]=kn(e,16+2*l)}process(e,r,n=!1){const i=n?0:2048,{h:s,r:o}=this,a=o[0],c=o[1],u=o[2],l=o[3],d=o[4],h=o[5],f=o[6],g=o[7],p=o[8],m=o[9],b=kn(e,r+0),v=kn(e,r+2),E=kn(e,r+4),w=kn(e,r+6),C=kn(e,r+8),y=kn(e,r+10),_=kn(e,r+12),x=kn(e,r+14);let A=s[0]+(b&8191),T=s[1]+((b>>>13|v<<3)&8191),O=s[2]+((v>>>10|E<<6)&8191),k=s[3]+((E>>>7|w<<9)&8191),j=s[4]+((w>>>4|C<<12)&8191),N=s[5]+(C>>>1&8191),S=s[6]+((C>>>14|y<<2)&8191),P=s[7]+((y>>>11|_<<5)&8191),I=s[8]+((_>>>8|x<<8)&8191),B=s[9]+(x>>>5|i),$=0,R=$+A*a+T*(5*m)+O*(5*p)+k*(5*g)+j*(5*f);$=R>>>13,R&=8191,R+=N*(5*h)+S*(5*d)+P*(5*l)+I*(5*u)+B*(5*c),$+=R>>>13,R&=8191;let D=$+A*c+T*a+O*(5*m)+k*(5*p)+j*(5*g);$=D>>>13,D&=8191,D+=N*(5*f)+S*(5*h)+P*(5*d)+I*(5*l)+B*(5*u),$+=D>>>13,D&=8191;let L=$+A*u+T*c+O*a+k*(5*m)+j*(5*p);$=L>>>13,L&=8191,L+=N*(5*g)+S*(5*f)+P*(5*h)+I*(5*d)+B*(5*l),$+=L>>>13,L&=8191;let U=$+A*l+T*u+O*c+k*a+j*(5*m);$=U>>>13,U&=8191,U+=N*(5*p)+S*(5*g)+P*(5*f)+I*(5*h)+B*(5*d),$+=U>>>13,U&=8191;let z=$+A*d+T*l+O*u+k*c+j*a;$=z>>>13,z&=8191,z+=N*(5*m)+S*(5*p)+P*(5*g)+I*(5*f)+B*(5*h),$+=z>>>13,z&=8191;let W=$+A*h+T*d+O*l+k*u+j*c;$=W>>>13,W&=8191,W+=N*a+S*(5*m)+P*(5*p)+I*(5*g)+B*(5*f),$+=W>>>13,W&=8191;let K=$+A*f+T*h+O*d+k*l+j*u;$=K>>>13,K&=8191,K+=N*c+S*a+P*(5*m)+I*(5*p)+B*(5*g),$+=K>>>13,K&=8191;let J=$+A*g+T*f+O*h+k*d+j*l;$=J>>>13,J&=8191,J+=N*u+S*c+P*a+I*(5*m)+B*(5*p),$+=J>>>13,J&=8191;let ne=$+A*p+T*g+O*f+k*h+j*d;$=ne>>>13,ne&=8191,ne+=N*l+S*u+P*c+I*a+B*(5*m),$+=ne>>>13,ne&=8191;let ae=$+A*m+T*p+O*g+k*f+j*h;$=ae>>>13,ae&=8191,ae+=N*d+S*l+P*u+I*c+B*a,$+=ae>>>13,ae&=8191,$=($<<2)+$|0,$=$+R|0,R=$&8191,$=$>>>13,D+=$,s[0]=R,s[1]=D,s[2]=L,s[3]=U,s[4]=z,s[5]=W,s[6]=K,s[7]=J,s[8]=ne,s[9]=ae}finalize(){const{h:e,pad:r}=this,n=new Uint16Array(10);let i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,n[0]=e[0]+5,i=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=e[a]+i,i=n[a]>>>13,n[a]&=8191;n[9]-=8192;let s=(i^1)-1;for(let a=0;a<10;a++)n[a]&=s;s=~s;for(let a=0;a<10;a++)e[a]=e[a]&s|n[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+r[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+r[a]|0)+(o>>>16)|0,e[a]=o&65535;pm(n)}update(e){$N(this);const{buffer:r,blockLen:n}=this;e=_I(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);if(o===n){for(;n<=i-s;s+=n)this.process(e,s);continue}r.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===n&&(this.process(r,0,!1),this.pos=0)}return this}destroy(){pm(this.h,this.r,this.buffer,this.pad)}digestInto(e){$N(this),Bfe(e,this),this.finished=!0;const{buffer:r,h:n}=this;let{pos:i}=this;if(i){for(r[i++]=1;i<16;i++)r[i]=0;this.process(r,0,!0)}this.finalize();let s=0;for(let o=0;o<8;o++)e[s++]=n[o]>>>0,e[s++]=n[o]>>>8;return e}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}}function Qfe(t){const e=(n,i)=>t(i).update(_I(n)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}const Xfe=Qfe(t=>new Jfe(t));function epe(t,e,r,n,i,s=20){let o=t[0],a=t[1],c=t[2],u=t[3],l=e[0],d=e[1],h=e[2],f=e[3],g=e[4],p=e[5],m=e[6],b=e[7],v=i,E=r[0],w=r[1],C=r[2],y=o,_=a,x=c,A=u,T=l,O=d,k=h,j=f,N=g,S=p,P=m,I=b,B=v,$=E,R=w,D=C;for(let U=0;U<s;U+=2)y=y+T|0,B=Ut(B^y,16),N=N+B|0,T=Ut(T^N,12),y=y+T|0,B=Ut(B^y,8),N=N+B|0,T=Ut(T^N,7),_=_+O|0,$=Ut($^_,16),S=S+$|0,O=Ut(O^S,12),_=_+O|0,$=Ut($^_,8),S=S+$|0,O=Ut(O^S,7),x=x+k|0,R=Ut(R^x,16),P=P+R|0,k=Ut(k^P,12),x=x+k|0,R=Ut(R^x,8),P=P+R|0,k=Ut(k^P,7),A=A+j|0,D=Ut(D^A,16),I=I+D|0,j=Ut(j^I,12),A=A+j|0,D=Ut(D^A,8),I=I+D|0,j=Ut(j^I,7),y=y+O|0,D=Ut(D^y,16),P=P+D|0,O=Ut(O^P,12),y=y+O|0,D=Ut(D^y,8),P=P+D|0,O=Ut(O^P,7),_=_+k|0,B=Ut(B^_,16),I=I+B|0,k=Ut(k^I,12),_=_+k|0,B=Ut(B^_,8),I=I+B|0,k=Ut(k^I,7),x=x+j|0,$=Ut($^x,16),N=N+$|0,j=Ut(j^N,12),x=x+j|0,$=Ut($^x,8),N=N+$|0,j=Ut(j^N,7),A=A+T|0,R=Ut(R^A,16),S=S+R|0,T=Ut(T^S,12),A=A+T|0,R=Ut(R^A,8),S=S+R|0,T=Ut(T^S,7);let L=0;n[L++]=o+y|0,n[L++]=a+_|0,n[L++]=c+x|0,n[L++]=u+A|0,n[L++]=l+T|0,n[L++]=d+O|0,n[L++]=h+k|0,n[L++]=f+j|0,n[L++]=g+N|0,n[L++]=p+S|0,n[L++]=m+P|0,n[L++]=b+I|0,n[L++]=v+B|0,n[L++]=E+$|0,n[L++]=w+R|0,n[L++]=C+D|0}const tpe=Yfe(epe,{counterRight:!1,counterLength:4,allowShortKeys:!1}),rpe=new Uint8Array(16),LN=(t,e)=>{t.update(e);const r=e.length%16;r&&t.update(rpe.subarray(r))},npe=new Uint8Array(32);function UN(t,e,r,n,i){const s=t(e,r,npe),o=Xfe.create(s);i&&LN(o,i),LN(o,n);const a=new Uint8Array(16),c=Dfe(a);DN(c,0,BigInt(i?i.length:0),!0),DN(c,8,BigInt(n.length),!0),o.update(a);const u=o.digest();return pm(s,a),u}const ipe=t=>(e,r,n)=>({encrypt(i,s){const o=i.length;s=BN(o+16,s,!1),s.set(i);const a=s.subarray(0,-16);t(e,r,a,a,1);const c=UN(t,e,r,a,n);return s.set(c,o),pm(c),s},decrypt(i,s){s=BN(i.length-16,s,!1);const o=i.subarray(0,-16),a=i.subarray(-16),c=UN(t,e,r,o,n);if(!Ffe(a,c))throw new Error("invalid tag");return s.set(i.subarray(0,-16)),t(e,r,s,s,1),pm(c),s}}),bK=Hfe({blockSize:64,nonceLength:12,tagLength:16},ipe(tpe));let yK=class extends K9{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,G9(e);const n=fm(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return hm(this),this.iHash.update(e),this}digestInto(e){hm(this),jv(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const Y6=(t,e,r)=>new yK(t,e).update(r).digest();Y6.create=(t,e)=>new yK(t,e);function spe(t,e,r){return G9(t),r===void 0&&(r=new Uint8Array(t.outputLen)),Y6(t,fm(r),fm(e))}const M8=new Uint8Array([0]),FN=new Uint8Array;function ope(t,e,r,n=32){if(G9(t),ty(n),n>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");const i=Math.ceil(n/t.outputLen);r===void 0&&(r=FN);const s=new Uint8Array(i*t.outputLen),o=Y6.create(t,e),a=o._cloneInto(),c=new Uint8Array(o.outputLen);for(let u=0;u<i;u++)M8[0]=u+1,a.update(u===0?FN:c).update(r).update(M8).digestInto(c),s.set(c,t.outputLen*u),o._cloneInto(a);return o.destroy(),a.destroy(),c.fill(0),M8.fill(0),s.slice(0,n)}const ape=(t,e,r,n,i)=>ope(t,spe(t,e,r),n,i);function cpe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+u,a,n)}function upe(t,e,r){return t&e^~t&r}function lpe(t,e,r){return t&e^t&r^e&r}let dpe=class extends K9{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=B8(this.buffer)}update(e){hm(this);const{view:r,buffer:n,blockLen:i}=this;e=fm(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=B8(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){hm(this),oK(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(n,0),o=0);for(let d=o;d<i;d++)r[d]=0;cpe(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=B8(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)a.setUint32(4*d,l[d],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%r&&e.buffer.set(n),e}};const hpe=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]),bl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),yl=new Uint32Array(64);class fpe extends dpe{constructor(){super(64,32,8,!1),this.A=bl[0]|0,this.B=bl[1]|0,this.C=bl[2]|0,this.D=bl[3]|0,this.E=bl[4]|0,this.F=bl[5]|0,this.G=bl[6]|0,this.H=bl[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let d=0;d<16;d++,r+=4)yl[d]=e.getUint32(r,!1);for(let d=16;d<64;d++){const h=yl[d-15],f=yl[d-2],g=ba(h,7)^ba(h,18)^h>>>3,p=ba(f,17)^ba(f,19)^f>>>10;yl[d]=p+yl[d-7]+g+yl[d-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:u,H:l}=this;for(let d=0;d<64;d++){const h=ba(a,6)^ba(a,11)^ba(a,25),f=l+h+upe(a,c,u)+hpe[d]+yl[d]|0,g=(ba(n,2)^ba(n,13)^ba(n,22))+lpe(n,i,s)|0;l=u,u=c,c=a,a=o+f|0,o=s,s=i,i=n,n=f+g|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,i,s,o,a,c,u,l)}roundClean(){yl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Bv=aK(()=>new fpe);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const J6=BigInt(0),Q6=BigInt(1),ppe=BigInt(2);function Lf(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Dv(t){if(!Lf(t))throw new Error("Uint8Array expected")}function gm(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const gpe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function mm(t){Dv(t);let e="";for(let r=0;r<t.length;r++)e+=gpe[t[r]];return e}function W0(t){const e=t.toString(16);return e.length&1?"0"+e:e}function Y9(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?J6:BigInt("0x"+t)}const Cc={_0:48,_9:57,A:65,F:70,a:97,f:102};function HN(t){if(t>=Cc._0&&t<=Cc._9)return t-Cc._0;if(t>=Cc.A&&t<=Cc.F)return t-(Cc.A-10);if(t>=Cc.a&&t<=Cc.f)return t-(Cc.a-10)}function wm(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let i=0,s=0;i<r;i++,s+=2){const o=HN(t.charCodeAt(s)),a=HN(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[i]=o*16+a}return n}function If(t){return Y9(mm(t))}function ny(t){return Dv(t),Y9(mm(Uint8Array.from(t).reverse()))}function bm(t,e){return wm(t.toString(16).padStart(e*2,"0"))}function X6(t,e){return bm(t,e).reverse()}function mpe(t){return wm(W0(t))}function vs(t,e,r){let n;if(typeof e=="string")try{n=wm(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(Lf(e))n=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(t+" of length "+r+" expected, got "+i);return n}function iy(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];Dv(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}function wpe(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}function bpe(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}const L8=t=>typeof t=="bigint"&&J6<=t;function eA(t,e,r){return L8(t)&&L8(e)&&L8(r)&&e<=t&&t<r}function _u(t,e,r,n){if(!eA(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function vK(t){let e;for(e=0;t>J6;t>>=Q6,e+=1);return e}function ype(t,e){return t>>BigInt(e)&Q6}function vpe(t,e,r){return t|(r?Q6:J6)<<BigInt(e)}const J9=t=>(ppe<<BigInt(t-1))-Q6,U8=t=>new Uint8Array(t),qN=t=>Uint8Array.from(t);function _K(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=U8(t),i=U8(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...l)=>r(i,n,...l),c=(l=U8())=>{i=a(qN([0]),l),n=a(),l.length!==0&&(i=a(qN([1]),l),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let l=0;const d=[];for(;l<e;){n=a();const h=n.slice();d.push(h),l+=n.length}return iy(...d)};return(l,d)=>{o(),c(l);let h;for(;!(h=d(u()));)c();return o(),h}}const _pe={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Lf(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function s1(t,e,r={}){const n=(i,s,o)=>{const a=_pe[s];if(typeof a!="function")throw new Error("invalid validator function");const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+c)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const Epe=()=>{throw new Error("not implemented")};function AI(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const s=t(r,...n);return e.set(r,s),s}}var Cpe=Object.freeze({__proto__:null,isBytes:Lf,abytes:Dv,abool:gm,bytesToHex:mm,numberToHexUnpadded:W0,hexToNumber:Y9,hexToBytes:wm,bytesToNumberBE:If,bytesToNumberLE:ny,numberToBytesBE:bm,numberToBytesLE:X6,numberToVarBytesBE:mpe,ensureBytes:vs,concatBytes:iy,equalBytes:wpe,utf8ToBytes:bpe,inRange:eA,aInRange:_u,bitLen:vK,bitGet:ype,bitSet:vpe,bitMask:J9,createHmacDrbg:_K,validateObject:s1,notImplemented:Epe,memoized:AI});const In=BigInt(0),Yr=BigInt(1),Uh=BigInt(2),Ape=BigInt(3),xI=BigInt(4),zN=BigInt(5),WN=BigInt(8);function Wi(t,e){const r=t%e;return r>=In?r:e+r}function EK(t,e,r){if(e<In)throw new Error("invalid exponent, negatives unsupported");if(r<=In)throw new Error("invalid modulus");if(r===Yr)return In;let n=Yr;for(;e>In;)e&Yr&&(n=n*t%r),t=t*t%r,e>>=Yr;return n}function To(t,e,r){let n=t;for(;e-- >In;)n*=n,n%=r;return n}function SI(t,e){if(t===In)throw new Error("invert: expected non-zero number");if(e<=In)throw new Error("invert: expected positive modulus, got "+e);let r=Wi(t,e),n=e,i=In,s=Yr;for(;r!==In;){const o=n/r,a=n%r,c=i-s*o;n=r,r=a,i=s,s=c}if(n!==Yr)throw new Error("invert: does not exist");return Wi(i,e)}function xpe(t){const e=(t-Yr)/Uh;let r,n,i;for(r=t-Yr,n=0;r%Uh===In;r/=Uh,n++);for(i=Uh;i<t&&EK(i,e,t)!==t-Yr;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const o=(t+Yr)/xI;return function(a,c){const u=a.pow(c,o);if(!a.eql(a.sqr(u),c))throw new Error("Cannot find square root");return u}}const s=(r+Yr)/Uh;return function(o,a){if(o.pow(a,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let c=n,u=o.pow(o.mul(o.ONE,i),r),l=o.pow(a,s),d=o.pow(a,r);for(;!o.eql(d,o.ONE);){if(o.eql(d,o.ZERO))return o.ZERO;let h=1;for(let g=o.sqr(d);h<c&&!o.eql(g,o.ONE);h++)g=o.sqr(g);const f=o.pow(u,Yr<<BigInt(c-h-1));u=o.sqr(f),l=o.mul(l,f),d=o.mul(d,u),c=h}return l}}function Spe(t){if(t%xI===Ape){const e=(t+Yr)/xI;return function(r,n){const i=r.pow(n,e);if(!r.eql(r.sqr(i),n))throw new Error("Cannot find square root");return i}}if(t%WN===zN){const e=(t-zN)/WN;return function(r,n){const i=r.mul(n,Uh),s=r.pow(i,e),o=r.mul(n,s),a=r.mul(r.mul(o,Uh),s),c=r.mul(o,r.sub(a,r.ONE));if(!r.eql(r.sqr(c),n))throw new Error("Cannot find square root");return c}}return xpe(t)}const Tpe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ipe(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Tpe.reduce((n,i)=>(n[i]="function",n),e);return s1(t,r)}function Ppe(t,e,r){if(r<In)throw new Error("invalid exponent, negatives unsupported");if(r===In)return t.ONE;if(r===Yr)return e;let n=t.ONE,i=e;for(;r>In;)r&Yr&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Yr;return n}function Ope(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function CK(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function AK(t,e,r=!1,n={}){if(t<=In)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=CK(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:t,isLE:r,BITS:i,BYTES:s,MASK:J9(i),ZERO:In,ONE:Yr,create:c=>Wi(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return In<=c&&c<t},is0:c=>c===In,isOdd:c=>(c&Yr)===Yr,neg:c=>Wi(-c,t),eql:(c,u)=>c===u,sqr:c=>Wi(c*c,t),add:(c,u)=>Wi(c+u,t),sub:(c,u)=>Wi(c-u,t),mul:(c,u)=>Wi(c*u,t),pow:(c,u)=>Ppe(a,c,u),div:(c,u)=>Wi(c*SI(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>SI(c,t),sqrt:n.sqrt||(c=>(o||(o=Spe(t)),o(a,c))),invertBatch:c=>Ope(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>r?X6(c,s):bm(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return r?ny(c):If(c)}});return Object.freeze(a)}function xK(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function SK(t){const e=xK(t);return e+Math.ceil(e/2)}function Rpe(t,e,r=!1){const n=t.length,i=xK(e),s=SK(e);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);const o=r?ny(t):If(t),a=Wi(o,e-Yr)+Yr;return r?X6(a,i):bm(a,i)}const VN=BigInt(0),u3=BigInt(1);function F8(t,e){const r=e.negate();return t?r:e}function TK(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function H8(t,e){TK(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1);return{windows:r,windowSize:n}}function kpe(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function Npe(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}const q8=new WeakMap,IK=new WeakMap;function z8(t){return IK.get(t)||1}function $pe(t,e){return{constTimeNegate:F8,hasPrecomputes(r){return z8(r)!==1},unsafeLadder(r,n,i=t.ZERO){let s=r;for(;n>VN;)n&u3&&(i=i.add(s)),s=s.double(),n>>=u3;return i},precomputeWindow(r,n){const{windows:i,windowSize:s}=H8(n,e),o=[];let a=r,c=a;for(let u=0;u<i;u++){c=a,o.push(c);for(let l=1;l<s;l++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(r,n,i){const{windows:s,windowSize:o}=H8(r,e);let a=t.ZERO,c=t.BASE;const u=BigInt(2**r-1),l=2**r,d=BigInt(r);for(let h=0;h<s;h++){const f=h*o;let g=Number(i&u);i>>=d,g>o&&(g-=l,i+=u3);const p=f,m=f+Math.abs(g)-1,b=h%2!==0,v=g<0;g===0?c=c.add(F8(b,n[p])):a=a.add(F8(v,n[m]))}return{p:a,f:c}},wNAFUnsafe(r,n,i,s=t.ZERO){const{windows:o,windowSize:a}=H8(r,e),c=BigInt(2**r-1),u=2**r,l=BigInt(r);for(let d=0;d<o;d++){const h=d*a;if(i===VN)break;let f=Number(i&c);if(i>>=l,f>a&&(f-=u,i+=u3),f===0)continue;let g=n[h+Math.abs(f)-1];f<0&&(g=g.negate()),s=s.add(g)}return s},getPrecomputes(r,n,i){let s=q8.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&q8.set(n,i(s))),s},wNAFCached(r,n,i){const s=z8(r);return this.wNAF(s,this.getPrecomputes(s,r,i),n)},wNAFCachedUnsafe(r,n,i,s){const o=z8(r);return o===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(o,this.getPrecomputes(o,r,i),n,s)},setWindowSize(r,n){TK(n,e),IK.set(r,n),q8.delete(r)}}}function jpe(t,e,r,n){if(kpe(r,t),Npe(n,e),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,s=vK(BigInt(r.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<<o)-1,c=new Array(a+1).fill(i),u=Math.floor((e.BITS-1)/o)*o;let l=i;for(let d=u;d>=0;d-=o){c.fill(i);for(let f=0;f<n.length;f++){const g=n[f],p=Number(g>>BigInt(d)&BigInt(a));c[p]=c[p].add(r[f])}let h=i;for(let f=c.length-1,g=i;f>0;f--)g=g.add(c[f]),h=h.add(g);if(l=l.add(h),d!==0)for(let f=0;f<o;f++)l=l.double()}return l}function PK(t){return Ipe(t.Fp),s1(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...CK(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}BigInt(0),BigInt(1),BigInt(2),BigInt(8);const Yp=BigInt(0),W8=BigInt(1);function Bpe(t){return s1(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function Dpe(t){const e=Bpe(t),{P:r}=e,n=v=>Wi(v,r),i=e.montgomeryBits,s=Math.ceil(i/8),o=e.nByteLength,a=e.adjustScalarBytes||(v=>v),c=e.powPminus2||(v=>EK(v,r-BigInt(2),r));function u(v,E,w){const C=n(v*(E-w));return E=n(E-C),w=n(w+C),[E,w]}const l=(e.a-BigInt(2))/BigInt(4);function d(v,E){_u("u",v,Yp,r),_u("scalar",E,Yp,r);const w=E,C=v;let y=W8,_=Yp,x=v,A=W8,T=Yp,O;for(let j=BigInt(i-1);j>=Yp;j--){const N=w>>j&W8;T^=N,O=u(T,y,x),y=O[0],x=O[1],O=u(T,_,A),_=O[0],A=O[1],T=N;const S=y+_,P=n(S*S),I=y-_,B=n(I*I),$=P-B,R=x+A,D=x-A,L=n(D*S),U=n(R*I),z=L+U,W=L-U;x=n(z*z),A=n(C*n(W*W)),y=n(P*B),_=n($*(P+n(l*$)))}O=u(T,y,x),y=O[0],x=O[1],O=u(T,_,A),_=O[0],A=O[1];const k=c(_);return n(y*k)}function h(v){return X6(n(v),s)}function f(v){const E=vs("u coordinate",v,s);return o===32&&(E[31]&=127),ny(E)}function g(v){const E=vs("scalar",v),w=E.length;if(w!==s&&w!==o){let C=""+s+" or "+o;throw new Error("invalid scalar, expected "+C+" bytes, got "+w)}return ny(a(E))}function p(v,E){const w=f(E),C=g(v),y=d(w,C);if(y===Yp)throw new Error("invalid private or public key received");return h(y)}const m=h(e.Gu);function b(v){return p(v,m)}return{scalarMult:p,scalarMultBase:b,getSharedSecret:(v,E)=>p(v,E),getPublicKey:v=>b(v),utils:{randomPrivateKey:()=>e.randomBytes(e.nByteLength)},GuBytes:m}}const TI=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949");BigInt(0);const Mpe=BigInt(1),GN=BigInt(2),Lpe=BigInt(3),Upe=BigInt(5);BigInt(8);function Fpe(t){const e=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),s=TI,o=t*t%s*t%s,a=To(o,GN,s)*o%s,c=To(a,Mpe,s)*t%s,u=To(c,Upe,s)*c%s,l=To(u,e,s)*u%s,d=To(l,r,s)*l%s,h=To(d,n,s)*d%s,f=To(h,i,s)*h%s,g=To(f,i,s)*h%s,p=To(g,e,s)*u%s;return{pow_p_5_8:To(p,GN,s)*t%s,b2:o}}function Hpe(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const II=Dpe({P:TI,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:t=>{const e=TI,{pow_p_5_8:r,b2:n}=Fpe(t);return Wi(To(r,Lpe,e)*n,e)},adjustScalarBytes:Hpe,randomBytes:i1});function KN(t){t.lowS!==void 0&&gm("lowS",t.lowS),t.prehash!==void 0&&gm("prehash",t.prehash)}function qpe(t){const e=PK(t);s1(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:zpe,hexToBytes:Wpe}=Cpe;class Vpe extends Error{constructor(e=""){super(e)}}const Qc={Err:Vpe,_tlv:{encode:(t,e)=>{const{Err:r}=Qc;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length&1)throw new r("tlv.encode: unpadded data");const n=e.length/2,i=W0(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const s=n>127?W0(i.length/2|128):"";return W0(t)+s+i+e},decode(t,e){const{Err:r}=Qc;let n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");const i=e[n++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");const u=e.subarray(n,n+c);if(u.length!==c)throw new r("tlv.decode: length bytes not complete");if(u[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const l of u)o=o<<8|l;if(n+=c,o<128)throw new r("tlv.decode(long): not minimal encoding")}const a=e.subarray(n,n+o);if(a.length!==o)throw new r("tlv.decode: wrong value length");return{v:a,l:e.subarray(n+o)}}},_int:{encode(t){const{Err:e}=Qc;if(t<gu)throw new e("integer: negative integers are not allowed");let r=W0(t);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){const{Err:e}=Qc;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return zpe(t)}},toSig(t){const{Err:e,_int:r,_tlv:n}=Qc,i=typeof t=="string"?Wpe(t):t;Dv(i);const{v:s,l:o}=n.decode(48,i);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=n.decode(2,s),{v:u,l}=n.decode(2,c);if(l.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(t){const{_tlv:e,_int:r}=Qc,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s)),s=n+i;return e.encode(48,s)}},gu=BigInt(0),En=BigInt(1);BigInt(2);const ZN=BigInt(3);BigInt(4);function Gpe(t){const e=qpe(t),{Fp:r}=e,n=AK(e.n,e.nBitLength),i=e.toBytes||((p,m,b)=>{const v=m.toAffine();return iy(Uint8Array.from([4]),r.toBytes(v.x),r.toBytes(v.y))}),s=e.fromBytes||(p=>{const m=p.subarray(1),b=r.fromBytes(m.subarray(0,r.BYTES)),v=r.fromBytes(m.subarray(r.BYTES,2*r.BYTES));return{x:b,y:v}});function o(p){const{a:m,b}=e,v=r.sqr(p),E=r.mul(v,p);return r.add(r.add(E,r.mul(p,m)),b)}if(!r.eql(r.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(p){return eA(p,En,e.n)}function c(p){const{allowedPrivateKeyLengths:m,nByteLength:b,wrapPrivateKey:v,n:E}=e;if(m&&typeof p!="bigint"){if(Lf(p)&&(p=mm(p)),typeof p!="string"||!m.includes(p.length))throw new Error("invalid private key");p=p.padStart(b*2,"0")}let w;try{w=typeof p=="bigint"?p:If(vs("private key",p,b))}catch{throw new Error("invalid private key, expected hex or "+b+" bytes, got "+typeof p)}return v&&(w=Wi(w,E)),_u("private key",w,En,E),w}function u(p){if(!(p instanceof h))throw new Error("ProjectivePoint expected")}const l=AI((p,m)=>{const{px:b,py:v,pz:E}=p;if(r.eql(E,r.ONE))return{x:b,y:v};const w=p.is0();m==null&&(m=w?r.ONE:r.inv(E));const C=r.mul(b,m),y=r.mul(v,m),_=r.mul(E,m);if(w)return{x:r.ZERO,y:r.ZERO};if(!r.eql(_,r.ONE))throw new Error("invZ was invalid");return{x:C,y}}),d=AI(p=>{if(p.is0()){if(e.allowInfinityPoint&&!r.is0(p.py))return;throw new Error("bad point: ZERO")}const{x:m,y:b}=p.toAffine();if(!r.isValid(m)||!r.isValid(b))throw new Error("bad point: x or y not FE");const v=r.sqr(b),E=o(m);if(!r.eql(v,E))throw new Error("bad point: equation left != right");if(!p.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(m,b,v){if(this.px=m,this.py=b,this.pz=v,m==null||!r.isValid(m))throw new Error("x required");if(b==null||!r.isValid(b))throw new Error("y required");if(v==null||!r.isValid(v))throw new Error("z required");Object.freeze(this)}static fromAffine(m){const{x:b,y:v}=m||{};if(!m||!r.isValid(b)||!r.isValid(v))throw new Error("invalid affine point");if(m instanceof h)throw new Error("projective point not allowed");const E=w=>r.eql(w,r.ZERO);return E(b)&&E(v)?h.ZERO:new h(b,v,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const b=r.invertBatch(m.map(v=>v.pz));return m.map((v,E)=>v.toAffine(b[E])).map(h.fromAffine)}static fromHex(m){const b=h.fromAffine(s(vs("pointHex",m)));return b.assertValidity(),b}static fromPrivateKey(m){return h.BASE.multiply(c(m))}static msm(m,b){return jpe(h,n,m,b)}_setWindowSize(m){g.setWindowSize(this,m)}assertValidity(){d(this)}hasEvenY(){const{y:m}=this.toAffine();if(r.isOdd)return!r.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){u(m);const{px:b,py:v,pz:E}=this,{px:w,py:C,pz:y}=m,_=r.eql(r.mul(b,y),r.mul(w,E)),x=r.eql(r.mul(v,y),r.mul(C,E));return _&&x}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){const{a:m,b}=e,v=r.mul(b,ZN),{px:E,py:w,pz:C}=this;let y=r.ZERO,_=r.ZERO,x=r.ZERO,A=r.mul(E,E),T=r.mul(w,w),O=r.mul(C,C),k=r.mul(E,w);return k=r.add(k,k),x=r.mul(E,C),x=r.add(x,x),y=r.mul(m,x),_=r.mul(v,O),_=r.add(y,_),y=r.sub(T,_),_=r.add(T,_),_=r.mul(y,_),y=r.mul(k,y),x=r.mul(v,x),O=r.mul(m,O),k=r.sub(A,O),k=r.mul(m,k),k=r.add(k,x),x=r.add(A,A),A=r.add(x,A),A=r.add(A,O),A=r.mul(A,k),_=r.add(_,A),O=r.mul(w,C),O=r.add(O,O),A=r.mul(O,k),y=r.sub(y,A),x=r.mul(O,T),x=r.add(x,x),x=r.add(x,x),new h(y,_,x)}add(m){u(m);const{px:b,py:v,pz:E}=this,{px:w,py:C,pz:y}=m;let _=r.ZERO,x=r.ZERO,A=r.ZERO;const T=e.a,O=r.mul(e.b,ZN);let k=r.mul(b,w),j=r.mul(v,C),N=r.mul(E,y),S=r.add(b,v),P=r.add(w,C);S=r.mul(S,P),P=r.add(k,j),S=r.sub(S,P),P=r.add(b,E);let I=r.add(w,y);return P=r.mul(P,I),I=r.add(k,N),P=r.sub(P,I),I=r.add(v,E),_=r.add(C,y),I=r.mul(I,_),_=r.add(j,N),I=r.sub(I,_),A=r.mul(T,P),_=r.mul(O,N),A=r.add(_,A),_=r.sub(j,A),A=r.add(j,A),x=r.mul(_,A),j=r.add(k,k),j=r.add(j,k),N=r.mul(T,N),P=r.mul(O,P),j=r.add(j,N),N=r.sub(k,N),N=r.mul(T,N),P=r.add(P,N),k=r.mul(j,P),x=r.add(x,k),k=r.mul(I,P),_=r.mul(S,_),_=r.sub(_,k),k=r.mul(S,j),A=r.mul(I,A),A=r.add(A,k),new h(_,x,A)}subtract(m){return this.add(m.negate())}is0(){return this.equals(h.ZERO)}wNAF(m){return g.wNAFCached(this,m,h.normalizeZ)}multiplyUnsafe(m){const{endo:b,n:v}=e;_u("scalar",m,gu,v);const E=h.ZERO;if(m===gu)return E;if(this.is0()||m===En)return this;if(!b||g.hasPrecomputes(this))return g.wNAFCachedUnsafe(this,m,h.normalizeZ);let{k1neg:w,k1:C,k2neg:y,k2:_}=b.splitScalar(m),x=E,A=E,T=this;for(;C>gu||_>gu;)C&En&&(x=x.add(T)),_&En&&(A=A.add(T)),T=T.double(),C>>=En,_>>=En;return w&&(x=x.negate()),y&&(A=A.negate()),A=new h(r.mul(A.px,b.beta),A.py,A.pz),x.add(A)}multiply(m){const{endo:b,n:v}=e;_u("scalar",m,En,v);let E,w;if(b){const{k1neg:C,k1:y,k2neg:_,k2:x}=b.splitScalar(m);let{p:A,f:T}=this.wNAF(y),{p:O,f:k}=this.wNAF(x);A=g.constTimeNegate(C,A),O=g.constTimeNegate(_,O),O=new h(r.mul(O.px,b.beta),O.py,O.pz),E=A.add(O),w=T.add(k)}else{const{p:C,f:y}=this.wNAF(m);E=C,w=y}return h.normalizeZ([E,w])[0]}multiplyAndAddUnsafe(m,b,v){const E=h.BASE,w=(y,_)=>_===gu||_===En||!y.equals(E)?y.multiplyUnsafe(_):y.multiply(_),C=w(this,b).add(w(m,v));return C.is0()?void 0:C}toAffine(m){return l(this,m)}isTorsionFree(){const{h:m,isTorsionFree:b}=e;if(m===En)return!0;if(b)return b(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:b}=e;return m===En?this:b?b(h,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return gm("isCompressed",m),this.assertValidity(),i(h,this,m)}toHex(m=!0){return gm("isCompressed",m),mm(this.toRawBytes(m))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const f=e.nBitLength,g=$pe(h,e.endo?Math.ceil(f/2):f);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:a}}function Kpe(t){const e=PK(t);return s1(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Zpe(t){const e=Kpe(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(N){return Wi(N,n)}function a(N){return SI(N,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:l,isWithinCurveOrder:d}=Gpe({...e,toBytes(N,S,P){const I=S.toAffine(),B=r.toBytes(I.x),$=iy;return gm("isCompressed",P),P?$(Uint8Array.from([S.hasEvenY()?2:3]),B):$(Uint8Array.from([4]),B,r.toBytes(I.y))},fromBytes(N){const S=N.length,P=N[0],I=N.subarray(1);if(S===i&&(P===2||P===3)){const B=If(I);if(!eA(B,En,r.ORDER))throw new Error("Point is not on curve");const $=l(B);let R;try{R=r.sqrt($)}catch(L){const U=L instanceof Error?": "+L.message:"";throw new Error("Point is not on curve"+U)}const D=(R&En)===En;return(P&1)===1!==D&&(R=r.neg(R)),{x:B,y:R}}else if(S===s&&P===4){const B=r.fromBytes(I.subarray(0,r.BYTES)),$=r.fromBytes(I.subarray(r.BYTES,2*r.BYTES));return{x:B,y:$}}else{const B=i,$=s;throw new Error("invalid Point, expected length of "+B+", or uncompressed "+$+", got "+S)}}}),h=N=>mm(bm(N,e.nByteLength));function f(N){const S=n>>En;return N>S}function g(N){return f(N)?o(-N):N}const p=(N,S,P)=>If(N.slice(S,P));class m{constructor(S,P,I){this.r=S,this.s=P,this.recovery=I,this.assertValidity()}static fromCompact(S){const P=e.nByteLength;return S=vs("compactSignature",S,P*2),new m(p(S,0,P),p(S,P,2*P))}static fromDER(S){const{r:P,s:I}=Qc.toSig(vs("DER",S));return new m(P,I)}assertValidity(){_u("r",this.r,En,n),_u("s",this.s,En,n)}addRecoveryBit(S){return new m(this.r,this.s,S)}recoverPublicKey(S){const{r:P,s:I,recovery:B}=this,$=y(vs("msgHash",S));if(B==null||![0,1,2,3].includes(B))throw new Error("recovery id invalid");const R=B===2||B===3?P+e.n:P;if(R>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const D=(B&1)===0?"02":"03",L=c.fromHex(D+h(R)),U=a(R),z=o(-$*U),W=o(I*U),K=c.BASE.multiplyAndAddUnsafe(L,z,W);if(!K)throw new Error("point at infinify");return K.assertValidity(),K}hasHighS(){return f(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return wm(this.toDERHex())}toDERHex(){return Qc.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return wm(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const b={isValidPrivateKey(N){try{return u(N),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const N=SK(e.n);return Rpe(e.randomBytes(N),e.n)},precompute(N=8,S=c.BASE){return S._setWindowSize(N),S.multiply(BigInt(3)),S}};function v(N,S=!0){return c.fromPrivateKey(N).toRawBytes(S)}function E(N){const S=Lf(N),P=typeof N=="string",I=(S||P)&&N.length;return S?I===i||I===s:P?I===2*i||I===2*s:N instanceof c}function w(N,S,P=!0){if(E(N))throw new Error("first arg must be private key");if(!E(S))throw new Error("second arg must be public key");return c.fromHex(S).multiply(u(N)).toRawBytes(P)}const C=e.bits2int||function(N){if(N.length>8192)throw new Error("input is too large");const S=If(N),P=N.length*8-e.nBitLength;return P>0?S>>BigInt(P):S},y=e.bits2int_modN||function(N){return o(C(N))},_=J9(e.nBitLength);function x(N){return _u("num < 2^"+e.nBitLength,N,gu,_),bm(N,e.nByteLength)}function A(N,S,P=T){if(["recovered","canonical"].some(ne=>ne in P))throw new Error("sign() legacy options not supported");const{hash:I,randomBytes:B}=e;let{lowS:$,prehash:R,extraEntropy:D}=P;$==null&&($=!0),N=vs("msgHash",N),KN(P),R&&(N=vs("prehashed msgHash",I(N)));const L=y(N),U=u(S),z=[x(U),x(L)];if(D!=null&&D!==!1){const ne=D===!0?B(r.BYTES):D;z.push(vs("extraEntropy",ne))}const W=iy(...z),K=L;function J(ne){const ae=C(ne);if(!d(ae))return;const he=a(ae),ie=c.BASE.multiply(ae).toAffine(),Ee=o(ie.x);if(Ee===gu)return;const pe=o(he*o(K+Ee*U));if(pe===gu)return;let ve=(ie.x===Ee?0:2)|Number(ie.y&En),je=pe;return $&&f(pe)&&(je=g(pe),ve^=1),new m(Ee,je,ve)}return{seed:W,k2sig:J}}const T={lowS:e.lowS,prehash:!1},O={lowS:e.lowS,prehash:!1};function k(N,S,P=T){const{seed:I,k2sig:B}=A(N,S,P),$=e;return _K($.hash.outputLen,$.nByteLength,$.hmac)(I,B)}c.BASE._setWindowSize(8);function j(N,S,P,I=O){var pe;const B=N;S=vs("msgHash",S),P=vs("publicKey",P);const{lowS:$,prehash:R,format:D}=I;if(KN(I),"strict"in I)throw new Error("options.strict was renamed to lowS");if(D!==void 0&&D!=="compact"&&D!=="der")throw new Error("format must be compact or der");const L=typeof B=="string"||Lf(B),U=!L&&!D&&typeof B=="object"&&B!==null&&typeof B.r=="bigint"&&typeof B.s=="bigint";if(!L&&!U)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let z,W;try{if(U&&(z=new m(B.r,B.s)),L){try{D!=="compact"&&(z=m.fromDER(B))}catch(ve){if(!(ve instanceof Qc.Err))throw ve}!z&&D!=="der"&&(z=m.fromCompact(B))}W=c.fromHex(P)}catch{return!1}if(!z||$&&z.hasHighS())return!1;R&&(S=e.hash(S));const{r:K,s:J}=z,ne=y(S),ae=a(J),he=o(ne*ae),ie=o(K*ae),Ee=(pe=c.BASE.multiplyAndAddUnsafe(W,he,ie))==null?void 0:pe.toAffine();return Ee?o(Ee.x)===K:!1}return{CURVE:e,getPublicKey:v,getSharedSecret:w,sign:k,verify:j,ProjectivePoint:c,Signature:m,utils:b}}function Ype(t){return{hash:t,hmac:(e,...r)=>Y6(t,e,efe(...r)),randomBytes:i1}}function Jpe(t,e){const r=n=>Zpe({...t,...Ype(n)});return{...r(e),create:r}}const OK=AK(BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff")),Qpe=OK.create(BigInt("-3")),Xpe=BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),e0e=Jpe({a:Qpe,b:Xpe,Fp:OK,n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"),h:BigInt(1),lowS:!1},Bv),RK="base10",Ei="base16",Lo="base64pad",Ml="base64url",Mv="utf8",kK=0,Eu=1,Lv=2,t0e=0,YN=1,hb=12,Q9=32;function r0e(){const t=II.utils.randomPrivateKey(),e=II.getPublicKey(t);return{privateKey:Ki(t,Ei),publicKey:Ki(e,Ei)}}function PI(){const t=i1(Q9);return Ki(t,Ei)}function n0e(t,e){const r=II.getSharedSecret(ro(t,Ei),ro(e,Ei)),n=ape(Bv,r,void 0,void 0,Q9);return Ki(n,Ei)}function Y4(t){const e=Bv(ro(t,Ei));return Ki(e,Ei)}function La(t){const e=Bv(ro(t,Mv));return Ki(e,Ei)}function NK(t){return ro(`${t}`,RK)}function Uf(t){return Number(Ki(t,RK))}function $K(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function jK(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),r=(4-e.length%4)%4;return e+"=".repeat(r)}function i0e(t){const e=NK(typeof t.type<"u"?t.type:kK);if(Uf(e)===Eu&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?ro(t.senderPublicKey,Ei):void 0,n=typeof t.iv<"u"?ro(t.iv,Ei):i1(hb),i=ro(t.symKey,Ei),s=bK(i,n).encrypt(ro(t.message,Mv)),o=BK({type:e,sealed:s,iv:n,senderPublicKey:r});return t.encoding===Ml?$K(o):o}function s0e(t){const e=ro(t.symKey,Ei),{sealed:r,iv:n}=sy({encoded:t.encoded,encoding:t.encoding}),i=bK(e,n).decrypt(r);if(i===null)throw new Error("Failed to decrypt");return Ki(i,Mv)}function o0e(t,e){const r=NK(Lv),n=i1(hb),i=ro(t,Mv),s=BK({type:r,sealed:i,iv:n});return e===Ml?$K(s):s}function a0e(t,e){const{sealed:r}=sy({encoded:t,encoding:e});return Ki(r,Mv)}function BK(t){if(Uf(t.type)===Lv)return Ki(db([t.type,t.sealed]),Lo);if(Uf(t.type)===Eu){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Ki(db([t.type,t.senderPublicKey,t.iv,t.sealed]),Lo)}return Ki(db([t.type,t.iv,t.sealed]),Lo)}function sy(t){const e=(t.encoding||Lo)===Ml?jK(t.encoded):t.encoded,r=ro(e,Lo),n=r.slice(t0e,YN),i=YN;if(Uf(n)===Eu){const c=i+Q9,u=c+hb,l=r.slice(i,c),d=r.slice(c,u),h=r.slice(u);return{type:n,sealed:h,iv:d,senderPublicKey:l}}if(Uf(n)===Lv){const c=r.slice(i),u=i1(hb);return{type:n,sealed:c,iv:u}}const s=i+hb,o=r.slice(i,s),a=r.slice(s);return{type:n,sealed:a,iv:o}}function c0e(t,e){const r=sy({encoded:t,encoding:e==null?void 0:e.encoding});return DK({type:Uf(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Ki(r.senderPublicKey,Ei):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function DK(t){const e=(t==null?void 0:t.type)||kK;if(e===Eu){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function JN(t){return t.type===Eu&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function QN(t){return t.type===Lv}function u0e(t){const e=Buffer.from(t.x,"base64"),r=Buffer.from(t.y,"base64");return db([new Uint8Array([4]),e,r])}function l0e(t,e){const[r,n,i]=t.split("."),s=Buffer.from(jK(i),"base64");if(s.length!==64)throw new Error("Invalid signature length");const o=s.slice(0,32),a=s.slice(32,64),c=`${r}.${n}`,u=Bv(c),l=u0e(e);if(!e0e.verify(db([o,a]),u,l))throw new Error("Invalid signature");return lI(t).payload}const d0e="irn";function TC(t){return(t==null?void 0:t.relay)||{protocol:d0e}}function rb(t){const e=mhe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}function h0e(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function XN(t){if(!t.includes("wc:")){const u=sK(t);u!=null&&u.includes("wc:")&&(t=u)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=new URLSearchParams(s),a={};o.forEach((u,l)=>{a[l]=u});const c=typeof a.methods=="string"?a.methods.split(","):void 0;return{protocol:n,topic:f0e(i[0]),version:parseInt(i[1],10),symKey:a.symKey,relay:h0e(a),methods:c,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function f0e(t){return t.startsWith("//")?t.substring(2):t}function p0e(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=i,o=r+e+s;t[s]&&(n[o]=t[s])}),n}function e$(t){const e=new URLSearchParams,r=p0e(t.relay);Object.keys(r).sort().forEach(i=>{e.set(i,r[i])}),e.set("symKey",t.symKey),t.expiryTimestamp&&e.set("expiryTimestamp",t.expiryTimestamp.toString()),t.methods&&e.set("methods",t.methods.join(","));const n=e.toString();return`${t.protocol}:${t.topic}@${t.version}?${n}`}function l3(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}var g0e=Object.defineProperty,m0e=Object.defineProperties,w0e=Object.getOwnPropertyDescriptors,t$=Object.getOwnPropertySymbols,b0e=Object.prototype.hasOwnProperty,y0e=Object.prototype.propertyIsEnumerable,r$=(t,e,r)=>e in t?g0e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,v0e=(t,e)=>{for(var r in e||(e={}))b0e.call(e,r)&&r$(t,r,e[r]);if(t$)for(var r of t$(e))y0e.call(e,r)&&r$(t,r,e[r]);return t},_0e=(t,e)=>m0e(t,w0e(e));function o1(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function E0e(t){const e=[];return Object.values(t).forEach(r=>{e.push(...o1(r.accounts))}),e}function C0e(t,e){const r=[];return Object.values(t).forEach(n=>{o1(n.accounts).includes(e)&&r.push(...n.methods)}),r}function A0e(t,e){const r=[];return Object.values(t).forEach(n=>{o1(n.accounts).includes(e)&&r.push(...n.events)}),r}function tA(t){return t.includes(":")}function V0(t){return tA(t)?t.split(":")[0]:t}function n$(t){var e,r,n;const i={};if(!dd(t))return i;for(const[s,o]of Object.entries(t)){const a=tA(s)?[s]:o.chains,c=o.methods||[],u=o.events||[],l=V0(s);i[l]=_0e(v0e({},i[l]),{chains:Ka(a,(e=i[l])==null?void 0:e.chains),methods:Ka(c,(r=i[l])==null?void 0:r.methods),events:Ka(u,(n=i[l])==null?void 0:n.events)})}return i}function x0e(t){const e={};return t==null||t.forEach(r=>{var n;const[i,s]=r.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[],methods:[]}),e[i].accounts.push(r),(n=e[i].chains)==null||n.push(`${i}:${s}`)}),e}function i$(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=x0e(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=Ka(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}function S0e(t,e){var r,n,i,s,o,a;const c=n$(t),u=n$(e),l={},d=Object.keys(c).concat(Object.keys(u));for(const h of d)l[h]={chains:Ka((r=c[h])==null?void 0:r.chains,(n=u[h])==null?void 0:n.chains),methods:Ka((i=c[h])==null?void 0:i.methods,(s=u[h])==null?void 0:s.methods),events:Ka((o=c[h])==null?void 0:o.events,(a=u[h])==null?void 0:a.events)};return l}const T0e={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},I0e={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function De(t,e){const{message:r,code:n}=I0e[t];return{message:e?`${r} ${e}`:r,code:n}}function sr(t,e){const{message:r,code:n}=T0e[t];return{message:e?`${r} ${e}`:r,code:n}}function ld(t,e){return!!Array.isArray(t)}function dd(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ln(t){return typeof t>"u"}function cn(t,e){return e&&Ln(t)?!0:typeof t=="string"&&!!t.trim().length}function X9(t,e){return e&&Ln(t)?!0:typeof t=="number"&&!isNaN(t)}function P0e(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return Yh(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:u}=t.namespaces[o],l=o1(a),d=r[o];(!Yh(eK(o,d),l)||!Yh(d.methods,c)||!Yh(d.events,u))&&(s=!1)}),s):!1}function IC(t){return cn(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function O0e(t){if(cn(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&IC(r)}}return!1}function R0e(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(cn(t,!1)){if(e(t))return!0;const r=sK(t);return e(r)}}catch{}return!1}function k0e(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function N0e(t){return t==null?void 0:t.topic}function $0e(t,e){let r=null;return cn(t==null?void 0:t.publicKey,!1)||(r=De("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function s$(t){let e=!0;return ld(t)?t.length&&(e=t.every(r=>cn(r,!1))):e=!1,e}function j0e(t,e,r){let n=null;return ld(e)&&e.length?e.forEach(i=>{n||IC(i)||(n=sr("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):IC(t)||(n=sr("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function B0e(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=j0e(i,eK(i,s),`${e} ${r}`);o&&(n=o)}),n}function D0e(t,e){let r=null;return ld(t)?t.forEach(n=>{r||O0e(n)||(r=sr("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=sr("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function M0e(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=D0e(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function L0e(t,e){let r=null;return s$(t==null?void 0:t.methods)?s$(t==null?void 0:t.events)||(r=sr("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=sr("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function MK(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=L0e(n,`${e}, namespace`);i&&(r=i)}),r}function U0e(t,e,r){let n=null;if(t&&dd(t)){const i=MK(t,e);i&&(n=i);const s=B0e(t,e,r);s&&(n=s)}else n=De("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function V8(t,e){let r=null;if(t&&dd(t)){const n=MK(t,e);n&&(r=n);const i=M0e(t,e);i&&(r=i)}else r=De("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function LK(t){return cn(t.protocol,!0)}function F0e(t,e){let r=!1;return t?t&&ld(t)&&t.length&&t.forEach(n=>{r=LK(n)}):r=!0,r}function H0e(t){return typeof t=="number"}function Fi(t){return typeof t<"u"&&typeof t!==null}function q0e(t){return!(!t||typeof t!="object"||!t.code||!X9(t.code,!1)||!t.message||!cn(t.message,!1))}function z0e(t){return!(Ln(t)||!cn(t.method,!1))}function W0e(t){return!(Ln(t)||Ln(t.result)&&Ln(t.error)||!X9(t.id,!1)||!cn(t.jsonrpc,!1))}function V0e(t){return!(Ln(t)||!cn(t.name,!1))}function o$(t,e){return!(!IC(e)||!E0e(t).includes(e))}function G0e(t,e,r){return cn(r,!1)?C0e(t,e).includes(r):!1}function K0e(t,e,r){return cn(r,!1)?A0e(t,e).includes(r):!1}function a$(t,e,r){let n=null;const i=Z0e(t),s=Y0e(e),o=Object.keys(i),a=Object.keys(s),c=c$(Object.keys(t)),u=c$(Object.keys(e)),l=c.filter(d=>!u.includes(d));return l.length&&(n=De("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
- Required: ${l.toString()}
- Received: ${Object.keys(e).toString()}`)),Yh(o,a)||(n=De("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
- Required: ${o.toString()}
- Approved: ${a.toString()}`)),Object.keys(e).forEach(d=>{if(!d.includes(":")||n)return;const h=o1(e[d].accounts);h.includes(d)||(n=De("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${d}
- Required: ${d}
- Approved: ${h.toString()}`))}),o.forEach(d=>{n||(Yh(i[d].methods,s[d].methods)?Yh(i[d].events,s[d].events)||(n=De("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${d}`)):n=De("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${d}`))}),n}function Z0e(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function c$(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function Y0e(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=o1(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function J0e(t,e){return X9(t,!1)&&t<=e.max&&t>=e.min}function u$(){const t=$v();return new Promise(e=>{switch(t){case Cs.browser:e(Q0e());break;case Cs.reactNative:e(X0e());break;case Cs.node:e(ege());break;default:e(!0)}})}function Q0e(){return n1()&&(navigator==null?void 0:navigator.onLine)}async function X0e(){if(jd()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function ege(){return!0}function tge(t){switch($v()){case Cs.browser:rge(t);break;case Cs.reactNative:nge(t);break}}function rge(t){!jd()&&n1()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function nge(t){jd()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}function ige(){var t;return n1()&&Iu.getDocument()?((t=Iu.getDocument())==null?void 0:t.visibilityState)==="visible":!0}const G8={};class H1{static get(e){return G8[e]}static set(e,r){G8[e]=r}static delete(e){delete G8[e]}}const sge="PARSE_ERROR",oge="INVALID_REQUEST",age="METHOD_NOT_FOUND",cge="INVALID_PARAMS",UK="INTERNAL_ERROR",e7="SERVER_ERROR",uge=[-32700,-32600,-32601,-32602,-32603],fb={[sge]:{code:-32700,message:"Parse error"},[oge]:{code:-32600,message:"Invalid Request"},[age]:{code:-32601,message:"Method not found"},[cge]:{code:-32602,message:"Invalid params"},[UK]:{code:-32603,message:"Internal error"},[e7]:{code:-32e3,message:"Server error"}},FK=e7;function lge(t){return uge.includes(t)}function l$(t){return Object.keys(fb).includes(t)?fb[t]:fb[FK]}function dge(t){const e=Object.values(fb).find(r=>r.code===t);return e||fb[FK]}function HK(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var K8={},Ac={},d$;function hge(){if(d$)return Ac;d$=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.isBrowserCryptoAvailable=Ac.getSubtleCrypto=Ac.getBrowerCrypto=void 0;function t(){return(Da==null?void 0:Da.crypto)||(Da==null?void 0:Da.msCrypto)||{}}Ac.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Ac.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Ac.isBrowserCryptoAvailable=r,Ac}var xc={},h$;function fge(){if(h$)return xc;h$=1,Object.defineProperty(xc,"__esModule",{value:!0}),xc.isBrowser=xc.isNode=xc.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}xc.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}xc.isNode=e;function r(){return!t()&&!e()}return xc.isBrowser=r,xc}var f$;function pge(){return f$||(f$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=xv;e.__exportStar(hge(),t),e.__exportStar(fge(),t)}(K8)),K8}var gge=pge();function Ta(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Jh(t=6){return BigInt(Ta(t))}function sd(t,e,r){return{id:r||Ta(),jsonrpc:"2.0",method:t,params:e}}function rA(t,e){return{id:t,jsonrpc:"2.0",result:e}}function nA(t,e,r){return{id:t,jsonrpc:"2.0",error:mge(e)}}function mge(t,e){return typeof t>"u"?l$(UK):(typeof t=="string"&&(t=Object.assign(Object.assign({},l$(e7)),{message:t})),lge(t.code)&&(t=dge(t.code)),t)}let wge=class{},bge=class extends wge{constructor(){super()}},yge=class extends bge{constructor(e){super()}};const vge="^https?:",_ge="^wss?:";function Ege(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function qK(t,e){const r=Ege(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function p$(t){return qK(t,vge)}function g$(t){return qK(t,_ge)}function Cge(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function zK(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function t7(t){return zK(t)&&"method"in t}function iA(t){return zK(t)&&(Ia(t)||eo(t))}function Ia(t){return"result"in t}function eo(t){return"error"in t}let co=class extends yge{constructor(e){super(e),this.events=new ao.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(sd(e.method,e.params||[],e.id||Jh().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{eo(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),iA(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const Age=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),xge=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",m$=t=>t.split("?")[0],w$=10,Sge=Age();let Tge=class{constructor(e){if(this.url=e,this.events=new ao.EventEmitter,this.registering=!1,!g$(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Tu(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!g$(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=gge.isReactNative()?void 0:{rejectUnauthorized:!Cge(e)},s=new Sge(e,[],i);xge()?s.onerror=o=>{const a=o;n(this.emitError(a.error))}:s.on("error",o=>{n(this.emitError(o))}),s.onopen=()=>{this.onOpen(s),r(s)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?jf(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=nA(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return HK(e,m$(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>w$&&this.events.setMaxListeners(w$)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${m$(this.url)}`));return this.events.emit("register_error",r),r}};var Ige={};const WK="wc",VK=2,OI="core",Ja=`${WK}@2:${OI}:`,Pge={logger:"error"},Oge={database:":memory:"},Rge="crypto",b$="client_ed25519_seed",kge=Be.ONE_DAY,Nge="keychain",$ge="0.3",jge="messages",Bge="0.3",y$=Be.SIX_HOURS,Dge="publisher",GK="irn",Mge="error",KK="wss://relay.walletconnect.org",Lge="relayer",xn={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},Uge="_subscription",Hs={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},Fge=.1,RI="2.21.0",Pr={link_mode:"link_mode",relay:"relay"},J4={inbound:"inbound",outbound:"outbound"},Hge="0.3",qge="WALLETCONNECT_CLIENT_ID",v$="WALLETCONNECT_LINK_MODE_APPS",hs={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},zge="subscription",Wge="0.3",Vge="pairing",Gge="0.3",q1={wc_pairingDelete:{req:{ttl:Be.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Be.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Be.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Be.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Be.ONE_DAY,prompt:!1,tag:0},res:{ttl:Be.ONE_DAY,prompt:!1,tag:0}}},Fh={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},yo={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},Kge="history",Zge="0.3",Yge="expirer",Gs={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},Jge="0.3",Qge="verify-api",Xge="https://verify.walletconnect.com",ZK="https://verify.walletconnect.org",pb=ZK,eme=`${pb}/v3`,tme=[Xge,ZK],rme="echo",nme="https://echo.walletconnect.com",Sa={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},Vc={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},vo={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},lh={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},dh={authenticated_session_approve_started:"authenticated_session_approve_started",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve"},z1={no_internet_connection:"no_internet_connection",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},ime=.1,sme="event-client",ome=86400,ame="https://pulse.walletconnect.org/batch";function cme(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=t.length,c=t.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function d(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var p=0,m=0,b=0,v=g.length;b!==v&&g[b]===0;)b++,p++;for(var E=(v-b)*l+1>>>0,w=new Uint8Array(E);b!==v;){for(var C=g[b],y=0,_=E-1;(C!==0||y<m)&&_!==-1;_--,y++)C+=256*w[_]>>>0,w[_]=C%a>>>0,C=C/a>>>0;if(C!==0)throw new Error("Non-zero carry");m=y,b++}for(var x=E-m;x!==E&&w[x]===0;)x++;for(var A=c.repeat(p);x<E;++x)A+=t.charAt(w[x]);return A}function h(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var p=0;if(g[p]!==" "){for(var m=0,b=0;g[p]===c;)m++,p++;for(var v=(g.length-p)*u+1>>>0,E=new Uint8Array(v);g[p];){var w=r[g.charCodeAt(p)];if(w===255)return;for(var C=0,y=v-1;(w!==0||C<b)&&y!==-1;y--,C++)w+=a*E[y]>>>0,E[y]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");b=C,p++}if(g[p]!==" "){for(var _=v-b;_!==v&&E[_]===0;)_++;for(var x=new Uint8Array(m+(v-_)),A=m;_!==v;)x[A++]=E[_++];return x}}}function f(g){var p=h(g);if(p)return p;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:h,decode:f}}var ume=cme,lme=ume;const YK=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},dme=t=>new TextEncoder().encode(t),hme=t=>new TextDecoder().decode(t);class fme{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class pme{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return JK(this,e)}}class gme{constructor(e){this.decoders=e}or(e){return JK(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const JK=(t,e)=>new gme({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class mme{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new fme(e,r,n),this.decoder=new pme(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const sA=({name:t,prefix:e,encode:r,decode:n})=>new mme(t,e,r,n),Uv=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=lme(r,e);return sA({prefix:t,name:e,encode:n,decode:s=>YK(i(s))})},wme=(t,e,r,n)=>{const i={};for(let l=0;l<e.length;++l)i[e[l]]=l;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,u=0;for(let l=0;l<s;++l){const d=i[t[l]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,a+=r,a>=8&&(a-=8,o[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},bme=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},Wn=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>sA({prefix:e,name:t,encode(i){return bme(i,n,r)},decode(i){return wme(i,n,r,t)}}),yme=sA({prefix:"\0",name:"identity",encode:t=>hme(t),decode:t=>dme(t)});var vme=Object.freeze({__proto__:null,identity:yme});const _me=Wn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Eme=Object.freeze({__proto__:null,base2:_me});const Cme=Wn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Ame=Object.freeze({__proto__:null,base8:Cme});const xme=Uv({prefix:"9",name:"base10",alphabet:"0123456789"});var Sme=Object.freeze({__proto__:null,base10:xme});const Tme=Wn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ime=Wn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Pme=Object.freeze({__proto__:null,base16:Tme,base16upper:Ime});const Ome=Wn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Rme=Wn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),kme=Wn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Nme=Wn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),$me=Wn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),jme=Wn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Bme=Wn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Dme=Wn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Mme=Wn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Lme=Object.freeze({__proto__:null,base32:Ome,base32upper:Rme,base32pad:kme,base32padupper:Nme,base32hex:$me,base32hexupper:jme,base32hexpad:Bme,base32hexpadupper:Dme,base32z:Mme});const Ume=Uv({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Fme=Uv({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Hme=Object.freeze({__proto__:null,base36:Ume,base36upper:Fme});const qme=Uv({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),zme=Uv({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Wme=Object.freeze({__proto__:null,base58btc:qme,base58flickr:zme});const Vme=Wn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Gme=Wn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Kme=Wn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Zme=Wn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Yme=Object.freeze({__proto__:null,base64:Vme,base64pad:Gme,base64url:Kme,base64urlpad:Zme});const QK=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Jme=QK.reduce((t,e,r)=>(t[r]=e,t),[]),Qme=QK.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Xme(t){return t.reduce((e,r)=>(e+=Jme[r],e),"")}function e1e(t){const e=[];for(const r of t){const n=Qme[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const t1e=sA({prefix:"🚀",name:"base256emoji",encode:Xme,decode:e1e});var r1e=Object.freeze({__proto__:null,base256emoji:t1e}),n1e=XK,_$=128,i1e=-128,s1e=Math.pow(2,31);function XK(t,e,r){e=e||[],r=r||0;for(var n=r;t>=s1e;)e[r++]=t&255|_$,t/=128;for(;t&i1e;)e[r++]=t&255|_$,t>>>=7;return e[r]=t|0,XK.bytes=r-n+1,e}var o1e=kI,a1e=128,E$=127;function kI(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw kI.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&E$)<<i:(o&E$)*Math.pow(2,i),i+=7}while(o>=a1e);return kI.bytes=s-n,r}var c1e=Math.pow(2,7),u1e=Math.pow(2,14),l1e=Math.pow(2,21),d1e=Math.pow(2,28),h1e=Math.pow(2,35),f1e=Math.pow(2,42),p1e=Math.pow(2,49),g1e=Math.pow(2,56),m1e=Math.pow(2,63),w1e=function(t){return t<c1e?1:t<u1e?2:t<l1e?3:t<d1e?4:t<h1e?5:t<f1e?6:t<p1e?7:t<g1e?8:t<m1e?9:10},b1e={encode:n1e,decode:o1e,encodingLength:w1e},eZ=b1e;const C$=(t,e,r=0)=>(eZ.encode(t,e,r),e),A$=t=>eZ.encodingLength(t),NI=(t,e)=>{const r=e.byteLength,n=A$(t),i=n+A$(r),s=new Uint8Array(i+r);return C$(t,s,0),C$(r,s,n),s.set(e,i),new y1e(t,r,e,s)};class y1e{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const tZ=({name:t,code:e,encode:r})=>new v1e(t,e,r);class v1e{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?NI(this.code,r):r.then(n=>NI(this.code,n))}else throw Error("Unknown type, must be binary type")}}const rZ=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),_1e=tZ({name:"sha2-256",code:18,encode:rZ("SHA-256")}),E1e=tZ({name:"sha2-512",code:19,encode:rZ("SHA-512")});var C1e=Object.freeze({__proto__:null,sha256:_1e,sha512:E1e});const nZ=0,A1e="identity",iZ=YK,x1e=t=>NI(nZ,iZ(t)),S1e={code:nZ,name:A1e,encode:iZ,digest:x1e};var T1e=Object.freeze({__proto__:null,identity:S1e});new TextEncoder,new TextDecoder;const x$={...vme,...Eme,...Ame,...Sme,...Pme,...Lme,...Hme,...Wme,...Yme,...r1e};({...C1e,...T1e});function I1e(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function sZ(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const S$=sZ("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Z8=sZ("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=I1e(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),P1e={utf8:S$,"utf-8":S$,hex:x$.base16,latin1:Z8,ascii:Z8,binary:Z8,...x$};function O1e(t,e="utf8"){const r=P1e[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}var R1e=Object.defineProperty,k1e=(t,e,r)=>e in t?R1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ya=(t,e,r)=>k1e(t,typeof e!="symbol"?e+"":e,r);class N1e{constructor(e,r){this.core=e,this.logger=r,ya(this,"keychain",new Map),ya(this,"name",Nge),ya(this,"version",$ge),ya(this,"initialized",!1),ya(this,"storagePrefix",Ja),ya(this,"init",async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}}),ya(this,"has",n=>(this.isInitialized(),this.keychain.has(n))),ya(this,"set",async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()}),ya(this,"get",n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=De("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i}),ya(this,"del",async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()}),this.core=e,this.logger=si(r,this.name)}get context(){return es(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,bI(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?yI(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}}var $1e=Object.defineProperty,j1e=(t,e,r)=>e in t?$1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Nn=(t,e,r)=>j1e(t,typeof e!="symbol"?e+"":e,r);class B1e{constructor(e,r,n){this.core=e,this.logger=r,Nn(this,"name",Rge),Nn(this,"keychain"),Nn(this,"randomSessionIdentifier",PI()),Nn(this,"initialized",!1),Nn(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),Nn(this,"hasKeys",i=>(this.isInitialized(),this.keychain.has(i))),Nn(this,"getClientId",async()=>{this.isInitialized();const i=await this.getClientSeed(),s=Gk(i);return yG(s.publicKey)}),Nn(this,"generateKeyPair",()=>{this.isInitialized();const i=r0e();return this.setPrivateKey(i.publicKey,i.privateKey)}),Nn(this,"signJWT",async i=>{this.isInitialized();const s=await this.getClientSeed(),o=Gk(s),a=this.randomSessionIdentifier;return await xue(a,i,kge,o)}),Nn(this,"generateSharedKey",(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=n0e(a,s);return this.setSymKey(c,o)}),Nn(this,"setSymKey",async(i,s)=>{this.isInitialized();const o=s||Y4(i);return await this.keychain.set(o,i),o}),Nn(this,"deleteKeyPair",async i=>{this.isInitialized(),await this.keychain.del(i)}),Nn(this,"deleteSymKey",async i=>{this.isInitialized(),await this.keychain.del(i)}),Nn(this,"encode",async(i,s,o)=>{this.isInitialized();const a=DK(o),c=Tu(s);if(QN(a))return o0e(c,o==null?void 0:o.encoding);if(JN(a)){const h=a.senderPublicKey,f=a.receiverPublicKey;i=await this.generateSharedKey(h,f)}const u=this.getSymKey(i),{type:l,senderPublicKey:d}=a;return i0e({type:l,symKey:u,message:c,senderPublicKey:d,encoding:o==null?void 0:o.encoding})}),Nn(this,"decode",async(i,s,o)=>{this.isInitialized();const a=c0e(s,o);if(QN(a)){const c=a0e(s,o==null?void 0:o.encoding);return jf(c)}if(JN(a)){const c=a.receiverPublicKey,u=a.senderPublicKey;i=await this.generateSharedKey(c,u)}try{const c=this.getSymKey(i),u=s0e({symKey:c,encoded:s,encoding:o==null?void 0:o.encoding});return jf(u)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}}),Nn(this,"getPayloadType",(i,s=Lo)=>{const o=sy({encoded:i,encoding:s});return Uf(o.type)}),Nn(this,"getPayloadSenderPublicKey",(i,s=Lo)=>{const o=sy({encoded:i,encoding:s});return o.senderPublicKey?Ki(o.senderPublicKey,Ei):void 0}),this.core=e,this.logger=si(r,this.name),this.keychain=n||new N1e(this.core,this.logger)}get context(){return es(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(b$)}catch{e=PI(),await this.keychain.set(b$,e)}return O1e(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}}var D1e=Object.defineProperty,M1e=Object.defineProperties,L1e=Object.getOwnPropertyDescriptors,T$=Object.getOwnPropertySymbols,U1e=Object.prototype.hasOwnProperty,F1e=Object.prototype.propertyIsEnumerable,$I=(t,e,r)=>e in t?D1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,H1e=(t,e)=>{for(var r in e||(e={}))U1e.call(e,r)&&$I(t,r,e[r]);if(T$)for(var r of T$(e))F1e.call(e,r)&&$I(t,r,e[r]);return t},q1e=(t,e)=>M1e(t,L1e(e)),os=(t,e,r)=>$I(t,typeof e!="symbol"?e+"":e,r);class z1e extends Coe{constructor(e,r){super(e,r),this.logger=e,this.core=r,os(this,"messages",new Map),os(this,"messagesWithoutClientAck",new Map),os(this,"name",jge),os(this,"version",Bge),os(this,"initialized",!1),os(this,"storagePrefix",Ja),os(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n);const i=await this.getRelayerMessagesWithoutClientAck();typeof i<"u"&&(this.messagesWithoutClientAck=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}}),os(this,"set",async(n,i,s)=>{this.isInitialized();const o=La(i);let a=this.messages.get(n);if(typeof a>"u"&&(a={}),typeof a[o]<"u")return o;if(a[o]=i,this.messages.set(n,a),s===J4.inbound){const c=this.messagesWithoutClientAck.get(n)||{};this.messagesWithoutClientAck.set(n,q1e(H1e({},c),{[o]:i}))}return await this.persist(),o}),os(this,"get",n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i}),os(this,"getWithoutAck",n=>{this.isInitialized();const i={};for(const s of n){const o=this.messagesWithoutClientAck.get(s)||{};i[s]=Object.values(o)}return i}),os(this,"has",(n,i)=>{this.isInitialized();const s=this.get(n),o=La(i);return typeof s[o]<"u"}),os(this,"ack",async(n,i)=>{this.isInitialized();const s=this.messagesWithoutClientAck.get(n);if(typeof s>"u")return;const o=La(i);delete s[o],Object.keys(s).length===0?this.messagesWithoutClientAck.delete(n):this.messagesWithoutClientAck.set(n,s),await this.persist()}),os(this,"del",async n=>{this.isInitialized(),this.messages.delete(n),this.messagesWithoutClientAck.delete(n),await this.persist()}),this.logger=si(e,this.name),this.core=r}get context(){return es(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,bI(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,bI(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?yI(e):void 0}async getRelayerMessagesWithoutClientAck(){const e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<"u"?yI(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}}var W1e=Object.defineProperty,V1e=Object.defineProperties,G1e=Object.getOwnPropertyDescriptors,I$=Object.getOwnPropertySymbols,K1e=Object.prototype.hasOwnProperty,Z1e=Object.prototype.propertyIsEnumerable,jI=(t,e,r)=>e in t?W1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,d3=(t,e)=>{for(var r in e||(e={}))K1e.call(e,r)&&jI(t,r,e[r]);if(I$)for(var r of I$(e))Z1e.call(e,r)&&jI(t,r,e[r]);return t},Y8=(t,e)=>V1e(t,G1e(e)),_o=(t,e,r)=>jI(t,typeof e!="symbol"?e+"":e,r);class Y1e extends Aoe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,_o(this,"events",new ao.EventEmitter),_o(this,"name",Dge),_o(this,"queue",new Map),_o(this,"publishTimeout",Be.toMiliseconds(Be.ONE_MINUTE)),_o(this,"initialPublishTimeout",Be.toMiliseconds(Be.ONE_SECOND*15)),_o(this,"needsTransportRestart",!1),_o(this,"publish",async(n,i,s)=>{var o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});const a=(s==null?void 0:s.ttl)||y$,c=TC(s),u=(s==null?void 0:s.prompt)||!1,l=(s==null?void 0:s.tag)||0,d=(s==null?void 0:s.id)||Jh().toString(),h={topic:n,message:i,opts:{ttl:a,relay:c,prompt:u,tag:l,id:d,attestation:s==null?void 0:s.attestation,tvf:s==null?void 0:s.tvf}},f=`Failed to publish payload, please try again. id:${d} tag:${l}`;try{const g=new Promise(async p=>{const m=({id:v})=>{h.opts.id===v&&(this.removeRequestFromQueue(v),this.relayer.events.removeListener(xn.publish,m),p(h))};this.relayer.events.on(xn.publish,m);const b=id(new Promise((v,E)=>{this.rpcPublish({topic:n,message:i,ttl:a,prompt:u,tag:l,id:d,attestation:s==null?void 0:s.attestation,tvf:s==null?void 0:s.tvf}).then(v).catch(w=>{this.logger.warn(w,w==null?void 0:w.message),E(w)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${d} tag:${l}`);try{await b,this.events.removeListener(xn.publish,m)}catch(v){this.queue.set(d,Y8(d3({},h),{attempt:1})),this.logger.warn(v,v==null?void 0:v.message)}});this.logger.trace({type:"method",method:"publish",params:{id:d,topic:n,message:i,opts:s}}),await id(g,this.publishTimeout,f)}catch(g){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(g),(o=s==null?void 0:s.internal)!=null&&o.throwOnFailedPublish)throw g}finally{this.queue.delete(d)}}),_o(this,"on",(n,i)=>{this.events.on(n,i)}),_o(this,"once",(n,i)=>{this.events.once(n,i)}),_o(this,"off",(n,i)=>{this.events.off(n,i)}),_o(this,"removeListener",(n,i)=>{this.events.removeListener(n,i)}),this.relayer=e,this.logger=si(r,this.name),this.registerEventListeners()}get context(){return es(this.logger)}async rpcPublish(e){var r,n,i,s;const{topic:o,message:a,ttl:c=y$,prompt:u,tag:l,id:d,attestation:h,tvf:f}=e,g={method:rb(TC().protocol).publish,params:d3({topic:o,message:a,ttl:c,prompt:u,tag:l,attestation:h},f),id:d};Ln((r=g.params)==null?void 0:r.prompt)&&((n=g.params)==null||delete n.prompt),Ln((i=g.params)==null?void 0:i.tag)&&((s=g.params)==null||delete s.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:g});const p=await this.relayer.request(g);return this.relayer.events.emit(xn.publish,e),this.logger.debug("Successfully Published Payload"),p}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,r)=>{const n=e.attempt+1;this.queue.set(r,Y8(d3({},e),{attempt:n}));const{topic:i,message:s,opts:o,attestation:a}=e;this.logger.warn({},`Publisher: queue->publishing: ${e.opts.id}, tag: ${e.opts.tag}, attempt: ${n}`),await this.rpcPublish(Y8(d3({},e),{topic:i,message:s,ttl:o.ttl,prompt:o.prompt,tag:o.tag,id:o.id,attestation:a,tvf:o.tvf})),this.logger.warn({},`Publisher: queue->published: ${e.opts.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(vp.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(xn.connection_stalled);return}this.checkQueue()}),this.relayer.on(xn.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}var J1e=Object.defineProperty,Q1e=(t,e,r)=>e in t?J1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Jp=(t,e,r)=>Q1e(t,typeof e!="symbol"?e+"":e,r);class X1e{constructor(){Jp(this,"map",new Map),Jp(this,"set",(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])}),Jp(this,"get",e=>this.map.get(e)||[]),Jp(this,"exists",(e,r)=>this.get(e).includes(r)),Jp(this,"delete",(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(s=>s!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)}),Jp(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}}var ewe=Object.defineProperty,twe=Object.defineProperties,rwe=Object.getOwnPropertyDescriptors,P$=Object.getOwnPropertySymbols,nwe=Object.prototype.hasOwnProperty,iwe=Object.prototype.propertyIsEnumerable,BI=(t,e,r)=>e in t?ewe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,W1=(t,e)=>{for(var r in e||(e={}))nwe.call(e,r)&&BI(t,r,e[r]);if(P$)for(var r of P$(e))iwe.call(e,r)&&BI(t,r,e[r]);return t},J8=(t,e)=>twe(t,rwe(e)),gr=(t,e,r)=>BI(t,typeof e!="symbol"?e+"":e,r);class swe extends Toe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,gr(this,"subscriptions",new Map),gr(this,"topicMap",new X1e),gr(this,"events",new ao.EventEmitter),gr(this,"name",zge),gr(this,"version",Wge),gr(this,"pending",new Map),gr(this,"cached",[]),gr(this,"initialized",!1),gr(this,"storagePrefix",Ja),gr(this,"subscribeTimeout",Be.toMiliseconds(Be.ONE_MINUTE)),gr(this,"initialSubscribeTimeout",Be.toMiliseconds(Be.ONE_SECOND*15)),gr(this,"clientId"),gr(this,"batchSubscribeTopicsLimit",500),gr(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),gr(this,"subscribe",async(n,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=TC(i),o={topic:n,relay:s,transportType:i==null?void 0:i.transportType};this.pending.set(n,o);const a=await this.rpcSubscribe(n,s,i);return typeof a=="string"&&(this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}}),gr(this,"unsubscribe",async(n,i)=>{this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)}),gr(this,"isSubscribed",n=>new Promise(i=>{i(this.topicMap.topics.includes(n))})),gr(this,"isKnownTopic",n=>new Promise(i=>{i(this.topicMap.topics.includes(n)||this.pending.has(n)||this.cached.some(s=>s.topic===n))})),gr(this,"on",(n,i)=>{this.events.on(n,i)}),gr(this,"once",(n,i)=>{this.events.once(n,i)}),gr(this,"off",(n,i)=>{this.events.off(n,i)}),gr(this,"removeListener",(n,i)=>{this.events.removeListener(n,i)}),gr(this,"start",async()=>{await this.onConnect()}),gr(this,"stop",async()=>{await this.onDisconnect()}),gr(this,"restart",async()=>{await this.restore(),await this.onRestart()}),gr(this,"checkPending",async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;const n=[];this.pending.forEach(i=>{n.push(i)}),await this.batchSubscribe(n)}),gr(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(vp.pulse,async()=>{await this.checkPending()}),this.events.on(hs.created,async n=>{const i=hs.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()}),this.events.on(hs.deleted,async n=>{const i=hs.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()})}),this.relayer=e,this.logger=si(r,this.name),this.clientId=""}get context(){return es(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=TC(n);await this.restartToComplete({topic:e,id:r,relay:i}),await this.rpcUnsubscribe(e,r,i);const s=sr("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r,n){var i;(!n||(n==null?void 0:n.transportType)===Pr.relay)&&await this.restartToComplete({topic:e,id:e,relay:r});const s={method:rb(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});const o=(i=n==null?void 0:n.internal)==null?void 0:i.throwOnFailedPublish;try{const a=await this.getSubscriptionId(e);if((n==null?void 0:n.transportType)===Pr.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(l=>this.logger.warn(l))},Be.toMiliseconds(Be.ONE_SECOND)),a;const c=new Promise(async l=>{const d=h=>{h.topic===e&&(this.events.removeListener(hs.created,d),l(h.id))};this.events.on(hs.created,d);try{const h=await id(new Promise((f,g)=>{this.relayer.request(s).catch(p=>{this.logger.warn(p,p==null?void 0:p.message),g(p)}).then(f)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(hs.created,d),l(h)}catch{}}),u=await id(c,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!u&&o)throw new Error(`Subscribing to ${e} failed, please try again`);return u?a:null}catch(a){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(xn.connection_stalled),o)throw a}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:rb(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await id(new Promise(i=>{this.relayer.request(n).catch(s=>this.logger.warn(s)).then(i)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(xn.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:rb(r.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await id(new Promise((s,o)=>{this.relayer.request(n).catch(a=>{this.logger.warn(a),o(a)}).then(s)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(xn.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:rb(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,J8(W1({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,W1({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,W1({},r)),this.topicMap.set(r.topic,e),this.events.emit(hs.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=De("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(hs.deleted,J8(W1({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(hs.sync)}async onRestart(){if(this.cached.length){const e=[...this.cached],r=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let n=0;n<r;n++){const i=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(i)}}this.events.emit(hs.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=De("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(await Promise.all(e.map(async r=>J8(W1({},r),{id:await this.getSubscriptionId(r.topic)})))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(await qhe(Be.toMiliseconds(Be.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(r.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return La(e+await this.getClientId())}}var owe=Object.defineProperty,O$=Object.getOwnPropertySymbols,awe=Object.prototype.hasOwnProperty,cwe=Object.prototype.propertyIsEnumerable,DI=(t,e,r)=>e in t?owe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,R$=(t,e)=>{for(var r in e||(e={}))awe.call(e,r)&&DI(t,r,e[r]);if(O$)for(var r of O$(e))cwe.call(e,r)&&DI(t,r,e[r]);return t},Ft=(t,e,r)=>DI(t,typeof e!="symbol"?e+"":e,r);class uwe extends xoe{constructor(e){super(e),Ft(this,"protocol","wc"),Ft(this,"version",2),Ft(this,"core"),Ft(this,"logger"),Ft(this,"events",new ao.EventEmitter),Ft(this,"provider"),Ft(this,"messages"),Ft(this,"subscriber"),Ft(this,"publisher"),Ft(this,"name",Lge),Ft(this,"transportExplicitlyClosed",!1),Ft(this,"initialized",!1),Ft(this,"connectionAttemptInProgress",!1),Ft(this,"relayUrl"),Ft(this,"projectId"),Ft(this,"packageName"),Ft(this,"bundleId"),Ft(this,"hasExperiencedNetworkDisruption",!1),Ft(this,"pingTimeout"),Ft(this,"heartBeatTimeout",Be.toMiliseconds(Be.THIRTY_SECONDS+Be.FIVE_SECONDS)),Ft(this,"reconnectTimeout"),Ft(this,"connectPromise"),Ft(this,"reconnectInProgress",!1),Ft(this,"requestsInFlight",[]),Ft(this,"connectTimeout",Be.toMiliseconds(Be.ONE_SECOND*15)),Ft(this,"request",async r=>{var n,i;this.logger.debug("Publishing Request Payload");const s=r.id||Jh().toString();await this.toEstablishConnection();try{this.logger.trace({id:s,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - publishing...");const o=`${s}:${((i=r.params)==null?void 0:i.tag)||""}`;this.requestsInFlight.push(o);const a=await this.provider.request(r);return this.requestsInFlight=this.requestsInFlight.filter(c=>c!==o),a}catch(o){throw this.logger.debug(`Failed to Publish Request: ${s}`),o}}),Ft(this,"resetPingTimeout",()=>{xC()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i,s;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(s=(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null?void 0:i.terminate)==null||s.call(i)}catch(o){this.logger.warn(o,o==null?void 0:o.message)}},this.heartBeatTimeout))}),Ft(this,"onPayloadHandler",r=>{this.onProviderPayload(r),this.resetPingTimeout()}),Ft(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected 🛜"),this.startPingTimeout(),this.events.emit(xn.connect)}),Ft(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected 🛑"),this.requestsInFlight=[],this.onProviderDisconnect()}),Ft(this,"onProviderErrorHandler",r=>{this.logger.fatal(`Fatal socket error: ${r.message}`),this.events.emit(xn.error,r),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),Ft(this,"registerProviderListeners",()=>{this.provider.on(Hs.payload,this.onPayloadHandler),this.provider.on(Hs.connect,this.onConnectHandler),this.provider.on(Hs.disconnect,this.onDisconnectHandler),this.provider.on(Hs.error,this.onProviderErrorHandler)}),this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?si(e.logger,this.name):Tv(Xm({level:e.logger||Mge})),this.messages=new z1e(this.logger,e.core),this.subscriber=new swe(this,this.logger),this.publisher=new Y1e(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||KK,this.projectId=e.projectId,The()?this.packageName=_N():Ihe()&&(this.bundleId=_N()),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.hasAnyTopics)try{await this.transportOpen()}catch(e){this.logger.warn(e,e==null?void 0:e.message)}}get context(){return es(this.logger)}get connected(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1||!1}get connecting(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0||this.connectPromise!==void 0||!1}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now(),transportType:Pr.relay},J4.outbound)}async subscribe(e,r){var n,i,s;this.isInitialized(),(!(r!=null&&r.transportType)||(r==null?void 0:r.transportType)==="relay")&&await this.toEstablishConnection();const o=typeof((n=r==null?void 0:r.internal)==null?void 0:n.throwOnFailedPublish)>"u"?!0:(i=r==null?void 0:r.internal)==null?void 0:i.throwOnFailedPublish;let a=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"",c;const u=l=>{l.topic===e&&(this.subscriber.off(hs.created,u),c())};return await Promise.all([new Promise(l=>{c=l,this.subscriber.on(hs.created,u)}),new Promise(async(l,d)=>{a=await this.subscriber.subscribe(e,R$({internal:{throwOnFailedPublish:o}},r)).catch(h=>{o&&d(h)})||a,l()})]),a}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await id(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(!this.subscriber.hasAnyTopics){this.logger.warn("Starting WS connection skipped because the client has no topics to work with.");return}if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(r,n)=>{await this.connect(e).then(r).catch(n).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await u$())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.debug(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i,"Error while processing batch message event: "+(i==null?void 0:i.message))}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(e,r){const{topic:n}=e;if(!r.sessionExists){const i=gn(Be.FIVE_MINUTES),s={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(xn.message,e),await this.recordMessageEvent(e,J4.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let r=1;for(;r<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${r}...`),await this.createProvider(),await new Promise(async(n,i)=>{const s=()=>{i(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Hs.disconnect,s),await id(new Promise((o,a)=>{this.provider.connect().then(o).catch(a)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>{i(o)}).finally(()=>{this.provider.off(Hs.disconnect,s),clearTimeout(this.reconnectTimeout)}),await new Promise(async(o,a)=>{const c=()=>{a(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Hs.disconnect,c),await this.subscriber.start().then(o).catch(a).finally(()=>{this.provider.off(Hs.disconnect,c)})}),this.hasExperiencedNetworkDisruption=!1,n()})}catch(n){await this.subscriber.stop();const i=n;this.logger.warn({},i.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${r}`);break}await new Promise(n=>setTimeout(n,Be.toMiliseconds(r*1))),r++}}startPingTimeout(){var e,r,n,i,s;if(xC())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((s=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||s.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o,o==null?void 0:o.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new co(new Tge(Nhe({sdkVersion:RI,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,r){const{topic:n,message:i}=e;await this.messages.set(n,i,r)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isKnownTopic(r))return this.logger.warn(`Ignoring message for unknown topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.warn(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),t7(e)){if(!e.method.endsWith(Uge))return;const r=e.params,{topic:n,message:i,publishedAt:s,attestation:o}=r.data,a={topic:n,message:i,publishedAt:s,transportType:Pr.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(R$({type:"event",event:r.id},a)),this.events.emit(r.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else iA(e)&&this.events.emit(xn.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,J4.inbound),this.events.emit(xn.message,e))}async acknowledgePayload(e){const r=rA(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Hs.payload,this.onPayloadHandler),this.provider.off(Hs.connect,this.onConnectHandler),this.provider.off(Hs.disconnect,this.onDisconnectHandler),this.provider.off(Hs.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await u$();tge(async r=>{e!==r&&(e=r,r?await this.transportOpen().catch(n=>this.logger.error(n,n==null?void 0:n.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(vp.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&ige())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(r){this.logger.warn(r,r==null?void 0:r.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(xn.disconnect),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e==null?void 0:e.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},Be.toMiliseconds(Fge)))))}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}await this.connect()}}}function lwe(){}function k$(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function N$(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function $$(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const dwe="[object RegExp]",hwe="[object String]",fwe="[object Number]",pwe="[object Boolean]",j$="[object Arguments]",gwe="[object Symbol]",mwe="[object Date]",wwe="[object Map]",bwe="[object Set]",ywe="[object Array]",vwe="[object Function]",_we="[object ArrayBuffer]",Q8="[object Object]",Ewe="[object Error]",Cwe="[object DataView]",Awe="[object Uint8Array]",xwe="[object Uint8ClampedArray]",Swe="[object Uint16Array]",Twe="[object Uint32Array]",Iwe="[object BigUint64Array]",Pwe="[object Int8Array]",Owe="[object Int16Array]",Rwe="[object Int32Array]",kwe="[object BigInt64Array]",Nwe="[object Float32Array]",$we="[object Float64Array]";function jwe(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Bwe(t,e,r){return nb(t,e,void 0,void 0,void 0,void 0,r)}function nb(t,e,r,n,i,s,o){const a=o(t,e,r,n,i,s);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return gb(t,e,s,o)}return gb(t,e,s,o)}function gb(t,e,r,n){if(Object.is(t,e))return!0;let i=$$(t),s=$$(e);if(i===j$&&(i=Q8),s===j$&&(s=Q8),i!==s)return!1;switch(i){case hwe:return t.toString()===e.toString();case fwe:{const c=t.valueOf(),u=e.valueOf();return jwe(c,u)}case pwe:case mwe:case gwe:return Object.is(t.valueOf(),e.valueOf());case dwe:return t.source===e.source&&t.flags===e.flags;case vwe:return t===e}r=r??new Map;const o=r.get(t),a=r.get(e);if(o!=null&&a!=null)return o===e;r.set(t,e),r.set(e,t);try{switch(i){case wwe:{if(t.size!==e.size)return!1;for(const[c,u]of t.entries())if(!e.has(c)||!nb(u,e.get(c),c,t,e,r,n))return!1;return!0}case bwe:{if(t.size!==e.size)return!1;const c=Array.from(t.values()),u=Array.from(e.values());for(let l=0;l<c.length;l++){const d=c[l],h=u.findIndex(f=>nb(d,f,void 0,t,e,r,n));if(h===-1)return!1;u.splice(h,1)}return!0}case ywe:case Awe:case xwe:case Swe:case Twe:case Iwe:case Pwe:case Owe:case Rwe:case kwe:case Nwe:case $we:{if(typeof Buffer<"u"&&Buffer.isBuffer(t)!==Buffer.isBuffer(e)||t.length!==e.length)return!1;for(let c=0;c<t.length;c++)if(!nb(t[c],e[c],c,t,e,r,n))return!1;return!0}case _we:return t.byteLength!==e.byteLength?!1:gb(new Uint8Array(t),new Uint8Array(e),r,n);case Cwe:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:gb(new Uint8Array(t),new Uint8Array(e),r,n);case Ewe:return t.name===e.name&&t.message===e.message;case Q8:{if(!(gb(t.constructor,e.constructor,r,n)||k$(t)&&k$(e)))return!1;const c=[...Object.keys(t),...N$(t)],u=[...Object.keys(e),...N$(e)];if(c.length!==u.length)return!1;for(let l=0;l<c.length;l++){const d=c[l],h=t[d];if(!Object.hasOwn(e,d))return!1;const f=e[d];if(!nb(h,f,d,t,e,r,n))return!1}return!0}default:return!1}}finally{r.delete(t),r.delete(e)}}function Dwe(t,e){return Bwe(t,e,lwe)}var Mwe=Object.defineProperty,B$=Object.getOwnPropertySymbols,Lwe=Object.prototype.hasOwnProperty,Uwe=Object.prototype.propertyIsEnumerable,MI=(t,e,r)=>e in t?Mwe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,D$=(t,e)=>{for(var r in e||(e={}))Lwe.call(e,r)&&MI(t,r,e[r]);if(B$)for(var r of B$(e))Uwe.call(e,r)&&MI(t,r,e[r]);return t},Di=(t,e,r)=>MI(t,typeof e!="symbol"?e+"":e,r);class Ep extends Soe{constructor(e,r,n,i=Ja,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,Di(this,"map",new Map),Di(this,"version",Hge),Di(this,"cached",[]),Di(this,"initialized",!1),Di(this,"getKey"),Di(this,"storagePrefix",Ja),Di(this,"recentlyDeleted",[]),Di(this,"recentlyDeletedLimit",200),Di(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!Ln(o)?this.map.set(this.getKey(o),o):k0e(o)?this.map.set(o.id,o):N0e(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)}),Di(this,"set",async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())}),Di(this,"get",o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o))),Di(this,"getAll",o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>Dwe(a[c],o[c]))):this.values)),Di(this,"update",async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const c=D$(D$({},this.getData(o)),a);this.map.set(o,c),await this.persist()}),Di(this,"delete",async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())}),this.logger=si(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return es(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:i}=De("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=De("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=De("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Fwe=Object.defineProperty,Hwe=(t,e,r)=>e in t?Fwe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pt=(t,e,r)=>Hwe(t,typeof e!="symbol"?e+"":e,r);class qwe{constructor(e,r){this.core=e,this.logger=r,Pt(this,"name",Vge),Pt(this,"version",Gge),Pt(this,"events",new R9),Pt(this,"pairings"),Pt(this,"initialized",!1),Pt(this,"storagePrefix",Ja),Pt(this,"ignoredPayloadTypes",[Eu]),Pt(this,"registeredMethods",[]),Pt(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),Pt(this,"register",({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]}),Pt(this,"create",async n=>{this.isInitialized();const i=PI(),s=await this.core.crypto.setSymKey(i),o=gn(Be.FIVE_MINUTES),a={protocol:GK},c={topic:s,expiry:o,relay:a,active:!1,methods:n==null?void 0:n.methods},u=e$({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:i,relay:a,expiryTimestamp:o,methods:n==null?void 0:n.methods});return this.events.emit(Fh.create,c),this.core.expirer.set(s,o),await this.pairings.set(s,c),await this.core.relayer.subscribe(s,{transportType:n==null?void 0:n.transportType}),{topic:s,uri:u}}),Pt(this,"pair",async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[Sa.pairing_started]}});this.isValidPair(n,i);const{topic:s,symKey:o,relay:a,expiryTimestamp:c,methods:u}=XN(n.uri);i.props.properties.topic=s,i.addTrace(Sa.pairing_uri_validation_success),i.addTrace(Sa.pairing_uri_not_expired);let l;if(this.pairings.keys.includes(s)){if(l=this.pairings.get(s),i.addTrace(Sa.existing_pairing),l.active)throw i.setError(Vc.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(Sa.pairing_not_expired)}const d=c||gn(Be.FIVE_MINUTES),h={topic:s,relay:a,expiry:d,active:!1,methods:u};this.core.expirer.set(s,d),await this.pairings.set(s,h),i.addTrace(Sa.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit(Fh.create,h),i.addTrace(Sa.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(o,s),i.addTrace(Sa.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(Vc.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(f){throw i.setError(Vc.subscribe_pairing_topic_failure),f}return i.addTrace(Sa.subscribe_pairing_topic_success),h}),Pt(this,"activate",async({topic:n})=>{this.isInitialized();const i=gn(Be.FIVE_MINUTES);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})}),Pt(this,"ping",async n=>{this.isInitialized(),await this.isValidPing(n),this.logger.warn("ping() is deprecated and will be removed in the next major release.");const{topic:i}=n;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=jh();this.events.once(Kt("pairing_ping",s),({error:u})=>{u?c(u):a()}),await o()}}),Pt(this,"updateExpiry",async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})}),Pt(this,"updateMetadata",async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})}),Pt(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),Pt(this,"disconnect",async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",sr("USER_DISCONNECTED")),await this.deletePairing(i))}),Pt(this,"formatUriFromPairing",n=>{this.isInitialized();const{topic:i,relay:s,expiry:o,methods:a}=n,c=this.core.crypto.keychain.get(i);return e$({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:c,relay:s,expiryTimestamp:o,methods:a})}),Pt(this,"sendRequest",async(n,i,s)=>{const o=sd(i,s),a=await this.core.crypto.encode(n,o),c=q1[i].req;return this.core.history.set(n,o),this.core.relayer.publish(n,a,c),o.id}),Pt(this,"sendResult",async(n,i,s)=>{const o=rA(n,s),a=await this.core.crypto.encode(i,o),c=(await this.core.history.get(i,n)).request.method,u=q1[c].res;await this.core.relayer.publish(i,a,u),await this.core.history.resolve(o)}),Pt(this,"sendError",async(n,i,s)=>{const o=nA(n,s),a=await this.core.crypto.encode(i,o),c=(await this.core.history.get(i,n)).request.method,u=q1[c]?q1[c].res:q1.unregistered_method.res;await this.core.relayer.publish(i,a,u),await this.core.history.resolve(o)}),Pt(this,"deletePairing",async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,sr("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])}),Pt(this,"cleanup",async()=>{const n=this.pairings.getAll().filter(i=>Bl(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))}),Pt(this,"onRelayEventRequest",async n=>{const{topic:i,payload:s}=n;switch(s.method){case"wc_pairingPing":return await this.onPairingPingRequest(i,s);case"wc_pairingDelete":return await this.onPairingDeleteRequest(i,s);default:return await this.onUnknownRpcMethodRequest(i,s)}}),Pt(this,"onRelayEventResponse",async n=>{const{topic:i,payload:s}=n,o=(await this.core.history.get(i,s.id)).request.method;switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(o)}}),Pt(this,"onPairingPingRequest",async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(Fh.ping,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}}),Pt(this,"onPairingPingResponse",(n,i)=>{const{id:s}=i;setTimeout(()=>{Ia(i)?this.events.emit(Kt("pairing_ping",s),{}):eo(i)&&this.events.emit(Kt("pairing_ping",s),{error:i.error})},500)}),Pt(this,"onPairingDeleteRequest",async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(Fh.delete,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}}),Pt(this,"onUnknownRpcMethodRequest",async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=sr("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}}),Pt(this,"onUnknownRpcMethodResponse",n=>{this.registeredMethods.includes(n)||this.logger.error(sr("WC_METHOD_UNSUPPORTED",n))}),Pt(this,"isValidPair",(n,i)=>{var s;if(!Fi(n)){const{message:a}=De("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(Vc.malformed_pairing_uri),new Error(a)}if(!R0e(n.uri)){const{message:a}=De("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(Vc.malformed_pairing_uri),new Error(a)}const o=XN(n==null?void 0:n.uri);if(!((s=o==null?void 0:o.relay)!=null&&s.protocol)){const{message:a}=De("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(Vc.malformed_pairing_uri),new Error(a)}if(!(o!=null&&o.symKey)){const{message:a}=De("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(Vc.malformed_pairing_uri),new Error(a)}if(o!=null&&o.expiryTimestamp&&Be.toMiliseconds(o==null?void 0:o.expiryTimestamp)<Date.now()){i.setError(Vc.pairing_expired);const{message:a}=De("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(a)}}),Pt(this,"isValidPing",async n=>{if(!Fi(n)){const{message:s}=De("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)}),Pt(this,"isValidDisconnect",async n=>{if(!Fi(n)){const{message:s}=De("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)}),Pt(this,"isValidPairingTopic",async n=>{if(!cn(n,!1)){const{message:i}=De("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=De("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(Bl(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=De("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}}),this.core=e,this.logger=si(r,this.name),this.pairings=new Ep(this.core,this.logger,this.name,this.storagePrefix)}get context(){return es(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(xn.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(this.pairings.keys.includes(r)&&i!==Pr.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))try{const s=await this.core.crypto.decode(r,n);t7(s)?(this.core.history.set(r,s),await this.onRelayEventRequest({topic:r,payload:s})):iA(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:r,payload:s}),this.core.history.delete(r,s.id)),await this.core.relayer.messages.ack(r,n)}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(Gs.expired,async e=>{const{topic:r}=iK(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(Fh.expire,{topic:r}))})}}var zwe=Object.defineProperty,Wwe=(t,e,r)=>e in t?zwe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$n=(t,e,r)=>Wwe(t,typeof e!="symbol"?e+"":e,r);class Vwe extends Eoe{constructor(e,r){super(e,r),this.core=e,this.logger=r,$n(this,"records",new Map),$n(this,"events",new ao.EventEmitter),$n(this,"name",Kge),$n(this,"version",Zge),$n(this,"cached",[]),$n(this,"initialized",!1),$n(this,"storagePrefix",Ja),$n(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),$n(this,"set",(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s,expiry:gn(Be.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(yo.created,o)}),$n(this,"resolve",async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=eo(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(yo.updated,i))}),$n(this,"get",async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i))),$n(this,"delete",(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(yo.deleted,s)}}),this.persist()}),$n(this,"exists",async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1)),$n(this,"on",(n,i)=>{this.events.on(n,i)}),$n(this,"once",(n,i)=>{this.events.once(n,i)}),$n(this,"off",(n,i)=>{this.events.off(n,i)}),$n(this,"removeListener",(n,i)=>{this.events.removeListener(n,i)}),this.logger=si(r,this.name)}get context(){return es(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:sd(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=De("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(yo.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=De("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(yo.created,e=>{const r=yo.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(yo.updated,e=>{const r=yo.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(yo.deleted,e=>{const r=yo.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(vp.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{Be.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(yo.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Gwe=Object.defineProperty,Kwe=(t,e,r)=>e in t?Gwe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Kn=(t,e,r)=>Kwe(t,typeof e!="symbol"?e+"":e,r);class Zwe extends Ioe{constructor(e,r){super(e,r),this.core=e,this.logger=r,Kn(this,"expirations",new Map),Kn(this,"events",new ao.EventEmitter),Kn(this,"name",Yge),Kn(this,"version",Jge),Kn(this,"cached",[]),Kn(this,"initialized",!1),Kn(this,"storagePrefix",Ja),Kn(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),Kn(this,"has",n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}}),Kn(this,"set",(n,i)=>{this.isInitialized();const s=this.formatTarget(n),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(Gs.created,{target:s,expiration:o})}),Kn(this,"get",n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)}),Kn(this,"del",n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Gs.deleted,{target:i,expiration:s})}}),Kn(this,"on",(n,i)=>{this.events.on(n,i)}),Kn(this,"once",(n,i)=>{this.events.once(n,i)}),Kn(this,"off",(n,i)=>{this.events.off(n,i)}),Kn(this,"removeListener",(n,i)=>{this.events.removeListener(n,i)}),this.logger=si(r,this.name)}get context(){return es(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return $he(e);if(typeof e=="number")return jhe(e);const{message:r}=De("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Gs.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=De("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=De("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;Be.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(Gs.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(vp.pulse,()=>this.checkExpirations()),this.events.on(Gs.created,e=>{const r=Gs.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Gs.expired,e=>{const r=Gs.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Gs.deleted,e=>{const r=Gs.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Ywe=Object.defineProperty,Jwe=(t,e,r)=>e in t?Ywe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,on=(t,e,r)=>Jwe(t,typeof e!="symbol"?e+"":e,r);class Qwe extends Poe{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,on(this,"name",Qge),on(this,"abortController"),on(this,"isDevEnv"),on(this,"verifyUrlV3",eme),on(this,"storagePrefix",Ja),on(this,"version",VK),on(this,"publicKey"),on(this,"fetchPromise"),on(this,"init",async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&Be.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),on(this,"register",async i=>{if(!n1()||this.isDevEnv)return;const s=window.location.origin,{id:o,decryptedId:a}=i,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${o}&decryptedId=${a}`;try{const u=Iu.getDocument(),l=this.startAbortTimer(Be.ONE_SECOND*5),d=await new Promise((h,f)=>{const g=()=>{window.removeEventListener("message",m),u.body.removeChild(p),f("attestation aborted")};this.abortController.signal.addEventListener("abort",g);const p=u.createElement("iframe");p.src=c,p.style.display="none",p.addEventListener("error",g,{signal:this.abortController.signal});const m=b=>{if(b.data&&typeof b.data=="string")try{const v=JSON.parse(b.data);if(v.type==="verify_attestation"){if(lI(v.attestation).payload.id!==o)return;clearInterval(l),u.body.removeChild(p),this.abortController.signal.removeEventListener("abort",g),window.removeEventListener("message",m),h(v.attestation===null?"":v.attestation)}}catch(v){this.logger.warn(v)}};u.body.appendChild(p),window.addEventListener("message",m,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",d),d}catch(u){this.logger.warn(u)}return""}),on(this,"resolve",async i=>{if(this.isDevEnv)return"";const{attestationId:s,hash:o,encryptedId:a}=i;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(lI(s).payload.id!==a)return;const u=await this.isValidJwtAttestation(s);if(u){if(!u.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return u}}if(!o)return;const c=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(o,c)}),on(this,"fetchAttestation",async(i,s)=>{this.logger.debug(`resolving attestation: ${i} from url: ${s}`);const o=this.startAbortTimer(Be.ONE_SECOND*5),a=await fetch(`${s}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(o),a.status===200?await a.json():void 0}),on(this,"getVerifyUrl",i=>{let s=i||pb;return tme.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${pb}`),s=pb),s}),on(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(Be.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await s.json()}catch(i){this.logger.warn(i)}}),on(this,"persistPublicKey",async i=>{this.logger.debug("persisting public key to local storage",i),await this.store.setItem(this.storeKey,i),this.publicKey=i}),on(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),on(this,"isValidJwtAttestation",async i=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}const o=await this.fetchAndPersistPublicKey();try{if(o)return this.validateAttestation(i,o)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}}),on(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),on(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const o=await this.fetchPublicKey();o&&(await this.persistPublicKey(o),s(o))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i}),on(this,"validateAttestation",(i,s)=>{const o=l0e(i,s.publicKey),a={hasExpired:Be.toMiliseconds(o.exp)<Date.now(),payload:o};if(a.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:a.payload.origin,isScam:a.payload.isScam,isVerified:a.payload.isVerified}}),this.logger=si(r,this.name),this.abortController=new AbortController,this.isDevEnv=V9(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return es(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Be.toMiliseconds(e))}}var Xwe=Object.defineProperty,ebe=(t,e,r)=>e in t?Xwe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M$=(t,e,r)=>ebe(t,typeof e!="symbol"?e+"":e,r);class tbe extends Ooe{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,M$(this,"context",rme),M$(this,"registerDeviceToken",async n=>{const{clientId:i,token:s,notificationType:o,enableEncrypted:a=!1}=n,c=`${nme}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:o,token:s,always_raw:a})})}),this.logger=si(r,this.context)}}var rbe=Object.defineProperty,L$=Object.getOwnPropertySymbols,nbe=Object.prototype.hasOwnProperty,ibe=Object.prototype.propertyIsEnumerable,LI=(t,e,r)=>e in t?rbe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,V1=(t,e)=>{for(var r in e||(e={}))nbe.call(e,r)&&LI(t,r,e[r]);if(L$)for(var r of L$(e))ibe.call(e,r)&&LI(t,r,e[r]);return t},wn=(t,e,r)=>LI(t,typeof e!="symbol"?e+"":e,r);class sbe extends Roe{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,wn(this,"context",sme),wn(this,"storagePrefix",Ja),wn(this,"storageVersion",ime),wn(this,"events",new Map),wn(this,"shouldPersist",!1),wn(this,"init",async()=>{if(!V9())try{const i={eventId:CN(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:rK(this.core.relayer.protocol,this.core.relayer.version,RI)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}}),wn(this,"createEvent",i=>{const{event:s="ERROR",type:o="",properties:{topic:a,trace:c}}=i,u=CN(),l=this.core.projectId||"",d=Date.now(),h=V1({eventId:u,timestamp:d,props:{event:s,type:o,properties:{topic:a,trace:c}},bundleId:l,domain:this.getAppDomain()},this.setMethods(u));return this.telemetryEnabled&&(this.events.set(u,h),this.shouldPersist=!0),h}),wn(this,"getEvent",i=>{const{eventId:s,topic:o}=i;if(s)return this.events.get(s);const a=Array.from(this.events.values()).find(c=>c.props.properties.topic===o);if(a)return V1(V1({},a),this.setMethods(a.eventId))}),wn(this,"deleteEvent",i=>{const{eventId:s}=i;this.events.delete(s),this.shouldPersist=!0}),wn(this,"setEventListeners",()=>{this.core.heartbeat.on(vp.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{Be.fromMiliseconds(Date.now())-Be.fromMiliseconds(i.timestamp)>ome&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})}),wn(this,"setMethods",i=>({addTrace:s=>this.addTrace(i,s),setError:s=>this.setError(i,s)})),wn(this,"addTrace",(i,s)=>{const o=this.events.get(i);o&&(o.props.properties.trace.push(s),this.events.set(i,o),this.shouldPersist=!0)}),wn(this,"setError",(i,s)=>{const o=this.events.get(i);o&&(o.props.type=s,o.timestamp=Date.now(),this.events.set(i,o),this.shouldPersist=!0)}),wn(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),wn(this,"restore",async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(s=>{this.events.set(s.eventId,V1(V1({},s),this.setMethods(s.eventId)))})}catch(i){this.logger.warn(i)}}),wn(this,"submit",async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[s,o]of this.events)o.props.type&&i.push(o);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}}),wn(this,"sendEvent",async i=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${ame}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${RI}${s}`,{method:"POST",body:JSON.stringify(i)})}),wn(this,"getAppDomain",()=>tK().url),this.logger=si(r,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var obe=Object.defineProperty,U$=Object.getOwnPropertySymbols,abe=Object.prototype.hasOwnProperty,cbe=Object.prototype.propertyIsEnumerable,UI=(t,e,r)=>e in t?obe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,F$=(t,e)=>{for(var r in e||(e={}))abe.call(e,r)&&UI(t,r,e[r]);if(U$)for(var r of U$(e))cbe.call(e,r)&&UI(t,r,e[r]);return t},xr=(t,e,r)=>UI(t,typeof e!="symbol"?e+"":e,r);let ube=class oZ extends boe{constructor(e){var r;super(e),xr(this,"protocol",WK),xr(this,"version",VK),xr(this,"name",OI),xr(this,"relayUrl"),xr(this,"projectId"),xr(this,"customStoragePrefix"),xr(this,"events",new ao.EventEmitter),xr(this,"logger"),xr(this,"heartbeat"),xr(this,"relayer"),xr(this,"crypto"),xr(this,"storage"),xr(this,"history"),xr(this,"expirer"),xr(this,"pairing"),xr(this,"verify"),xr(this,"echoClient"),xr(this,"linkModeSupportedApps"),xr(this,"eventClient"),xr(this,"initialized",!1),xr(this,"logChunkController"),xr(this,"on",(a,c)=>this.events.on(a,c)),xr(this,"once",(a,c)=>this.events.once(a,c)),xr(this,"off",(a,c)=>this.events.off(a,c)),xr(this,"removeListener",(a,c)=>this.events.removeListener(a,c)),xr(this,"dispatchEnvelope",({topic:a,message:c,sessionExists:u})=>{if(!a||!c)return;const l={topic:a,message:c,publishedAt:Date.now(),transportType:Pr.link_mode};this.relayer.onLinkMessageEvent(l,{sessionExists:u})});const n=this.getGlobalCore(e==null?void 0:e.customStoragePrefix);if(n)try{return this.customStoragePrefix=n.customStoragePrefix,this.logger=n.logger,this.heartbeat=n.heartbeat,this.crypto=n.crypto,this.history=n.history,this.expirer=n.expirer,this.storage=n.storage,this.relayer=n.relayer,this.pairing=n.pairing,this.verify=n.verify,this.echoClient=n.echoClient,this.linkModeSupportedApps=n.linkModeSupportedApps,this.eventClient=n.eventClient,this.initialized=n.initialized,this.logChunkController=n.logChunkController,n}catch(a){console.warn("Failed to copy global core",a)}this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||KK,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=Xm({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:Pge.logger,name:OI}),{logger:s,chunkLoggerController:o}=N9({opts:i,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=o,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var a,c;(a=this.logChunkController)!=null&&a.downloadLogsBlobInBrowser&&((c=this.logChunkController)==null||c.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=si(s,this.name),this.heartbeat=new wse,this.crypto=new B1e(this,this.logger,e==null?void 0:e.keychain),this.history=new Vwe(this,this.logger),this.expirer=new Zwe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new Xse(F$(F$({},Oge),e==null?void 0:e.storageOptions)),this.relayer=new uwe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new qwe(this,this.logger),this.verify=new Qwe(this,this.logger,this.storage),this.echoClient=new tbe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new sbe(this,this.logger,e==null?void 0:e.telemetryEnabled),this.setGlobalCore(this)}static async init(e){const r=new oZ(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(qge,n),r}get context(){return es(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(v$,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(v$)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;const r=`_walletConnectCore_${e}`,n=`${r}_count`;return globalThis[n]=(globalThis[n]||0)+1,globalThis[n]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[n]} times.`),globalThis[r]}catch(r){console.warn("Failed to get global WalletConnect core",r);return}}setGlobalCore(e){var r;try{if(this.isGlobalCoreDisabled())return;const n=`_walletConnectCore_${((r=e.opts)==null?void 0:r.customStoragePrefix)||""}`;globalThis[n]=e}catch(n){console.warn("Failed to set global WalletConnect core",n)}}isGlobalCoreDisabled(){try{return typeof process<"u"&&Ige.DISABLE_GLOBAL_CORE==="true"}catch{return!0}}};const lbe=ube,aZ="wc",cZ=2,uZ="client",r7=`${aZ}@${cZ}:${uZ}:`,X8={name:uZ,logger:"error"},H$="WALLETCONNECT_DEEPLINK_CHOICE",dbe="proposal",q$="Proposal expired",hbe="session",Qp=Be.SEVEN_DAYS,fbe="engine",bn={wc_sessionPropose:{req:{ttl:Be.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Be.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:Be.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:Be.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:Be.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Be.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Be.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Be.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Be.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Be.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Be.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Be.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Be.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Be.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Be.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Be.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Be.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Be.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Be.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Be.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:Be.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:Be.FIVE_MINUTES,prompt:!1,tag:1119}}},eS={min:Be.FIVE_MINUTES,max:Be.SEVEN_DAYS},va={idle:"IDLE",active:"ACTIVE"},z$={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"}},pbe="request",gbe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],mbe="wc",wbe="auth",bbe="authKeys",ybe="pairingTopics",vbe="requests",oA=`${mbe}@${1.5}:${wbe}:`,Q4=`${oA}:PUB_KEY`;var _be=Object.defineProperty,Ebe=Object.defineProperties,Cbe=Object.getOwnPropertyDescriptors,W$=Object.getOwnPropertySymbols,Abe=Object.prototype.hasOwnProperty,xbe=Object.prototype.propertyIsEnumerable,FI=(t,e,r)=>e in t?_be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mr=(t,e)=>{for(var r in e||(e={}))Abe.call(e,r)&&FI(t,r,e[r]);if(W$)for(var r of W$(e))xbe.call(e,r)&&FI(t,r,e[r]);return t},ci=(t,e)=>Ebe(t,Cbe(e)),Ie=(t,e,r)=>FI(t,typeof e!="symbol"?e+"":e,r);class Sbe extends joe{constructor(e){super(e),Ie(this,"name",fbe),Ie(this,"events",new R9),Ie(this,"initialized",!1),Ie(this,"requestQueue",{state:va.idle,queue:[]}),Ie(this,"sessionRequestQueue",{state:va.idle,queue:[]}),Ie(this,"requestQueueDelay",Be.ONE_SECOND),Ie(this,"expectedPairingMethodMap",new Map),Ie(this,"recentlyDeletedMap",new Map),Ie(this,"recentlyDeletedLimit",200),Ie(this,"relayMessageCache",[]),Ie(this,"pendingSessions",new Map),Ie(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(bn)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Be.toMiliseconds(this.requestQueueDelay)))}),Ie(this,"connect",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const n=ci(mr({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n),n.optionalNamespaces=S0e(n.requiredNamespaces,n.optionalNamespaces),n.requiredNamespaces={};const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,scopedProperties:c,relays:u}=n;let l=i,d,h=!1;try{if(l){const y=this.client.core.pairing.pairings.get(l);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),h=y.active}}catch(y){throw this.client.logger.error(`connect() -> pairing.get(${l}) failed`),y}if(!l||!h){const{topic:y,uri:_}=await this.client.core.pairing.create();l=y,d=_}if(!l){const{message:y}=De("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(y)}const f=await this.client.core.crypto.generateKeyPair(),g=bn.wc_sessionPropose.req.ttl||Be.FIVE_MINUTES,p=gn(g),m=ci(mr(mr({requiredNamespaces:s,optionalNamespaces:o,relays:u??[{protocol:GK}],proposer:{publicKey:f,metadata:this.client.metadata},expiryTimestamp:p,pairingTopic:l},a&&{sessionProperties:a}),c&&{scopedProperties:c}),{id:Ta()}),b=Kt("session_connect",m.id),{reject:v,resolve:E,done:w}=jh(g,q$),C=({id:y})=>{y===m.id&&(this.client.events.off("proposal_expire",C),this.pendingSessions.delete(m.id),this.events.emit(b,{error:{message:q$,code:0}}))};return this.client.events.on("proposal_expire",C),this.events.once(b,({error:y,session:_})=>{this.client.events.off("proposal_expire",C),y?v(y):_&&E(_)}),await this.sendRequest({topic:l,method:"wc_sessionPropose",params:m,throwOnFailedPublish:!0,clientRpcId:m.id}),await this.setProposal(m.id,m),{uri:d,approval:w}}),Ie(this,"pair",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}}),Ie(this,"approve",async r=>{var n,i,s;const o=this.client.core.eventClient.createEvent({properties:{topic:(n=r==null?void 0:r.id)==null?void 0:n.toString(),trace:[vo.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(A){throw o.setError(lh.no_internet_connection),A}try{await this.isValidProposalId(r==null?void 0:r.id)}catch(A){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),o.setError(lh.proposal_not_found),A}try{await this.isValidApprove(r)}catch(A){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(lh.session_approve_namespace_validation_failure),A}const{id:a,relayProtocol:c,namespaces:u,sessionProperties:l,scopedProperties:d,sessionConfig:h}=r,f=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:g,proposer:p,requiredNamespaces:m,optionalNamespaces:b}=f;let v=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:g});v||(v=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:vo.session_approve_started,properties:{topic:g,trace:[vo.session_approve_started,vo.session_namespaces_validation_success]}}));const E=await this.client.core.crypto.generateKeyPair(),w=p.publicKey,C=await this.client.core.crypto.generateSharedKey(E,w),y=mr(mr(mr({relay:{protocol:c??"irn"},namespaces:u,controller:{publicKey:E,metadata:this.client.metadata},expiry:gn(Qp)},l&&{sessionProperties:l}),d&&{scopedProperties:d}),h&&{sessionConfig:h}),_=Pr.relay;v.addTrace(vo.subscribing_session_topic);try{await this.client.core.relayer.subscribe(C,{transportType:_})}catch(A){throw v.setError(lh.subscribe_session_topic_failure),A}v.addTrace(vo.subscribe_session_topic_success);const x=ci(mr({},y),{topic:C,requiredNamespaces:m,optionalNamespaces:b,pairingTopic:g,acknowledged:!1,self:y.controller,peer:{publicKey:p.publicKey,metadata:p.metadata},controller:E,transportType:Pr.relay});await this.client.session.set(C,x),v.addTrace(vo.store_session);try{v.addTrace(vo.publishing_session_settle),await this.sendRequest({topic:C,method:"wc_sessionSettle",params:y,throwOnFailedPublish:!0}).catch(A=>{throw v==null||v.setError(lh.session_settle_publish_failure),A}),v.addTrace(vo.session_settle_publish_success),v.addTrace(vo.publishing_session_approve),await this.sendResult({id:a,topic:g,result:{relay:{protocol:c??"irn"},responderPublicKey:E},throwOnFailedPublish:!0}).catch(A=>{throw v==null||v.setError(lh.session_approve_publish_failure),A}),v.addTrace(vo.session_approve_publish_success)}catch(A){throw this.client.logger.error(A),this.client.session.delete(C,sr("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(C),A}return this.client.core.eventClient.deleteEvent({eventId:v.eventId}),await this.client.core.pairing.updateMetadata({topic:g,metadata:p.metadata}),await this.client.proposal.delete(a,sr("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(C,gn(Qp)),{topic:C,acknowledged:()=>Promise.resolve(this.client.session.get(C))}}),Ie(this,"reject",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(o){throw this.client.logger.error("reject() -> isValidReject() failed"),o}const{id:n,reason:i}=r;let s;try{s=this.client.proposal.get(n).pairingTopic}catch(o){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),o}s&&(await this.sendError({id:n,topic:s,error:i,rpcOpts:bn.wc_sessionPropose.reject}),await this.client.proposal.delete(n,sr("USER_DISCONNECTED")))}),Ie(this,"update",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(d){throw this.client.logger.error("update() -> isValidUpdate() failed"),d}const{topic:n,namespaces:i}=r,{done:s,resolve:o,reject:a}=jh(),c=Ta(),u=Jh().toString(),l=this.client.session.get(n).namespaces;return this.events.once(Kt("session_update",c),({error:d})=>{d?a(d):o()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:c,relayRpcId:u}).catch(d=>{this.client.logger.error(d),this.client.session.update(n,{namespaces:l}),a(d)}),{acknowledged:s}}),Ie(this,"extend",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(r)}catch(c){throw this.client.logger.error("extend() -> isValidExtend() failed"),c}const{topic:n}=r,i=Ta(),{done:s,resolve:o,reject:a}=jh();return this.events.once(Kt("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,gn(Qp)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(c=>{a(c)}),{acknowledged:s}}),Ie(this,"request",async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(b){throw this.client.logger.error("request() -> isValidRequest() failed"),b}const{chainId:n,request:i,topic:s,expiry:o=bn.wc_sessionRequest.req.ttl}=r,a=this.client.session.get(s);(a==null?void 0:a.transportType)===Pr.relay&&await this.confirmOnlineStateOrThrow();const c=Ta(),u=Jh().toString(),{done:l,resolve:d,reject:h}=jh(o,"Request expired. Please try again.");this.events.once(Kt("session_request",c),({error:b,result:v})=>{b?h(b):d(v)});const f="wc_sessionRequest",g=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);if(g)return await this.sendRequest({clientRpcId:c,relayRpcId:u,topic:s,method:f,params:{request:ci(mr({},i),{expiryTimestamp:gn(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0,appLink:g}).catch(b=>h(b)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),await l();const p={request:ci(mr({},i),{expiryTimestamp:gn(o)}),chainId:n},m=this.shouldSetTVF(f,p);return await Promise.all([new Promise(async b=>{await this.sendRequest(mr({clientRpcId:c,relayRpcId:u,topic:s,method:f,params:p,expiry:o,throwOnFailedPublish:!0},m&&{tvf:this.getTVFParams(c,p)})).catch(v=>h(v)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),b()}),new Promise(async b=>{var v;if(!((v=a.sessionConfig)!=null&&v.disableDeepLink)){const E=await Lhe(this.client.core.storage,H$);await Bhe({id:c,topic:s,wcDeepLink:E})}b()}),l()]).then(b=>b[2])}),Ie(this,"respond",async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i,o=this.client.session.get(n);o.transportType===Pr.relay&&await this.confirmOnlineStateOrThrow();const a=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);Ia(i)?await this.sendResult({id:s,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:a}):eo(i)&&await this.sendError({id:s,topic:n,error:i.error,appLink:a}),this.cleanupAfterResponse(r)}),Ie(this,"ping",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=Ta(),s=Jh().toString(),{done:o,resolve:a,reject:c}=jh();this.events.once(Kt("session_ping",i),({error:u})=>{u?c(u):a()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:s}),o()])}else this.client.core.pairing.pairings.keys.includes(n)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:n}))}),Ie(this,"emit",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r,o=Jh().toString(),a=Ta();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:s},throwOnFailedPublish:!0,relayRpcId:o,clientRpcId:a})}),Ie(this,"disconnect",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:sr("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=De("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}}),Ie(this,"find",r=>(this.isInitialized(),this.client.session.getAll().filter(n=>P0e(n,r)))),Ie(this,"getPendingSessionRequests",()=>this.client.pendingRequest.getAll()),Ie(this,"authenticate",async(r,n)=>{var i;this.isInitialized(),this.isValidAuthenticate(r);const s=n&&this.client.core.linkModeSupportedApps.includes(n)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),o=s?Pr.link_mode:Pr.relay;o===Pr.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:c="",uri:u,domain:l,nonce:d,type:h,exp:f,nbf:g,methods:p=[],expiry:m}=r,b=[...r.resources||[]],{topic:v,uri:E}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:v,uri:E}});const w=await this.client.core.crypto.generateKeyPair(),C=Y4(w);if(await Promise.all([this.client.auth.authKeys.set(Q4,{responseTopic:C,publicKey:w}),this.client.auth.pairingTopics.set(C,{topic:C,pairingTopic:v})]),await this.client.core.relayer.subscribe(C,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${v}`),p.length>0){const{namespace:$}=ig(a[0]);let R=Rfe($,"request",p);Z4(b)&&(R=Nfe(R,b.pop())),b.push(R)}const y=m&&m>bn.wc_sessionAuthenticate.req.ttl?m:bn.wc_sessionAuthenticate.req.ttl,_={authPayload:{type:h??"caip122",chains:a,statement:c,aud:u,domain:l,version:"1",nonce:d,iat:new Date().toISOString(),exp:f,nbf:g,resources:b},requester:{publicKey:w,metadata:this.client.metadata},expiryTimestamp:gn(y)},x={eip155:{chains:a,methods:[...new Set(["personal_sign",...p])],events:["chainChanged","accountsChanged"]}},A={requiredNamespaces:{},optionalNamespaces:x,relays:[{protocol:"irn"}],pairingTopic:v,proposer:{publicKey:w,metadata:this.client.metadata},expiryTimestamp:gn(bn.wc_sessionPropose.req.ttl),id:Ta()},{done:T,resolve:O,reject:k}=jh(y,"Request expired"),j=Ta(),N=Kt("session_connect",A.id),S=Kt("session_request",j),P=async({error:$,session:R})=>{this.events.off(S,I),$?k($):R&&O({session:R})},I=async $=>{var R,D,L;if(await this.deletePendingAuthRequest(j,{message:"fulfilled",code:0}),$.error){const ae=sr("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return $.error.code===ae.code?void 0:(this.events.off(N,P),k($.error.message))}await this.deleteProposal(A.id),this.events.off(N,P);const{cacaos:U,responder:z}=$.result,W=[],K=[];for(const ae of U){await RN({cacao:ae,projectId:this.client.core.projectId})||(this.client.logger.error(ae,"Signature verification failed"),k(sr("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:he}=ae,ie=Z4(he.resources),Ee=[vI(he.iss)],pe=SC(he.iss);if(ie){const ve=kN(ie),je=NN(ie);W.push(...ve),Ee.push(...je)}for(const ve of Ee)K.push(`${ve}:${pe}`)}const J=await this.client.core.crypto.generateSharedKey(w,z.publicKey);let ne;W.length>0&&(ne={topic:J,acknowledged:!0,self:{publicKey:w,metadata:this.client.metadata},peer:z,controller:z.publicKey,expiry:gn(Qp),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:v,namespaces:i$([...new Set(W)],[...new Set(K)]),transportType:o},await this.client.core.relayer.subscribe(J,{transportType:o}),await this.client.session.set(J,ne),v&&await this.client.core.pairing.updateMetadata({topic:v,metadata:z.metadata}),ne=this.client.session.get(J)),(R=this.client.metadata.redirect)!=null&&R.linkMode&&(D=z.metadata.redirect)!=null&&D.linkMode&&(L=z.metadata.redirect)!=null&&L.universal&&n&&(this.client.core.addLinkModeSupportedApp(z.metadata.redirect.universal),this.client.session.update(J,{transportType:Pr.link_mode})),O({auths:U,session:ne})};this.events.once(N,P),this.events.once(S,I);let B;try{if(s){const $=sd("wc_sessionAuthenticate",_,j);this.client.core.history.set(v,$);const R=await this.client.core.crypto.encode("",$,{type:Lv,encoding:Ml});B=l3(n,v,R)}else await Promise.all([this.sendRequest({topic:v,method:"wc_sessionAuthenticate",params:_,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:j}),this.sendRequest({topic:v,method:"wc_sessionPropose",params:A,expiry:bn.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:A.id})])}catch($){throw this.events.off(N,P),this.events.off(S,I),$}return await this.setProposal(A.id,A),await this.setAuthRequest(j,{request:ci(mr({},_),{verifyContext:{}}),pairingTopic:v,transportType:o}),{uri:B??E,response:T}}),Ie(this,"approveSessionAuthenticate",async r=>{const{id:n,auths:i}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[dh.authenticated_session_approve_started]}});try{this.isInitialized()}catch(m){throw s.setError(z1.no_internet_connection),m}const o=this.getPendingAuthRequest(n);if(!o)throw s.setError(z1.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const a=o.transportType||Pr.relay;a===Pr.relay&&await this.confirmOnlineStateOrThrow();const c=o.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),l=Y4(c),d={type:Eu,receiverPublicKey:c,senderPublicKey:u},h=[],f=[];for(const m of i){if(!await RN({cacao:m,projectId:this.client.core.projectId})){s.setError(z1.invalid_cacao);const C=sr("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:l,error:C,encodeOpts:d}),new Error(C.message)}s.addTrace(dh.cacaos_verified);const{p:b}=m,v=Z4(b.resources),E=[vI(b.iss)],w=SC(b.iss);if(v){const C=kN(v),y=NN(v);h.push(...C),E.push(...y)}for(const C of E)f.push(`${C}:${w}`)}const g=await this.client.core.crypto.generateSharedKey(u,c);s.addTrace(dh.create_authenticated_session_topic);let p;if((h==null?void 0:h.length)>0){p={topic:g,acknowledged:!0,self:{publicKey:u,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:gn(Qp),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:i$([...new Set(h)],[...new Set(f)]),transportType:a},s.addTrace(dh.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(g,{transportType:a})}catch(m){throw s.setError(z1.subscribe_authenticated_session_topic_failure),m}s.addTrace(dh.subscribe_authenticated_session_topic_success),await this.client.session.set(g,p),s.addTrace(dh.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}s.addTrace(dh.publishing_authenticated_session_approve);try{await this.sendResult({topic:l,id:n,result:{cacaos:i,responder:{publicKey:u,metadata:this.client.metadata}},encodeOpts:d,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,a)})}catch(m){throw s.setError(z1.authenticated_session_approve_publish_failure),m}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:p}}),Ie(this,"rejectSessionAuthenticate",async r=>{this.isInitialized();const{id:n,reason:i}=r,s=this.getPendingAuthRequest(n);if(!s)throw new Error(`Could not find pending auth request with id ${n}`);s.transportType===Pr.relay&&await this.confirmOnlineStateOrThrow();const o=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=Y4(o),u={type:Eu,receiverPublicKey:o,senderPublicKey:a};await this.sendError({id:n,topic:c,error:i,encodeOpts:u,rpcOpts:bn.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,sr("USER_DISCONNECTED"))}),Ie(this,"formatAuthMessage",r=>{this.isInitialized();const{request:n,iss:i}=r;return fK(n,i)}),Ie(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)}),Ie(this,"cleanupDuplicatePairings",async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(s=>{var o,a;return((o=s.peerMetadata)==null?void 0:o.url)&&((a=s.peerMetadata)==null?void 0:a.url)===r.peer.metadata.url&&s.topic&&s.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}}),Ie(this,"deleteSession",async r=>{var n;const{topic:i,expirerHasDeleted:s=!1,emitEvent:o=!0,id:a=0}=r,{self:c}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,sr("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(c.publicKey)&&await this.client.core.crypto.deleteKeyPair(c.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),s||this.client.core.expirer.del(i),this.client.core.storage.removeItem(H$).catch(u=>this.client.logger.warn(u)),this.getPendingSessionRequests().forEach(u=>{u.topic===i&&this.deletePendingSessionRequest(u.id,sr("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=va.idle),o&&this.client.events.emit("session_delete",{id:a,topic:i})}),Ie(this,"deleteProposal",async(r,n)=>{if(n)try{const i=this.client.proposal.get(r),s=this.client.core.eventClient.getEvent({topic:i.pairingTopic});s==null||s.setError(lh.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,sr("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")}),Ie(this,"deletePendingSessionRequest",async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),i&&(this.sessionRequestQueue.state=va.idle,this.client.events.emit("session_request_expire",{id:r}))}),Ie(this,"deletePendingAuthRequest",async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])}),Ie(this,"setExpiry",async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))}),Ie(this,"setProposal",async(r,n)=>{this.client.core.expirer.set(r,gn(bn.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)}),Ie(this,"setAuthRequest",async(r,n)=>{const{request:i,pairingTopic:s,transportType:o=Pr.relay}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:s,verifyContext:i.verifyContext,transportType:o})}),Ie(this,"setPendingSessionRequest",async r=>{const{id:n,topic:i,params:s,verifyContext:o}=r,a=s.request.expiryTimestamp||gn(bn.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,a),await this.client.pendingRequest.set(n,{id:n,topic:i,params:s,verifyContext:o})}),Ie(this,"sendRequest",async r=>{const{topic:n,method:i,params:s,expiry:o,relayRpcId:a,clientRpcId:c,throwOnFailedPublish:u,appLink:l,tvf:d}=r,h=sd(i,s,c);let f;const g=!!l;try{const b=g?Ml:Lo;f=await this.client.core.crypto.encode(n,h,{encoding:b})}catch(b){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),b}let p;if(gbe.includes(i)){const b=La(JSON.stringify(h)),v=La(f);p=await this.client.core.verify.register({id:v,decryptedId:b})}const m=bn[i].req;if(m.attestation=p,o&&(m.ttl=o),a&&(m.id=a),this.client.core.history.set(n,h),g){const b=l3(l,n,f);await global.Linking.openURL(b,this.client.name)}else{const b=bn[i].req;o&&(b.ttl=o),a&&(b.id=a),b.tvf=ci(mr({},d),{correlationId:h.id}),u?(b.internal=ci(mr({},b.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,f,b)):this.client.core.relayer.publish(n,f,b).catch(v=>this.client.logger.error(v))}return h.id}),Ie(this,"sendResult",async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:o,encodeOpts:a,appLink:c}=r,u=rA(n,s);let l;const d=c&&typeof(global==null?void 0:global.Linking)<"u";try{const g=d?Ml:Lo;l=await this.client.core.crypto.encode(i,u,ci(mr({},a||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),g}let h,f;try{h=await this.client.core.history.get(i,n);const g=h.request;try{this.shouldSetTVF(g.method,g.params)&&(f=this.getTVFParams(n,g.params,s))}catch(p){this.client.logger.warn("sendResult() -> getTVFParams() failed",p)}}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),g}if(d){const g=l3(c,i,l);await global.Linking.openURL(g,this.client.name)}else{const g=h.request.method,p=bn[g].res;p.tvf=ci(mr({},f),{correlationId:n}),o?(p.internal=ci(mr({},p.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,l,p)):this.client.core.relayer.publish(i,l,p).catch(m=>this.client.logger.error(m))}await this.client.core.history.resolve(u)}),Ie(this,"sendError",async r=>{const{id:n,topic:i,error:s,encodeOpts:o,rpcOpts:a,appLink:c}=r,u=nA(n,s);let l;const d=c&&typeof(global==null?void 0:global.Linking)<"u";try{const f=d?Ml:Lo;l=await this.client.core.crypto.encode(i,u,ci(mr({},o||{}),{encoding:f}))}catch(f){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),f}let h;try{h=await this.client.core.history.get(i,n)}catch(f){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),f}if(d){const f=l3(c,i,l);await global.Linking.openURL(f,this.client.name)}else{const f=h.request.method,g=a||bn[f].res;this.client.core.relayer.publish(i,l,g)}await this.client.core.history.resolve(u)}),Ie(this,"cleanup",async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let s=!1;Bl(i.expiry)&&(s=!0),this.client.core.crypto.keychain.has(i.topic)||(s=!0),s&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{Bl(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])}),Ie(this,"onProviderMessageEvent",async r=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(r):await this.onRelayMessage(r)}),Ie(this,"onRelayEventRequest",async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()}),Ie(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===va.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=va.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=va.idle}),Ie(this,"processRequest",async r=>{const{topic:n,payload:i,attestation:s,transportType:o,encryptedId:a}=r,c=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:c}))switch(c){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:n,payload:i,attestation:s,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,i);case"wc_sessionPing":return await this.onSessionPingRequest(n,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});default:return this.client.logger.info(`Unsupported request method ${c}`)}}),Ie(this,"onRelayEventResponse",async r=>{const{topic:n,payload:i,transportType:s}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i,s);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}}),Ie(this,"onRelayEventUnknownPayload",r=>{const{topic:n}=r,{message:i}=De("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)}),Ie(this,"shouldIgnorePairingRequest",r=>{const{topic:n,requestMethod:i}=r,s=this.expectedPairingMethodMap.get(n);return!s||s.includes(i)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),Ie(this,"onSessionProposeRequest",async r=>{const{topic:n,payload:i,attestation:s,encryptedId:o}=r,{params:a,id:c}=i;try{const u=this.client.core.eventClient.getEvent({topic:n});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),u==null||u.setError(Vc.proposal_listener_not_found)),this.isValidConnect(mr({},i.params));const l=a.expiryTimestamp||gn(bn.wc_sessionPropose.req.ttl),d=mr({id:c,pairingTopic:n,expiryTimestamp:l},a);await this.setProposal(c,d);const h=await this.getVerifyContext({attestationId:s,hash:La(JSON.stringify(i)),encryptedId:o,metadata:d.proposer.metadata});u==null||u.addTrace(Sa.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:d,verifyContext:h})}catch(u){await this.sendError({id:c,topic:n,error:u,rpcOpts:bn.wc_sessionPropose.autoReject}),this.client.logger.error(u)}}),Ie(this,"onSessionProposeResponse",async(r,n,i)=>{const{id:s}=n;if(Ia(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const a=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const c=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});const u=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:u});const l=await this.client.core.crypto.generateSharedKey(c,u);this.pendingSessions.set(s,{sessionTopic:l,pairingTopic:r,proposalId:s,publicKey:c});const d=await this.client.core.relayer.subscribe(l,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:d}),await this.client.core.pairing.activate({topic:r})}else if(eo(n)){await this.client.proposal.delete(s,sr("USER_DISCONNECTED"));const o=Kt("session_connect",s);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(o,{error:n.error})}}),Ie(this,"onSessionSettleRequest",async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:u,sessionProperties:l,scopedProperties:d,sessionConfig:h}=n.params,f=[...this.pendingSessions.values()].find(m=>m.sessionTopic===r);if(!f)return this.client.logger.error(`Pending session not found for topic ${r}`);const g=this.client.proposal.get(f.proposalId),p=ci(mr(mr(mr({topic:r,relay:o,expiry:c,namespaces:u,acknowledged:!0,pairingTopic:f.pairingTopic,requiredNamespaces:g.requiredNamespaces,optionalNamespaces:g.optionalNamespaces,controller:a.publicKey,self:{publicKey:f.publicKey,metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},l&&{sessionProperties:l}),d&&{scopedProperties:d}),h&&{sessionConfig:h}),{transportType:Pr.relay});await this.client.session.set(p.topic,p),await this.setExpiry(p.topic,p.expiry),await this.client.core.pairing.updateMetadata({topic:f.pairingTopic,metadata:p.peer.metadata}),this.client.events.emit("session_connect",{session:p}),this.events.emit(Kt("session_connect",f.proposalId),{session:p}),this.pendingSessions.delete(f.proposalId),this.deleteProposal(f.proposalId,!1),this.cleanupDuplicatePairings(p),await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}}),Ie(this,"onSessionSettleResponse",async(r,n)=>{const{id:i}=n;Ia(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Kt("session_approve",i),{})):eo(n)&&(await this.client.session.delete(r,sr("USER_DISCONNECTED")),this.events.emit(Kt("session_approve",i),{error:n.error}))}),Ie(this,"onSessionUpdateRequest",async(r,n)=>{const{params:i,id:s}=n;try{const o=`${r}_session_update`,a=H1.get(o);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.warn(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:sr("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(mr({topic:r},i));try{H1.set(o,s),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:r,result:!0,throwOnFailedPublish:!0})}catch(c){throw H1.delete(o),c}this.client.events.emit("session_update",{id:s,topic:r,params:i})}catch(o){await this.sendError({id:s,topic:r,error:o}),this.client.logger.error(o)}}),Ie(this,"isRequestOutOfSync",(r,n)=>n.toString().slice(0,-3)<r.toString().slice(0,-3)),Ie(this,"onSessionUpdateResponse",(r,n)=>{const{id:i}=n,s=Kt("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Ia(n)?this.events.emit(Kt("session_update",i),{}):eo(n)&&this.events.emit(Kt("session_update",i),{error:n.error})}),Ie(this,"onSessionExtendRequest",async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,gn(Qp)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}}),Ie(this,"onSessionExtendResponse",(r,n)=>{const{id:i}=n,s=Kt("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Ia(n)?this.events.emit(Kt("session_extend",i),{}):eo(n)&&this.events.emit(Kt("session_extend",i),{error:n.error})}),Ie(this,"onSessionPingRequest",async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}}),Ie(this,"onSessionPingResponse",(r,n)=>{const{id:i}=n,s=Kt("session_ping",i);setTimeout(()=>{if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners 2176`);Ia(n)?this.events.emit(Kt("session_ping",i),{}):eo(n)&&this.events.emit(Kt("session_ping",i),{error:n.error})},500)}),Ie(this,"onSessionDeleteRequest",async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),Promise.all([new Promise(s=>{this.client.core.relayer.once(xn.publish,async()=>{s(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:sr("USER_DISCONNECTED")})]).catch(s=>this.client.logger.error(s))}catch(s){this.client.logger.error(s)}}),Ie(this,"onSessionRequest",async r=>{var n,i,s;const{topic:o,payload:a,attestation:c,encryptedId:u,transportType:l}=r,{id:d,params:h}=a;try{await this.isValidRequest(mr({topic:o},h));const f=this.client.session.get(o),g=await this.getVerifyContext({attestationId:c,hash:La(JSON.stringify(sd("wc_sessionRequest",h,d))),encryptedId:u,metadata:f.peer.metadata,transportType:l}),p={id:d,topic:o,params:h,verifyContext:g};await this.setPendingSessionRequest(p),l===Pr.link_mode&&(n=f.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=f.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(p):(this.addSessionRequestToSessionRequestQueue(p),this.processSessionRequestQueue())}catch(f){await this.sendError({id:d,topic:o,error:f}),this.client.logger.error(f)}}),Ie(this,"onSessionRequestResponse",(r,n)=>{const{id:i}=n,s=Kt("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Ia(n)?this.events.emit(Kt("session_request",i),{result:n.result}):eo(n)&&this.events.emit(Kt("session_request",i),{error:n.error})}),Ie(this,"onSessionEventRequest",async(r,n)=>{const{id:i,params:s}=n;try{const o=`${r}_session_event_${s.event.name}`,a=H1.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(mr({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s}),H1.set(o,i)}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}}),Ie(this,"onSessionAuthenticateResponse",(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),Ia(n)?this.events.emit(Kt("session_request",i),{result:n.result}):eo(n)&&this.events.emit(Kt("session_request",i),{error:n.error})}),Ie(this,"onSessionAuthenticateRequest",async r=>{var n;const{topic:i,payload:s,attestation:o,encryptedId:a,transportType:c}=r;try{const{requester:u,authPayload:l,expiryTimestamp:d}=s.params,h=await this.getVerifyContext({attestationId:o,hash:La(JSON.stringify(s)),encryptedId:a,metadata:u.metadata,transportType:c}),f={requester:u,pairingTopic:i,id:s.id,authPayload:l,verifyContext:h,expiryTimestamp:d};await this.setAuthRequest(s.id,{request:f,pairingTopic:i,transportType:c}),c===Pr.link_mode&&(n=u.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp(u.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:s.params,id:s.id,verifyContext:h})}catch(u){this.client.logger.error(u);const l=s.params.requester.publicKey,d=await this.client.core.crypto.generateKeyPair(),h=this.getAppLinkIfEnabled(s.params.requester.metadata,c),f={type:Eu,receiverPublicKey:l,senderPublicKey:d};await this.sendError({id:s.id,topic:i,error:u,encodeOpts:f,rpcOpts:bn.wc_sessionAuthenticate.autoReject,appLink:h})}}),Ie(this,"addSessionRequestToSessionRequestQueue",r=>{this.sessionRequestQueue.queue.push(r)}),Ie(this,"cleanupAfterResponse",r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=va.idle,this.processSessionRequestQueue()},Be.toMiliseconds(this.requestQueueDelay))}),Ie(this,"cleanupPendingSentRequestsForTopic",({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{const o=s.request.id,a=Kt("session_request",o);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);this.events.emit(Kt("session_request",s.request.id),{error:n})})}),Ie(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===va.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=va.active,this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}}),Ie(this,"emitSessionRequest",r=>{this.client.events.emit("session_request",r)}),Ie(this,"onPairingCreated",r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest({topic:r.topic,payload:sd("wc_sessionPropose",ci(mr({},n),{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties,scopedProperties:n.scopedProperties}),n.id)})}),Ie(this,"isValidConnect",async r=>{if(!Fi(r)){const{message:u}=De("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(u)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,scopedProperties:a,relays:c}=r;if(Ln(n)||await this.isValidPairingTopic(n),!F0e(c)){const{message:u}=De("MISSING_OR_INVALID",`connect() relays: ${c}`);throw new Error(u)}if(!Ln(i)&&dd(i)!==0){const u="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(u):this.client.logger.warn(u),this.validateNamespaces(i,"requiredNamespaces")}if(!Ln(s)&&dd(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Ln(o)||this.validateSessionProps(o,"sessionProperties"),!Ln(a)){this.validateSessionProps(a,"scopedProperties");const u=Object.keys(i||{}).concat(Object.keys(s||{}));if(!Object.keys(a).every(l=>u.includes(l)))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(a)}, required/optional namespaces: ${JSON.stringify(u)}`)}}),Ie(this,"validateNamespaces",(r,n)=>{const i=U0e(r,"connect()",n);if(i)throw new Error(i.message)}),Ie(this,"isValidApprove",async r=>{if(!Fi(r))throw new Error(De("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:o,scopedProperties:a}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const c=this.client.proposal.get(n),u=V8(i,"approve()");if(u)throw new Error(u.message);const l=a$(c.requiredNamespaces,i,"approve()");if(l)throw new Error(l.message);if(!cn(s,!0)){const{message:d}=De("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(d)}if(Ln(o)||this.validateSessionProps(o,"sessionProperties"),!Ln(a)){this.validateSessionProps(a,"scopedProperties");const d=new Set(Object.keys(i));if(!Object.keys(a).every(h=>d.has(h)))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(a)}, approved namespaces: ${Array.from(d).join(", ")}`)}}),Ie(this,"isValidReject",async r=>{if(!Fi(r)){const{message:s}=De("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!q0e(i)){const{message:s}=De("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}}),Ie(this,"isValidSessionSettleRequest",r=>{if(!Fi(r)){const{message:u}=De("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(u)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!LK(n)){const{message:u}=De("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(u)}const a=$0e(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=V8(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(Bl(o)){const{message:u}=De("EXPIRED","onSessionSettleRequest()");throw new Error(u)}}),Ie(this,"isValidUpdate",async r=>{if(!Fi(r)){const{message:c}=De("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const s=this.client.session.get(n),o=V8(i,"update()");if(o)throw new Error(o.message);const a=a$(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)}),Ie(this,"isValidExtend",async r=>{if(!Fi(r)){const{message:i}=De("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)}),Ie(this,"isValidRequest",async r=>{if(!Fi(r)){const{message:c}=De("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:s,expiry:o}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!o$(a,s)){const{message:c}=De("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!z0e(i)){const{message:c}=De("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!G0e(a,s,i.method)){const{message:c}=De("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!J0e(o,eS)){const{message:c}=De("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${eS.min} and ${eS.max}`);throw new Error(c)}}),Ie(this,"isValidRespond",async r=>{var n;if(!Fi(r)){const{message:o}=De("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:i,response:s}=r;try{await this.isValidSessionTopic(i)}catch(o){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),o}if(!W0e(s)){const{message:o}=De("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}}),Ie(this,"isValidPing",async r=>{if(!Fi(r)){const{message:i}=De("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)}),Ie(this,"isValidEmit",async r=>{if(!Fi(r)){const{message:a}=De("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!o$(o,s)){const{message:a}=De("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!V0e(i)){const{message:a}=De("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!K0e(o,s,i.name)){const{message:a}=De("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}}),Ie(this,"isValidDisconnect",async r=>{if(!Fi(r)){const{message:i}=De("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)}),Ie(this,"isValidAuthenticate",r=>{const{chains:n,uri:i,domain:s,nonce:o}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!cn(i,!1))throw new Error("uri is required parameter");if(!cn(s,!1))throw new Error("domain is required parameter");if(!cn(o,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(c=>ig(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=ig(n[0]);if(a!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),Ie(this,"getVerifyContext",async r=>{const{attestationId:n,hash:i,encryptedId:s,metadata:o,transportType:a}=r,c={verified:{verifyUrl:o.verifyUrl||pb,validation:"UNKNOWN",origin:o.url||""}};try{if(a===Pr.link_mode){const l=this.getAppLinkIfEnabled(o,a);return c.verified.validation=l&&new URL(l).origin===new URL(o.url).origin?"VALID":"INVALID",c}const u=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:s,verifyUrl:o.verifyUrl});u&&(c.verified.origin=u.origin,c.verified.isScam=u.isScam,c.verified.validation=u.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(u){this.client.logger.warn(u)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c}),Ie(this,"validateSessionProps",(r,n)=>{Object.values(r).forEach((i,s)=>{if(i==null){const{message:o}=De("MISSING_OR_INVALID",`${n} must contain an existing value for each key. Received: ${i} for key ${Object.keys(r)[s]}`);throw new Error(o)}})}),Ie(this,"getPendingAuthRequest",r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0}),Ie(this,"addToRecentlyDeleted",(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const s=this.recentlyDeletedLimit/2;for(const o of this.recentlyDeletedMap.keys()){if(i++>=s)break;this.recentlyDeletedMap.delete(o)}}}),Ie(this,"checkRecentlyDeleted",r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=De("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}}),Ie(this,"isLinkModeEnabled",(r,n)=>{var i,s,o,a,c,u,l,d,h;return!r||n!==Pr.link_mode?!1:((s=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:s.linkMode)===!0&&((a=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:a.universal)!==void 0&&((u=(c=this.client.metadata)==null?void 0:c.redirect)==null?void 0:u.universal)!==""&&((l=r==null?void 0:r.redirect)==null?void 0:l.universal)!==void 0&&((d=r==null?void 0:r.redirect)==null?void 0:d.universal)!==""&&((h=r==null?void 0:r.redirect)==null?void 0:h.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"}),Ie(this,"getAppLinkIfEnabled",(r,n)=>{var i;return this.isLinkModeEnabled(r,n)?(i=r==null?void 0:r.redirect)==null?void 0:i.universal:void 0}),Ie(this,"handleLinkModeMessage",({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;const n=EN(r,"topic")||"",i=decodeURIComponent(EN(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:Pr.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:s})}),Ie(this,"registerLinkModeListeners",async()=>{var r;if(V9()||jd()&&(r=this.client.metadata.redirect)!=null&&r.linkMode){const n=global==null?void 0:global.Linking;if(typeof n<"u"){n.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await n.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}),Ie(this,"shouldSetTVF",(r,n)=>{if(!n||r!=="wc_sessionRequest")return!1;const{request:i}=n;return Object.keys(z$).includes(i.method)}),Ie(this,"getTVFParams",(r,n,i)=>{var s,o;try{const a=n.request.method,c=this.extractTxHashesFromResult(a,i);return ci(mr({correlationId:r,rpcMethods:[a],chainId:n.chainId},this.isValidContractData(n.request.params)&&{contractAddresses:[(o=(s=n.request.params)==null?void 0:s[0])==null?void 0:o.to]}),{txHashes:c})}catch(a){this.client.logger.warn("Error getting TVF params",a)}return{}}),Ie(this,"isValidContractData",r=>{var n;if(!r)return!1;try{const i=(r==null?void 0:r.data)||((n=r==null?void 0:r[0])==null?void 0:n.data);if(!i.startsWith("0x"))return!1;const s=i.slice(2);return/^[0-9a-fA-F]*$/.test(s)?s.length%2===0:!1}catch{}return!1}),Ie(this,"extractTxHashesFromResult",(r,n)=>{try{const i=z$[r];if(typeof n=="string")return[n];const s=n[i.key];if(ld(s))return r==="solana_signAllTransactions"?s.map(o=>wfe(o)):s;if(typeof s=="string")return[s]}catch(i){this.client.logger.warn("Error extracting tx hashes from result",i)}return[]})}async processPendingMessageEvents(){try{const e=this.client.session.keys,r=this.client.core.relayer.messages.getWithoutAck(e);for(const[n,i]of Object.entries(r))for(const s of i)try{await this.onProviderMessageEvent({topic:n,message:s,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${n}, message: ${s}`)}}catch(e){this.client.logger.warn("processPendingMessageEvents failed",e)}}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(xn.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){const{topic:r,message:n,attestation:i,transportType:s}=e,{publicKey:o}=this.client.auth.authKeys.keys.includes(Q4)?this.client.auth.authKeys.get(Q4):{publicKey:void 0};try{const a=await this.client.core.crypto.decode(r,n,{receiverPublicKey:o,encoding:s===Pr.link_mode?Ml:Lo});t7(a)?(this.client.core.history.set(r,a),await this.onRelayEventRequest({topic:r,payload:a,attestation:i,transportType:s,encryptedId:La(n)})):iA(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a,transportType:s}),this.client.core.history.delete(r,a.id)):await this.onRelayEventUnknownPayload({topic:r,payload:a,transportType:s}),await this.client.core.relayer.messages.ack(r,n)}catch(a){this.client.logger.error(a)}}registerExpirerEvents(){this.client.core.expirer.on(Gs.expired,async e=>{const{topic:r,id:n}=iK(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,De("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,De("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(Fh.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(Fh.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!cn(e,!1)){const{message:r}=De("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=De("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(Bl(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=De("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!cn(e,!1)){const{message:r}=De("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=De("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(Bl(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=De("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=De("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(cn(e,!1)){const{message:r}=De("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=De("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!H0e(e)){const{message:r}=De("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=De("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(Bl(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=De("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class Tbe extends Ep{constructor(e,r){super(e,r,dbe,r7),this.core=e,this.logger=r}}let Ibe=class extends Ep{constructor(e,r){super(e,r,hbe,r7),this.core=e,this.logger=r}};class Pbe extends Ep{constructor(e,r){super(e,r,pbe,r7,n=>n.id),this.core=e,this.logger=r}}class Obe extends Ep{constructor(e,r){super(e,r,bbe,oA,()=>Q4),this.core=e,this.logger=r}}class Rbe extends Ep{constructor(e,r){super(e,r,ybe,oA),this.core=e,this.logger=r}}class kbe extends Ep{constructor(e,r){super(e,r,vbe,oA,n=>n.id),this.core=e,this.logger=r}}var Nbe=Object.defineProperty,$be=(t,e,r)=>e in t?Nbe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,tS=(t,e,r)=>$be(t,typeof e!="symbol"?e+"":e,r);class jbe{constructor(e,r){this.core=e,this.logger=r,tS(this,"authKeys"),tS(this,"pairingTopics"),tS(this,"requests"),this.authKeys=new Obe(this.core,this.logger),this.pairingTopics=new Rbe(this.core,this.logger),this.requests=new kbe(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var Bbe=Object.defineProperty,Dbe=(t,e,r)=>e in t?Bbe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ot=(t,e,r)=>Dbe(t,typeof e!="symbol"?e+"":e,r);let Mbe=class lZ extends $oe{constructor(e){super(e),Ot(this,"protocol",aZ),Ot(this,"version",cZ),Ot(this,"name",X8.name),Ot(this,"metadata"),Ot(this,"core"),Ot(this,"logger"),Ot(this,"events",new ao.EventEmitter),Ot(this,"engine"),Ot(this,"session"),Ot(this,"proposal"),Ot(this,"pendingRequest"),Ot(this,"auth"),Ot(this,"signConfig"),Ot(this,"on",(n,i)=>this.events.on(n,i)),Ot(this,"once",(n,i)=>this.events.once(n,i)),Ot(this,"off",(n,i)=>this.events.off(n,i)),Ot(this,"removeListener",(n,i)=>this.events.removeListener(n,i)),Ot(this,"removeAllListeners",n=>this.events.removeAllListeners(n)),Ot(this,"connect",async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"pair",async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"approve",async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"reject",async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"update",async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"extend",async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"request",async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"respond",async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"ping",async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"emit",async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"disconnect",async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"find",n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}}),Ot(this,"authenticate",async(n,i)=>{try{return await this.engine.authenticate(n,i)}catch(s){throw this.logger.error(s.message),s}}),Ot(this,"formatAuthMessage",n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"approveSessionAuthenticate",async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}}),Ot(this,"rejectSessionAuthenticate",async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}}),this.name=(e==null?void 0:e.name)||X8.name,this.metadata=Ohe(e==null?void 0:e.metadata),this.signConfig=e==null?void 0:e.signConfig;const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Tv(Xm({level:(e==null?void 0:e.logger)||X8.logger}));this.core=(e==null?void 0:e.core)||new lbe(e),this.logger=si(r,this.name),this.session=new Ibe(this.core,this.logger),this.proposal=new Tbe(this.core,this.logger),this.pendingRequest=new Pbe(this.core,this.logger),this.engine=new Sbe(this),this.auth=new jbe(this.core,this.logger)}static async init(e){const r=new lZ(e);return await r.initialize(),r}get context(){return es(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),setTimeout(()=>{this.engine.processRelayMessageCache()},Be.toMiliseconds(Be.ONE_SECOND))}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};var h3={exports:{}},V$;function Lbe(){return V$||(V$=1,function(t,e){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Da<"u"&&Da,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof Da<"u"&&Da||{},c={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function u(S){return S&&DataView.prototype.isPrototypeOf(S)}if(c.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(S){return S&&l.indexOf(Object.prototype.toString.call(S))>-1};function h(S){if(typeof S!="string"&&(S=String(S)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(S)||S==="")throw new TypeError('Invalid character in header field name: "'+S+'"');return S.toLowerCase()}function f(S){return typeof S!="string"&&(S=String(S)),S}function g(S){var P={next:function(){var I=S.shift();return{done:I===void 0,value:I}}};return c.iterable&&(P[Symbol.iterator]=function(){return P}),P}function p(S){this.map={},S instanceof p?S.forEach(function(P,I){this.append(I,P)},this):Array.isArray(S)?S.forEach(function(P){if(P.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+P.length);this.append(P[0],P[1])},this):S&&Object.getOwnPropertyNames(S).forEach(function(P){this.append(P,S[P])},this)}p.prototype.append=function(S,P){S=h(S),P=f(P);var I=this.map[S];this.map[S]=I?I+", "+P:P},p.prototype.delete=function(S){delete this.map[h(S)]},p.prototype.get=function(S){return S=h(S),this.has(S)?this.map[S]:null},p.prototype.has=function(S){return this.map.hasOwnProperty(h(S))},p.prototype.set=function(S,P){this.map[h(S)]=f(P)},p.prototype.forEach=function(S,P){for(var I in this.map)this.map.hasOwnProperty(I)&&S.call(P,this.map[I],I,this)},p.prototype.keys=function(){var S=[];return this.forEach(function(P,I){S.push(I)}),g(S)},p.prototype.values=function(){var S=[];return this.forEach(function(P){S.push(P)}),g(S)},p.prototype.entries=function(){var S=[];return this.forEach(function(P,I){S.push([I,P])}),g(S)},c.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function m(S){if(!S._noBody){if(S.bodyUsed)return Promise.reject(new TypeError("Already read"));S.bodyUsed=!0}}function b(S){return new Promise(function(P,I){S.onload=function(){P(S.result)},S.onerror=function(){I(S.error)}})}function v(S){var P=new FileReader,I=b(P);return P.readAsArrayBuffer(S),I}function E(S){var P=new FileReader,I=b(P),B=/charset=([A-Za-z0-9_-]+)/.exec(S.type),$=B?B[1]:"utf-8";return P.readAsText(S,$),I}function w(S){for(var P=new Uint8Array(S),I=new Array(P.length),B=0;B<P.length;B++)I[B]=String.fromCharCode(P[B]);return I.join("")}function C(S){if(S.slice)return S.slice(0);var P=new Uint8Array(S.byteLength);return P.set(new Uint8Array(S)),P.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(S){this.bodyUsed=this.bodyUsed,this._bodyInit=S,S?typeof S=="string"?this._bodyText=S:c.blob&&Blob.prototype.isPrototypeOf(S)?this._bodyBlob=S:c.formData&&FormData.prototype.isPrototypeOf(S)?this._bodyFormData=S:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)?this._bodyText=S.toString():c.arrayBuffer&&c.blob&&u(S)?(this._bodyArrayBuffer=C(S.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(S)||d(S))?this._bodyArrayBuffer=C(S):this._bodyText=S=Object.prototype.toString.call(S):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof S=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var S=m(this);if(S)return S;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var S=m(this);return S||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(v);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var S=m(this);if(S)return S;if(this._bodyBlob)return E(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(w(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(T)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function x(S){var P=S.toUpperCase();return _.indexOf(P)>-1?P:S}function A(S,P){if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');P=P||{};var I=P.body;if(S instanceof A){if(S.bodyUsed)throw new TypeError("Already read");this.url=S.url,this.credentials=S.credentials,P.headers||(this.headers=new p(S.headers)),this.method=S.method,this.mode=S.mode,this.signal=S.signal,!I&&S._bodyInit!=null&&(I=S._bodyInit,S.bodyUsed=!0)}else this.url=String(S);if(this.credentials=P.credentials||this.credentials||"same-origin",(P.headers||!this.headers)&&(this.headers=new p(P.headers)),this.method=x(P.method||this.method||"GET"),this.mode=P.mode||this.mode||null,this.signal=P.signal||this.signal||function(){if("AbortController"in a){var R=new AbortController;return R.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&I)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(I),(this.method==="GET"||this.method==="HEAD")&&(P.cache==="no-store"||P.cache==="no-cache")){var B=/([?&])_=[^&]*/;if(B.test(this.url))this.url=this.url.replace(B,"$1_="+new Date().getTime());else{var $=/\?/;this.url+=($.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})};function T(S){var P=new FormData;return S.trim().split("&").forEach(function(I){if(I){var B=I.split("="),$=B.shift().replace(/\+/g," "),R=B.join("=").replace(/\+/g," ");P.append(decodeURIComponent($),decodeURIComponent(R))}}),P}function O(S){var P=new p,I=S.replace(/\r?\n[\t ]+/g," ");return I.split("\r").map(function(B){return B.indexOf(`
- `)===0?B.substr(1,B.length):B}).forEach(function(B){var $=B.split(":"),R=$.shift().trim();if(R){var D=$.join(":").trim();try{P.append(R,D)}catch(L){console.warn("Response "+L.message)}}}),P}y.call(A.prototype);function k(S,P){if(!(this instanceof k))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(P||(P={}),this.type="default",this.status=P.status===void 0?200:P.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=P.statusText===void 0?"":""+P.statusText,this.headers=new p(P.headers),this.url=P.url||"",this._initBody(S)}y.call(k.prototype),k.prototype.clone=function(){return new k(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},k.error=function(){var S=new k(null,{status:200,statusText:""});return S.ok=!1,S.status=0,S.type="error",S};var j=[301,302,303,307,308];k.redirect=function(S,P){if(j.indexOf(P)===-1)throw new RangeError("Invalid status code");return new k(null,{status:P,headers:{location:S}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(P,I){this.message=P,this.name=I;var B=Error(P);this.stack=B.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function N(S,P){return new Promise(function(I,B){var $=new A(S,P);if($.signal&&$.signal.aborted)return B(new o.DOMException("Aborted","AbortError"));var R=new XMLHttpRequest;function D(){R.abort()}R.onload=function(){var z={statusText:R.statusText,headers:O(R.getAllResponseHeaders()||"")};$.url.indexOf("file://")===0&&(R.status<200||R.status>599)?z.status=200:z.status=R.status,z.url="responseURL"in R?R.responseURL:z.headers.get("X-Request-URL");var W="response"in R?R.response:R.responseText;setTimeout(function(){I(new k(W,z))},0)},R.onerror=function(){setTimeout(function(){B(new TypeError("Network request failed"))},0)},R.ontimeout=function(){setTimeout(function(){B(new TypeError("Network request timed out"))},0)},R.onabort=function(){setTimeout(function(){B(new o.DOMException("Aborted","AbortError"))},0)};function L(z){try{return z===""&&a.location.href?a.location.href:z}catch{return z}}if(R.open($.method,L($.url),!0),$.credentials==="include"?R.withCredentials=!0:$.credentials==="omit"&&(R.withCredentials=!1),"responseType"in R&&(c.blob?R.responseType="blob":c.arrayBuffer&&(R.responseType="arraybuffer")),P&&typeof P.headers=="object"&&!(P.headers instanceof p||a.Headers&&P.headers instanceof a.Headers)){var U=[];Object.getOwnPropertyNames(P.headers).forEach(function(z){U.push(h(z)),R.setRequestHeader(z,f(P.headers[z]))}),$.headers.forEach(function(z,W){U.indexOf(W)===-1&&R.setRequestHeader(W,z)})}else $.headers.forEach(function(z,W){R.setRequestHeader(W,z)});$.signal&&($.signal.addEventListener("abort",D),R.onreadystatechange=function(){R.readyState===4&&$.signal.removeEventListener("abort",D)}),R.send(typeof $._bodyInit>"u"?null:$._bodyInit)})}return N.polyfill=!0,a.fetch||(a.fetch=N,a.Headers=p,a.Request=A,a.Response=k),o.Headers=p,o.Request=A,o.Response=k,o.fetch=N,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=r.fetch?r:n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e}(h3,h3.exports)),h3.exports}var Ube=Lbe();const G$=cc(Ube);var Fbe=Object.defineProperty,Hbe=Object.defineProperties,qbe=Object.getOwnPropertyDescriptors,K$=Object.getOwnPropertySymbols,zbe=Object.prototype.hasOwnProperty,Wbe=Object.prototype.propertyIsEnumerable,Z$=(t,e,r)=>e in t?Fbe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Y$=(t,e)=>{for(var r in e||(e={}))zbe.call(e,r)&&Z$(t,r,e[r]);if(K$)for(var r of K$(e))Wbe.call(e,r)&&Z$(t,r,e[r]);return t},J$=(t,e)=>Hbe(t,qbe(e));const Vbe={Accept:"application/json","Content-Type":"application/json"},Gbe="POST",Q$={headers:Vbe,method:Gbe},X$=10;let ta=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new ao.EventEmitter,this.isAvailable=!1,this.registering=!1,!p$(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=Tu(e),n=await(await G$(this.url,J$(Y$({},Q$),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!p$(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Tu({id:1,jsonrpc:"2.0",method:"test",params:[]});await G$(e,J$(Y$({},Q$),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?jf(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=nA(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return HK(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>X$&&this.events.setMaxListeners(X$)}};const ej="error",Kbe="wss://relay.walletconnect.org",Zbe="wc",Ybe="universal_provider",f3=`${Zbe}@2:${Ybe}:`,dZ="https://rpc.walletconnect.org/v1/",D0="generic",Jbe=`${dZ}bundler`,uo={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};function Qbe(){}function n7(t){return t==null||typeof t!="object"&&typeof t!="function"}function i7(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Xbe(t){if(n7(t))return t;if(Array.isArray(t)||i7(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t),r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){const n=new r(t.message);return n.stack=t.stack,n.name=t.name,n.cause=t.cause,n}if(typeof File<"u"&&t instanceof File)return new r([t],t.name,{type:t.type,lastModified:t.lastModified});if(typeof t=="object"){const n=Object.create(e);return Object.assign(n,t)}return t}function tj(t){return typeof t=="object"&&t!==null}function hZ(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function fZ(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const eye="[object RegExp]",pZ="[object String]",gZ="[object Number]",mZ="[object Boolean]",wZ="[object Arguments]",tye="[object Symbol]",rye="[object Date]",nye="[object Map]",iye="[object Set]",sye="[object Array]",oye="[object ArrayBuffer]",aye="[object Object]",cye="[object DataView]",uye="[object Uint8Array]",lye="[object Uint8ClampedArray]",dye="[object Uint16Array]",hye="[object Uint32Array]",fye="[object Int8Array]",pye="[object Int16Array]",gye="[object Int32Array]",mye="[object Float32Array]",wye="[object Float64Array]";function bye(t,e){return G0(t,void 0,t,new Map,e)}function G0(t,e,r,n=new Map,i=void 0){const s=i==null?void 0:i(t,e,r,n);if(s!=null)return s;if(n7(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const o=new Array(t.length);n.set(t,o);for(let a=0;a<t.length;a++)o[a]=G0(t[a],a,r,n,i);return Object.hasOwn(t,"index")&&(o.index=t.index),Object.hasOwn(t,"input")&&(o.input=t.input),o}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const o=new RegExp(t.source,t.flags);return o.lastIndex=t.lastIndex,o}if(t instanceof Map){const o=new Map;n.set(t,o);for(const[a,c]of t)o.set(a,G0(c,a,r,n,i));return o}if(t instanceof Set){const o=new Set;n.set(t,o);for(const a of t)o.add(G0(a,void 0,r,n,i));return o}if(typeof Buffer<"u"&&Buffer.isBuffer(t))return t.subarray();if(i7(t)){const o=new(Object.getPrototypeOf(t)).constructor(t.length);n.set(t,o);for(let a=0;a<t.length;a++)o[a]=G0(t[a],a,r,n,i);return o}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const o=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return n.set(t,o),Hh(o,t,r,n,i),o}if(typeof File<"u"&&t instanceof File){const o=new File([t],t.name,{type:t.type});return n.set(t,o),Hh(o,t,r,n,i),o}if(t instanceof Blob){const o=new Blob([t],{type:t.type});return n.set(t,o),Hh(o,t,r,n,i),o}if(t instanceof Error){const o=new t.constructor;return n.set(t,o),o.message=t.message,o.name=t.name,o.stack=t.stack,o.cause=t.cause,Hh(o,t,r,n,i),o}if(typeof t=="object"&&yye(t)){const o=Object.create(Object.getPrototypeOf(t));return n.set(t,o),Hh(o,t,r,n,i),o}return t}function Hh(t,e,r=t,n,i){const s=[...Object.keys(e),...hZ(e)];for(let o=0;o<s.length;o++){const a=s[o],c=Object.getOwnPropertyDescriptor(t,a);(c==null||c.writable)&&(t[a]=G0(e[a],a,r,n,i))}}function yye(t){switch(fZ(t)){case wZ:case sye:case oye:case cye:case mZ:case rye:case mye:case wye:case fye:case pye:case gye:case nye:case gZ:case aye:case eye:case iye:case pZ:case tye:case uye:case lye:case dye:case hye:return!0;default:return!1}}function vye(t,e){return bye(t,(r,n,i,s)=>{if(typeof t=="object")switch(Object.prototype.toString.call(t)){case gZ:case pZ:case mZ:{const o=new t.constructor(t==null?void 0:t.valueOf());return Hh(o,t),o}case wZ:{const o={};return Hh(o,t),o.length=t.length,o[Symbol.iterator]=t[Symbol.iterator],o}default:return}})}function rj(t){return vye(t)}function nj(t){return t!==null&&typeof t=="object"&&fZ(t)==="[object Arguments]"}function _ye(t){return i7(t)}function Eye(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Cye(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let s=0;s<r.length;s++){const o=r[s];i=HI(i,o,n,new Map)}return i}function HI(t,e,r,n){if(n7(t)&&(t=Object(t)),e==null||typeof e!="object")return t;if(n.has(e))return Xbe(n.get(e));if(n.set(e,t),Array.isArray(e)){e=e.slice();for(let s=0;s<e.length;s++)e[s]=e[s]??void 0}const i=[...Object.keys(e),...hZ(e)];for(let s=0;s<i.length;s++){const o=i[s];let a=e[o],c=t[o];if(nj(a)&&(a={...a}),nj(c)&&(c={...c}),typeof Buffer<"u"&&Buffer.isBuffer(a)&&(a=rj(a)),Array.isArray(a))if(typeof c=="object"&&c!=null){const l=[],d=Reflect.ownKeys(c);for(let h=0;h<d.length;h++){const f=d[h];l[f]=c[f]}c=l}else c=[];const u=r(c,a,o,t,e,n);u!=null?t[o]=u:Array.isArray(a)||tj(c)&&tj(a)?t[o]=HI(c,a,r,n):c==null&&Eye(a)?t[o]=HI({},a,r,n):c==null&&_ye(a)?t[o]=rj(a):(c===void 0||a!==void 0)&&(t[o]=a)}return t}function Aye(t,...e){return Cye(t,...e,Qbe)}var xye=Object.defineProperty,Sye=Object.defineProperties,Tye=Object.getOwnPropertyDescriptors,ij=Object.getOwnPropertySymbols,Iye=Object.prototype.hasOwnProperty,Pye=Object.prototype.propertyIsEnumerable,sj=(t,e,r)=>e in t?xye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,p3=(t,e)=>{for(var r in e||(e={}))Iye.call(e,r)&&sj(t,r,e[r]);if(ij)for(var r of ij(e))Pye.call(e,r)&&sj(t,r,e[r]);return t},Oye=(t,e)=>Sye(t,Tye(e));function xs(t,e,r){var n;const i=ig(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${dZ}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function Cp(t){return t.includes(":")?t.split(":")[1]:t}function bZ(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function Rye(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function g3(t={},e={}){const r=oj(t),n=oj(e);return Aye(r,n)}function oj(t){var e,r,n,i,s;const o={};if(!dd(t))return o;for(const[a,c]of Object.entries(t)){const u=tA(a)?[a]:c.chains,l=c.methods||[],d=c.events||[],h=c.rpcMap||{},f=V0(a);o[f]=Oye(p3(p3({},o[f]),c),{chains:Ka(u,(e=o[f])==null?void 0:e.chains),methods:Ka(l,(r=o[f])==null?void 0:r.methods),events:Ka(d,(n=o[f])==null?void 0:n.events)}),(dd(h)||dd(((i=o[f])==null?void 0:i.rpcMap)||{}))&&(o[f].rpcMap=p3(p3({},h),(s=o[f])==null?void 0:s.rpcMap))}return o}function aj(t){return t.includes(":")?t.split(":")[2]:t}function cj(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=tA(r)?[r]:n.chains?n.chains:bZ(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function rS(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const yZ={},zt=t=>yZ[t],nS=(t,e)=>{yZ[t]=e};var kye=Object.defineProperty,Nye=(t,e,r)=>e in t?kye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xp=(t,e,r)=>Nye(t,typeof e!="symbol"?e+"":e,r);class $ye{constructor(e){Xp(this,"name","polkadot"),Xp(this,"client"),Xp(this,"httpProviders"),Xp(this,"events"),Xp(this,"namespace"),Xp(this,"chainId"),this.namespace=e.namespace,this.events=zt("events"),this.client=zt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uo.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Cp(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||xs(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new co(new ta(n,zt("disableProviderPing")))}}var jye=Object.defineProperty,Bye=Object.defineProperties,Dye=Object.getOwnPropertyDescriptors,uj=Object.getOwnPropertySymbols,Mye=Object.prototype.hasOwnProperty,Lye=Object.prototype.propertyIsEnumerable,qI=(t,e,r)=>e in t?jye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lj=(t,e)=>{for(var r in e||(e={}))Mye.call(e,r)&&qI(t,r,e[r]);if(uj)for(var r of uj(e))Lye.call(e,r)&&qI(t,r,e[r]);return t},dj=(t,e)=>Bye(t,Dye(e)),e0=(t,e,r)=>qI(t,typeof e!="symbol"?e+"":e,r);class Uye{constructor(e){e0(this,"name","eip155"),e0(this,"client"),e0(this,"chainId"),e0(this,"namespace"),e0(this,"httpProviders"),e0(this,"events"),this.namespace=e.namespace,this.events=zt("events"),this.client=zt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(uo.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||xs(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new co(new ta(n,zt("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(Cp(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i,s,o;const a=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0],c=((s=(i=e.request)==null?void 0:i.params)==null?void 0:s[1])||[],u=`${a}${c.join(",")}`;if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const l=this.client.session.get(e.topic),d=((o=l==null?void 0:l.sessionProperties)==null?void 0:o.capabilities)||{};if(d!=null&&d[u])return d==null?void 0:d[u];const h=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:dj(lj({},l.sessionProperties||{}),{capabilities:dj(lj({},d||{}),{[u]:h})})})}catch(f){console.warn("Failed to update session with capabilities",f)}return h}async getCallStatus(e){var r,n;const i=this.client.session.get(e.topic),s=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(s){const a=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(a,e)}catch(c){console.warn("Failed to fetch call status from bundler",c,a)}}const o=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(a){console.warn("Failed to fetch call status from custom bundler",a,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,r){var n;const i=new URL(e),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(sd("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(e,r){return`${Jbe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}var Fye=Object.defineProperty,Hye=(t,e,r)=>e in t?Fye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,t0=(t,e,r)=>Hye(t,typeof e!="symbol"?e+"":e,r);class qye{constructor(e){t0(this,"name","solana"),t0(this,"client"),t0(this,"httpProviders"),t0(this,"events"),t0(this,"namespace"),t0(this,"chainId"),this.namespace=e.namespace,this.events=zt("events"),this.client=zt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uo.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Cp(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||xs(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new co(new ta(n,zt("disableProviderPing")))}}var zye=Object.defineProperty,Wye=(t,e,r)=>e in t?zye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,r0=(t,e,r)=>Wye(t,typeof e!="symbol"?e+"":e,r);class Vye{constructor(e){r0(this,"name","cosmos"),r0(this,"client"),r0(this,"httpProviders"),r0(this,"events"),r0(this,"namespace"),r0(this,"chainId"),this.namespace=e.namespace,this.events=zt("events"),this.client=zt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uo.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Cp(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||xs(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new co(new ta(n,zt("disableProviderPing")))}}var Gye=Object.defineProperty,Kye=(t,e,r)=>e in t?Gye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n0=(t,e,r)=>Kye(t,typeof e!="symbol"?e+"":e,r);class Zye{constructor(e){n0(this,"name","algorand"),n0(this,"client"),n0(this,"httpProviders"),n0(this,"events"),n0(this,"namespace"),n0(this,"chainId"),this.namespace=e.namespace,this.events=zt("events"),this.client=zt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||xs(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(uo.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||xs(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new co(new ta(n,zt("disableProviderPing")))}}var Yye=Object.defineProperty,Jye=(t,e,r)=>e in t?Yye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,i0=(t,e,r)=>Jye(t,typeof e!="symbol"?e+"":e,r);class Qye{constructor(e){i0(this,"name","cip34"),i0(this,"client"),i0(this,"httpProviders"),i0(this,"events"),i0(this,"namespace"),i0(this,"chainId"),this.namespace=e.namespace,this.events=zt("events"),this.client=zt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uo.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=Cp(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new co(new ta(n,zt("disableProviderPing")))}}var Xye=Object.defineProperty,eve=(t,e,r)=>e in t?Xye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,s0=(t,e,r)=>eve(t,typeof e!="symbol"?e+"":e,r);class tve{constructor(e){s0(this,"name","elrond"),s0(this,"client"),s0(this,"httpProviders"),s0(this,"events"),s0(this,"namespace"),s0(this,"chainId"),this.namespace=e.namespace,this.events=zt("events"),this.client=zt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uo.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Cp(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||xs(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new co(new ta(n,zt("disableProviderPing")))}}var rve=Object.defineProperty,nve=(t,e,r)=>e in t?rve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,o0=(t,e,r)=>nve(t,typeof e!="symbol"?e+"":e,r);class ive{constructor(e){o0(this,"name","multiversx"),o0(this,"client"),o0(this,"httpProviders"),o0(this,"events"),o0(this,"namespace"),o0(this,"chainId"),this.namespace=e.namespace,this.events=zt("events"),this.client=zt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uo.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=Cp(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||xs(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new co(new ta(n,zt("disableProviderPing")))}}var sve=Object.defineProperty,ove=(t,e,r)=>e in t?sve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,a0=(t,e,r)=>ove(t,typeof e!="symbol"?e+"":e,r);class ave{constructor(e){a0(this,"name","near"),a0(this,"client"),a0(this,"httpProviders"),a0(this,"events"),a0(this,"namespace"),a0(this,"chainId"),this.namespace=e.namespace,this.events=zt("events"),this.client=zt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||xs(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(uo.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||xs(e,this.namespace);return typeof n>"u"?void 0:new co(new ta(n,zt("disableProviderPing")))}}var cve=Object.defineProperty,uve=(t,e,r)=>e in t?cve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,c0=(t,e,r)=>uve(t,typeof e!="symbol"?e+"":e,r);class lve{constructor(e){c0(this,"name","tezos"),c0(this,"client"),c0(this,"httpProviders"),c0(this,"events"),c0(this,"namespace"),c0(this,"chainId"),this.namespace=e.namespace,this.events=zt("events"),this.client=zt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||xs(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(uo.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||xs(e,this.namespace);return typeof n>"u"?void 0:new co(new ta(n))}}var dve=Object.defineProperty,hve=(t,e,r)=>e in t?dve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u0=(t,e,r)=>hve(t,typeof e!="symbol"?e+"":e,r);class fve{constructor(e){u0(this,"name",D0),u0(this,"client"),u0(this,"httpProviders"),u0(this,"events"),u0(this,"namespace"),u0(this,"chainId"),this.namespace=e.namespace,this.events=zt("events"),this.client=zt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(uo.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const s=ig(i);n[`${s.namespace}:${s.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||xs(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new co(new ta(n,zt("disableProviderPing")))}}var pve=Object.defineProperty,gve=Object.defineProperties,mve=Object.getOwnPropertyDescriptors,hj=Object.getOwnPropertySymbols,wve=Object.prototype.hasOwnProperty,bve=Object.prototype.propertyIsEnumerable,zI=(t,e,r)=>e in t?pve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,m3=(t,e)=>{for(var r in e||(e={}))wve.call(e,r)&&zI(t,r,e[r]);if(hj)for(var r of hj(e))bve.call(e,r)&&zI(t,r,e[r]);return t},iS=(t,e)=>gve(t,mve(e)),qs=(t,e,r)=>zI(t,typeof e!="symbol"?e+"":e,r);let yve=class vZ{constructor(e){qs(this,"client"),qs(this,"namespaces"),qs(this,"optionalNamespaces"),qs(this,"sessionProperties"),qs(this,"scopedProperties"),qs(this,"events",new R9),qs(this,"rpcProviders",{}),qs(this,"session"),qs(this,"providerOpts"),qs(this,"logger"),qs(this,"uri"),qs(this,"disableProviderPing",!1),this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Tv(Xm({level:(e==null?void 0:e.logger)||ej})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new vZ(e);return await r.initialize(),r}async request(e,r,n){const[i,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:m3({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const s=new Date().getTime();this.request(e,n,i).then(o=>r(null,rA(s,o))).catch(o=>r(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:sr("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const s=await i();if(this.session=s.session,this.session){const o=cj(this.session.namespaces);this.namespaces=g3(this.namespaces,o),await this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){const{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties});r&&(this.uri=r,this.events.emit("display_uri",r));const i=await n();this.session=i;const s=cj(i.namespaces);return this.namespaces=g3(this.namespaces,s),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),s=this.getProvider(n);s.name===D0?s.setDefaultChain(`${n}:${i}`,r):s.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(ld(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var e,r;if(this.client=this.providerOpts.client||await Mbe.init({core:this.providerOpts.core,logger:this.providerOpts.logger||ej,relayUrl:this.providerOpts.relayUrl||Kbe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(n){throw this.logger.error("Failed to get session",n),new Error(`The provided session: ${(r=(e=this.providerOpts)==null?void 0:e.session)==null?void 0:r.topic} doesn't exist in the Sign client`)}else{const n=this.client.session.getAll();this.session=n[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>V0(r)))];nS("client",this.client),nS("events",this.events),nS("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=Rye(r,this.session),i=bZ(n),s=g3(this.namespaces,this.optionalNamespaces),o=iS(m3({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new Uye({namespace:o});break;case"algorand":this.rpcProviders[r]=new Zye({namespace:o});break;case"solana":this.rpcProviders[r]=new qye({namespace:o});break;case"cosmos":this.rpcProviders[r]=new Vye({namespace:o});break;case"polkadot":this.rpcProviders[r]=new $ye({namespace:o});break;case"cip34":this.rpcProviders[r]=new Qye({namespace:o});break;case"elrond":this.rpcProviders[r]=new tve({namespace:o});break;case"multiversx":this.rpcProviders[r]=new ive({namespace:o});break;case"near":this.rpcProviders[r]=new ave({namespace:o});break;case"tezos":this.rpcProviders[r]=new lve({namespace:o});break;default:this.rpcProviders[D0]?this.rpcProviders[D0].updateNamespace(o):this.rpcProviders[D0]=new fve({namespace:o})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{var r;const{topic:n}=e;n===((r=this.session)==null?void 0:r.topic)&&this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{var r;const{params:n,topic:i}=e;if(i!==((r=this.session)==null?void 0:r.topic))return;const{event:s}=n;if(s.name==="accountsChanged"){const o=s.data;o&&ld(o)&&this.events.emit("accountsChanged",o.map(aj))}else if(s.name==="chainChanged"){const o=n.chainId,a=n.event.data,c=V0(o),u=rS(o)!==rS(a)?`${c}:${rS(a)}`:o;this.onChainChanged(u)}else this.events.emit(s.name,s.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n,i;if(e!==((n=this.session)==null?void 0:n.topic))return;const{namespaces:s}=r,o=(i=this.client)==null?void 0:i.session.get(e);this.session=iS(m3({},o),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{var r;e.topic===((r=this.session)==null?void 0:r.topic)&&(await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",iS(m3({},sr("USER_DISCONNECTED")),{data:e.topic})))}),this.on(uo.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[D0]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r={},optionalNamespaces:n={},sessionProperties:i,scopedProperties:s}=e;this.optionalNamespaces=g3(r,n),this.sessionProperties=i,this.scopedProperties=s}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>V0(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=V0(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}async onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);if(!i)return;this.updateNamespaceChain(n,i),this.events.emit("chainChanged",i);const s=this.getProvider(n).getDefaultChain();r||this.getProvider(n).setDefaultChain(i),this.emitAccountsChangedOnChainChange({namespace:n,previousChainId:s,newChainId:e}),await this.persist("namespaces",this.namespaces)}emitAccountsChangedOnChainChange({namespace:e,previousChainId:r,newChainId:n}){var i,s;try{if(r===n)return;const o=(s=(i=this.session)==null?void 0:i.namespaces[e])==null?void 0:s.accounts;if(!o)return;const a=o.filter(c=>c.includes(`${n}:`)).map(aj);if(!ld(a))return;this.events.emit("accountsChanged",a)}catch(o){this.logger.warn("Failed to emit accountsChanged on chain change",o)}}updateNamespaceChain(e,r){if(!this.namespaces)return;const n=this.namespaces[e]?e:`${e}:${r}`,i={chains:[],methods:[],events:[],defaultChain:r};this.namespaces[n]?this.namespaces[n]&&(this.namespaces[n].defaultChain=r):this.namespaces[n]=i}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,await this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(e,r){var n;const i=((n=this.session)==null?void 0:n.topic)||"";await this.client.core.storage.setItem(`${f3}/${e}${i}`,r)}async getFromStore(e){var r;const n=((r=this.session)==null?void 0:r.topic)||"";return await this.client.core.storage.getItem(`${f3}/${e}${n}`)}async deleteFromStore(e){var r;const n=((r=this.session)==null?void 0:r.topic)||"";await this.client.core.storage.removeItem(`${f3}/${e}${n}`)}async cleanupStorage(){var e;try{if(((e=this.client)==null?void 0:e.session.length)>0)return;const r=await this.client.core.storage.getKeys();for(const n of r)n.startsWith(f3)&&await this.client.core.storage.removeItem(n)}catch(r){this.logger.warn("Failed to cleanup storage",r)}}};const Cu={getSIWX(){return oe.state.siwx},async initializeIfEnabled(){var s;const t=oe.state.siwx,e=F.getActiveCaipAddress();if(!(t&&e))return;const[r,n,i]=e.split(":");if(F.checkIfSupportedNetwork(r))try{if((await t.getSessions(`${r}:${n}`,i)).length)return;await We.open({view:"SIWXSignMessage"})}catch(o){console.error("SIWXUtil:initializeIfEnabled",o),Re.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:this.getSIWXEventProperties()}),await((s=xe._getClient())==null?void 0:s.disconnect().catch(console.error)),X.reset("Connect"),Fe.showError("A problem occurred while trying initialize authentication")}},async requestSignMessage(){const t=oe.state.siwx,e=ue.getPlainAddress(F.getActiveCaipAddress()),r=F.getActiveCaipNetwork(),n=xe._getClient();if(!t)throw new Error("SIWX is not enabled");if(!e)throw new Error("No ActiveCaipAddress found");if(!r)throw new Error("No ActiveCaipNetwork or client found");if(!n)throw new Error("No ConnectionController client found");try{const i=await t.createMessage({chainId:r.caipNetworkId,accountAddress:e}),s=i.toString();ge.getConnectorId(r.chainNamespace)===_e.CONNECTOR_ID.AUTH&&X.pushTransactionStack({});const a=await n.signMessage(s);await t.addSession({data:i,message:s,signature:a}),We.close(),Re.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:this.getSIWXEventProperties()})}catch(i){const s=this.getSIWXEventProperties();(!We.state.open||X.state.view==="ApproveTransaction")&&await We.open({view:"SIWXSignMessage"}),s.isSmartAccount?Fe.showError("This application might not support Smart Accounts"):Fe.showError("Signature declined"),Re.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:s}),console.error("SWIXUtil:requestSignMessage",i)}},async cancelSignMessage(){var t;try{const e=this.getSIWX();((t=e==null?void 0:e.getRequired)==null?void 0:t.call(e))?await xe.disconnect():We.close(),X.reset("Connect"),Re.sendEvent({event:"CLICK_CANCEL_SIWX",type:"track",properties:this.getSIWXEventProperties()})}catch(e){console.error("SIWXUtil:cancelSignMessage",e)}},async getSessions(){const t=oe.state.siwx,e=ue.getPlainAddress(F.getActiveCaipAddress()),r=F.getActiveCaipNetwork();return t&&e&&r?t.getSessions(r.caipNetworkId,e):[]},async isSIWXCloseDisabled(){var e;const t=this.getSIWX();if(t){const r=X.state.view==="ApproveTransaction",n=X.state.view==="SIWXSignMessage";if(r||n)return((e=t.getRequired)==null?void 0:e.call(t))&&(await this.getSessions()).length===0}return!1},async universalProviderAuthenticate({universalProvider:t,chains:e,methods:r}){var a,c,u;const n=Cu.getSIWX(),i=new Set(e.map(l=>l.split(":")[0]));if(!n||i.size!==1||!i.has("eip155"))return!1;const s=await n.createMessage({chainId:((a=F.getActiveCaipNetwork())==null?void 0:a.caipNetworkId)||"",accountAddress:""}),o=await t.authenticate({nonce:s.nonce,domain:s.domain,uri:s.uri,exp:s.expirationTime,iat:s.issuedAt,nbf:s.notBefore,requestId:s.requestId,version:s.version,resources:s.resources,statement:s.statement,chainId:s.chainId,methods:r,chains:[s.chainId,...e.filter(l=>l!==s.chainId)]});if(Fe.showLoading("Authenticating...",{autoClose:!1}),re.setConnectedWalletInfo({...o.session.peer.metadata,name:o.session.peer.metadata.name,icon:(c=o.session.peer.metadata.icons)==null?void 0:c[0],type:"WALLET_CONNECT"},Array.from(i)[0]),(u=o==null?void 0:o.auths)!=null&&u.length){const l=o.auths.map(d=>{const h=t.client.formatAuthMessage({request:d.p,iss:d.p.iss});return{data:{...d.p,accountAddress:d.p.iss.split(":").slice(-1).join(""),chainId:d.p.iss.split(":").slice(2,4).join(":"),uri:d.p.aud,version:d.p.version||s.version,expirationTime:d.p.exp,issuedAt:d.p.iat,notBefore:d.p.nbf},message:h,signature:d.s.s,cacao:d}});try{await n.setSessions(l),Re.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:Cu.getSIWXEventProperties()})}catch(d){throw console.error("SIWX:universalProviderAuth - failed to set sessions",d),Re.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:Cu.getSIWXEventProperties()}),await t.disconnect().catch(console.error),d}finally{Fe.hide()}}return!0},getSIWXEventProperties(){var e,r;const t=F.state.activeChain;return{network:((e=F.state.activeCaipNetwork)==null?void 0:e.caipNetworkId)||"",isSmartAccount:((r=re.state.preferredAccountTypes)==null?void 0:r[t])===bt.ACCOUNT_TYPES.SMART_ACCOUNT}},async clearSessions(){const t=this.getSIWX();t&&await t.setSessions([])}},_Z={isUnsupportedChainView(){return X.state.view==="UnsupportedChain"||X.state.view==="SwitchNetwork"&&X.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){We.shake();return}if(await Cu.isSIWXCloseDisabled()){We.shake();return}We.close()}},Xt={METMASK_CONNECTOR_NAME:"MetaMask",TRUST_CONNECTOR_NAME:"Trust Wallet",SOLFLARE_CONNECTOR_NAME:"Solflare",PHANTOM_CONNECTOR_NAME:"Phantom",COIN98_CONNECTOR_NAME:"Coin98",MAGIC_EDEN_CONNECTOR_NAME:"Magic Eden",BACKPACK_CONNECTOR_NAME:"Backpack",BITGET_CONNECTOR_NAME:"Bitget Wallet",FRONTIER_CONNECTOR_NAME:"Frontier",XVERSE_CONNECTOR_NAME:"Xverse Wallet",LEATHER_CONNECTOR_NAME:"Leather",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"},CONNECTOR_TYPE_EXTERNAL:"EXTERNAL",CONNECTOR_TYPE_WALLET_CONNECT:"WALLET_CONNECT",CONNECTOR_TYPE_INJECTED:"INJECTED",CONNECTOR_TYPE_ANNOUNCED:"ANNOUNCED",CONNECTOR_TYPE_AUTH:"AUTH",CONNECTOR_TYPE_MULTI_CHAIN:"MULTI_CHAIN",CONNECTOR_TYPE_W3M_AUTH:"ID_AUTH"},Ua={ConnectorExplorerIds:{[_e.CONNECTOR_ID.COINBASE]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[_e.CONNECTOR_ID.COINBASE_SDK]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[_e.CONNECTOR_ID.SAFE]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[_e.CONNECTOR_ID.LEDGER]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927",[_e.CONNECTOR_ID.OKX]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",[Xt.METMASK_CONNECTOR_NAME]:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",[Xt.TRUST_CONNECTOR_NAME]:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",[Xt.SOLFLARE_CONNECTOR_NAME]:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",[Xt.PHANTOM_CONNECTOR_NAME]:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",[Xt.COIN98_CONNECTOR_NAME]:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",[Xt.MAGIC_EDEN_CONNECTOR_NAME]:"8b830a2b724a9c3fbab63af6f55ed29c9dfa8a55e732dc88c80a196a2ba136c6",[Xt.BACKPACK_CONNECTOR_NAME]:"2bd8c14e035c2d48f184aaa168559e86b0e3433228d3c4075900a221785019b0",[Xt.BITGET_CONNECTOR_NAME]:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",[Xt.FRONTIER_CONNECTOR_NAME]:"85db431492aa2e8672e93f4ea7acf10c88b97b867b0d373107af63dc4880f041",[Xt.XVERSE_CONNECTOR_NAME]:"2a87d74ae02e10bdd1f51f7ce6c4e1cc53cd5f2c0b6b5ad0d7b3007d2b13de7b",[Xt.LEATHER_CONNECTOR_NAME]:"483afe1df1df63daf313109971ff3ef8356ddf1cc4e45877d205eee0b7893a13"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",5e3:"e86fae9b-b770-4eea-e520-150e12c81100",295:"6a97d510-cac8-4e58-c7ce-e8681b044c00",11155111:"e909ea0a-f92a-4512-c8fc-748044ea6800",84532:"a18a7ecd-e307-4360-4746-283182228e00",1301:"4eeea7ef-0014-4649-5d1d-07271a80f600",130:"2257980a-3463-48c6-cbac-a42d2a956e00",10143:"0a728e83-bacb-46db-7844-948f05434900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",80094:"e329c2c9-59b0-4a02-83e4-212ff3779900",2741:"fc2427d1-5af9-4a9c-8da5-6f94627cd900","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700","000000000019d6689c085ae165831e93":"0b4838db-0161-4ffe-022d-532bf03dba00","000000000933ea01ad0ee984209779ba":"39354064-d79b-420b-065d-f980c4b78200"},ConnectorImageIds:{[_e.CONNECTOR_ID.COINBASE]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[_e.CONNECTOR_ID.COINBASE_SDK]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[_e.CONNECTOR_ID.SAFE]:"461db637-8616-43ce-035a-d89b8a1d5800",[_e.CONNECTOR_ID.LEDGER]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[_e.CONNECTOR_ID.WALLET_CONNECT]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[_e.CONNECTOR_ID.INJECTED]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[_e.CONNECTOR_ID.INJECTED]:"Browser Wallet",[_e.CONNECTOR_ID.WALLET_CONNECT]:"WalletConnect",[_e.CONNECTOR_ID.COINBASE]:"Coinbase",[_e.CONNECTOR_ID.COINBASE_SDK]:"Coinbase",[_e.CONNECTOR_ID.LEDGER]:"Ledger",[_e.CONNECTOR_ID.SAFE]:"Safe"},ConnectorTypesMap:{[_e.CONNECTOR_ID.INJECTED]:"INJECTED",[_e.CONNECTOR_ID.WALLET_CONNECT]:"WALLET_CONNECT",[_e.CONNECTOR_ID.EIP6963]:"ANNOUNCED",[_e.CONNECTOR_ID.AUTH]:"AUTH"}},aA={getCaipTokens(t){if(!t)return;const e={};return Object.entries(t).forEach(([r,n])=>{e[`${Xt.EIP155}:${r}`]=n}),e},isLowerCaseMatch(t,e){return(t==null?void 0:t.toLowerCase())===(e==null?void 0:e.toLowerCase())}},vve=new AbortController,Do={EmbeddedWalletAbortController:vve,UniversalProviderErrors:{UNAUTHORIZED_DOMAIN_NOT_ALLOWED:{message:"Unauthorized: origin not allowed",alertErrorKey:"INVALID_APP_CONFIGURATION"},JWT_VALIDATION_ERROR:{message:"JWT validation error: JWT Token is not yet valid",alertErrorKey:"JWT_TOKEN_NOT_VALID"},INVALID_KEY:{message:"Unauthorized: invalid key",alertErrorKey:"INVALID_PROJECT_ID"}},ALERT_ERRORS:{SWITCH_NETWORK_NOT_FOUND:{shortMessage:"Network Not Found",longMessage:"Network not found - please make sure it is included in 'networks' array in createAppKit function"},INVALID_APP_CONFIGURATION:{shortMessage:"Invalid App Configuration",longMessage:()=>`Origin ${_ve()?window.origin:"unknown"} not found on Allowlist - update configuration on cloud.reown.com`},IFRAME_LOAD_FAILED:{shortMessage:"Network Error - Could not load embedded wallet",longMessage:()=>"There was an issue loading the embedded wallet. Please try again later."},IFRAME_REQUEST_TIMEOUT:{shortMessage:"Embedded Wallet Request Timed Out",longMessage:()=>"There was an issue doing the request to the embedded wallet. Please try again later."},UNVERIFIED_DOMAIN:{shortMessage:"Invalid App Configuration",longMessage:()=>"There was an issue loading the embedded wallet. Please verify that your domain is allowed at cloud.reown.com"},JWT_TOKEN_NOT_VALID:{shortMessage:"Session Expired",longMessage:"Invalid session found on UniversalProvider - please check your time settings and connect again"},INVALID_PROJECT_ID:{shortMessage:"Invalid App Configuration",longMessage:"Invalid Project ID - update configuration"},PROJECT_ID_NOT_CONFIGURED:{shortMessage:"Project ID Not Configured",longMessage:"Project ID Not Configured - update configuration on cloud.reown.com"}}};function _ve(){return typeof window<"u"}const Eve={createLogger(t,e="error"){const r=Xm({level:e}),{logger:n}=N9({opts:r});return n.error=(...i)=>{for(const s of i)if(s instanceof Error){t(s,...i);return}t(void 0,...i)},n}},Cve="rpc.walletconnect.org";function fj(t,e){const r=new URL("https://rpc.walletconnect.org/v1/");return r.searchParams.set("chainId",t),r.searchParams.set("projectId",e),r.toString()}const sS=["near:mainnet","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","eip155:1101","eip155:56","eip155:42161","eip155:7777777","eip155:59144","eip155:324","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1","eip155:5000","solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz","eip155:80084","eip155:5003","eip155:100","eip155:8453","eip155:42220","eip155:1313161555","eip155:17000","eip155:1","eip155:300","eip155:1313161554","eip155:1329","eip155:84532","eip155:421614","eip155:11155111","eip155:8217","eip155:43114","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","eip155:999999999","eip155:11155420","eip155:80002","eip155:97","eip155:43113","eip155:137","eip155:10","eip155:1301","bip122:000000000019d6689c085ae165831e93","bip122:000000000933ea01ad0ee984209779ba"],M0={extendRpcUrlWithProjectId(t,e){let r=!1;try{r=new URL(t).host===Cve}catch{r=!1}if(r){const n=new URL(t);return n.searchParams.has("projectId")||n.searchParams.set("projectId",e),n.toString()}return t},isCaipNetwork(t){return"chainNamespace"in t&&"caipNetworkId"in t},getChainNamespace(t){return this.isCaipNetwork(t)?t.chainNamespace:_e.CHAIN.EVM},getCaipNetworkId(t){return this.isCaipNetwork(t)?t.caipNetworkId:`${_e.CHAIN.EVM}:${t.id}`},getDefaultRpcUrl(t,e,r){var i,s,o;const n=(o=(s=(i=t.rpcUrls)==null?void 0:i.default)==null?void 0:s.http)==null?void 0:o[0];return sS.includes(e)?fj(e,r):n||""},extendCaipNetwork(t,{customNetworkImageUrls:e,projectId:r,customRpcUrls:n}){var h,f,g,p,m;const i=this.getChainNamespace(t),s=this.getCaipNetworkId(t),o=(h=t.rpcUrls.default.http)==null?void 0:h[0],a=this.getDefaultRpcUrl(t,s,r),c=((p=(g=(f=t==null?void 0:t.rpcUrls)==null?void 0:f.chainDefault)==null?void 0:g.http)==null?void 0:p[0])||o,u=((m=n==null?void 0:n[s])==null?void 0:m.map(b=>b.url))||[],l=[...u,a],d=[...u];return c&&!d.includes(c)&&d.push(c),{...t,chainNamespace:i,caipNetworkId:s,assets:{imageId:Ua.NetworkImageIds[t.id],imageUrl:e==null?void 0:e[t.id]},rpcUrls:{...t.rpcUrls,default:{http:l},chainDefault:{http:d}}}},extendCaipNetworks(t,{customNetworkImageUrls:e,projectId:r,customRpcUrls:n}){return t.map(i=>M0.extendCaipNetwork(i,{customNetworkImageUrls:e,customRpcUrls:n,projectId:r}))},getViemTransport(t,e,r){var i,s,o;const n=[];return r==null||r.forEach(a=>{n.push(J2(a.url,a.config))}),sS.includes(t.caipNetworkId)&&n.push(J2(fj(t.caipNetworkId,e),{fetchOptions:{headers:{"Content-Type":"text/plain"}}})),(o=(s=(i=t==null?void 0:t.rpcUrls)==null?void 0:i.default)==null?void 0:s.http)==null||o.forEach(a=>{n.push(J2(a))}),rk(n)},extendWagmiTransports(t,e,r){if(sS.includes(t.caipNetworkId)){const n=this.getDefaultRpcUrl(t,t.caipNetworkId,e);return rk([r,J2(n)])}return r},getUnsupportedNetwork(t){return{id:t.split(":")[1],caipNetworkId:t,name:_e.UNSUPPORTED_NETWORK_NAME,chainNamespace:t.split(":")[0],nativeCurrency:{name:"",decimals:0,symbol:""},rpcUrls:{default:{http:[]}}}},getCaipNetworkFromStorage(t){var c;const e=Le.getActiveCaipNetworkId(),r=F.getAllRequestedCaipNetworks(),n=Array.from(((c=F.state.chains)==null?void 0:c.keys())||[]),i=e==null?void 0:e.split(":")[0],s=i?n.includes(i):!1,o=r==null?void 0:r.find(u=>u.caipNetworkId===e);return s&&!o&&e?this.getUnsupportedNetwork(e):o||t||(r==null?void 0:r[0])}},PC={eip155:void 0,solana:void 0,polkadot:void 0,bip122:void 0,cosmos:void 0},Mi=rr({providers:{...PC},providerIds:{...PC}}),kt={state:Mi,subscribeKey(t,e){return dn(Mi,t,e)},subscribe(t){return ln(Mi,()=>{t(Mi)})},subscribeProviders(t){return ln(Mi.providers,()=>t(Mi.providers))},setProvider(t,e){e&&(Mi.providers[t]=Nf(e))},getProvider(t){return Mi.providers[t]},setProviderId(t,e){e&&(Mi.providerIds[t]=e)},getProviderId(t){if(t)return Mi.providerIds[t]},reset(){Mi.providers={...PC},Mi.providerIds={...PC}},resetChain(t){Mi.providers[t]=void 0,Mi.providerIds[t]=void 0}},pj={transactionHash:/^0x(?:[A-Fa-f0-9]{64})$/u,signedMessage:/^0x(?:[a-fA-F0-9]{62,})$/u},Bn={set(t,e){ei.isClient&&localStorage.setItem(`${Ye.STORAGE_KEY}${t}`,e)},get(t){return ei.isClient?localStorage.getItem(`${Ye.STORAGE_KEY}${t}`):null},delete(t,e){ei.isClient&&(e?localStorage.removeItem(t):localStorage.removeItem(`${Ye.STORAGE_KEY}${t}`))}},w3=30*1e3,ei={checkIfAllowedToTriggerEmail(){const t=Bn.get(Ye.LAST_EMAIL_LOGIN_TIME);if(t){const e=Date.now()-Number(t);if(e<w3){const r=Math.ceil((w3-e)/1e3);throw new Error(`Please try again after ${r} seconds`)}}},getTimeToNextEmailLogin(){const t=Bn.get(Ye.LAST_EMAIL_LOGIN_TIME);if(t){const e=Date.now()-Number(t);if(e<w3)return Math.ceil((w3-e)/1e3)}return 0},checkIfRequestExists(t){return bt.NOT_SAFE_RPC_METHODS.includes(t.method)||bt.SAFE_RPC_METHODS.includes(t.method)},getResponseType(t){return typeof t=="string"&&((t==null?void 0:t.match(pj.transactionHash))||(t==null?void 0:t.match(pj.signedMessage)))?Ye.RPC_RESPONSE_TYPE_TX:Ye.RPC_RESPONSE_TYPE_OBJECT},checkIfRequestIsSafe(t){return bt.SAFE_RPC_METHODS.includes(t.method)},isClient:typeof window<"u"};var qt;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(qt||(qt={}));var WI;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(WI||(WI={}));const qe=qt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ll=t=>{switch(typeof t){case"undefined":return qe.undefined;case"string":return qe.string;case"number":return isNaN(t)?qe.nan:qe.number;case"boolean":return qe.boolean;case"function":return qe.function;case"bigint":return qe.bigint;case"symbol":return qe.symbol;case"object":return Array.isArray(t)?qe.array:t===null?qe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?qe.promise:typeof Map<"u"&&t instanceof Map?qe.map:typeof Set<"u"&&t instanceof Set?qe.set:typeof Date<"u"&&t instanceof Date?qe.date:qe.object;default:return qe.unknown}},$e=qt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ave=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ho extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,qt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ho.create=t=>new Ho(t);const oy=(t,e)=>{let r;switch(t.code){case $e.invalid_type:t.received===qe.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case $e.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,qt.jsonStringifyReplacer)}`;break;case $e.unrecognized_keys:r=`Unrecognized key(s) in object: ${qt.joinValues(t.keys,", ")}`;break;case $e.invalid_union:r="Invalid input";break;case $e.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${qt.joinValues(t.options)}`;break;case $e.invalid_enum_value:r=`Invalid enum value. Expected ${qt.joinValues(t.options)}, received '${t.received}'`;break;case $e.invalid_arguments:r="Invalid function arguments";break;case $e.invalid_return_type:r="Invalid function return type";break;case $e.invalid_date:r="Invalid date";break;case $e.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:qt.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case $e.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case $e.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case $e.custom:r="Invalid input";break;case $e.invalid_intersection_types:r="Intersection results could not be merged";break;case $e.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case $e.not_finite:r="Number must be finite";break;default:r=e.defaultError,qt.assertNever(t)}return{message:r}};let EZ=oy;function xve(t){EZ=t}function OC(){return EZ}const RC=t=>{const{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s};let a="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)a=u(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},Sve=[];function Ke(t,e){const r=RC({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,OC(),oy].filter(n=>!!n)});t.common.issues.push(r)}class ni{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const i of r){if(i.status==="aborted")return gt;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const i of r)n.push({key:await i.key,value:await i.value});return ni.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const i of r){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return gt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}}const gt=Object.freeze({status:"aborted"}),CZ=t=>({status:"dirty",value:t}),Ai=t=>({status:"valid",value:t}),VI=t=>t.status==="aborted",GI=t=>t.status==="dirty",ay=t=>t.status==="valid",kC=t=>typeof Promise<"u"&&t instanceof Promise;var ot;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ot||(ot={}));class Qa{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const gj=(t,e)=>{if(ay(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ho(t.common.issues);return this._error=r,this._error}}};function yt(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n??a.defaultError}:{message:r??a.defaultError},description:i}}class St{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Ll(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ll(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ni,ctx:{common:e.parent.common,data:e.data,parsedType:Ll(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(kC(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;const i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ll(e)},s=this._parseSync({data:e,path:i.path,parent:i});return gj(i,s)}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ll(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(kC(i)?i:Promise.resolve(i));return gj(n,s)}refine(e,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:$e.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new zo({schema:this,typeName:lt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Au.create(this,this._def)}nullable(){return qf.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qo.create(this,this._def)}promise(){return vm.create(this,this._def)}or(e){return dy.create([this,e],this._def)}and(e){return hy.create(this,e,this._def)}transform(e){return new zo({...yt(this._def),schema:this,typeName:lt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new wy({...yt(this._def),innerType:this,defaultValue:r,typeName:lt.ZodDefault})}brand(){return new xZ({typeName:lt.ZodBranded,type:this,...yt(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new BC({...yt(this._def),innerType:this,catchValue:r,typeName:lt.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Fv.create(this,e)}readonly(){return MC.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Tve=/^c[^\s-]{8,}$/i,Ive=/^[a-z][a-z0-9]*$/,Pve=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ove=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Rve=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kve="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let oS;const Nve=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,$ve=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,jve=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Bve(t,e){return!!((e==="v4"||!e)&&Nve.test(t)||(e==="v6"||!e)&&$ve.test(t))}class Uo extends St{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==qe.string){const s=this._getOrReturnCtx(e);return Ke(s,{code:$e.invalid_type,expected:qe.string,received:s.parsedType}),gt}const n=new ni;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:$e.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:$e.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?Ke(i,{code:$e.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&Ke(i,{code:$e.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Rve.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"email",code:$e.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")oS||(oS=new RegExp(kve,"u")),oS.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"emoji",code:$e.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Ove.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"uuid",code:$e.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Tve.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"cuid",code:$e.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Ive.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"cuid2",code:$e.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Pve.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"ulid",code:$e.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Ke(i,{validation:"url",code:$e.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"regex",code:$e.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:$e.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:$e.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:$e.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?jve(s).test(e.data)||(i=this._getOrReturnCtx(e,i),Ke(i,{code:$e.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?Bve(e.data,s.version)||(i=this._getOrReturnCtx(e,i),Ke(i,{validation:"ip",code:$e.invalid_string,message:s.message}),n.dirty()):qt.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:$e.invalid_string,...ot.errToObj(n)})}_addCheck(e){return new Uo({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ot.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ot.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ot.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ot.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ot.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ot.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ot.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ot.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...ot.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ot.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...ot.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ot.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ot.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ot.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ot.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ot.errToObj(r)})}nonempty(e){return this.min(1,ot.errToObj(e))}trim(){return new Uo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Uo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Uo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Uo.create=t=>{var e;return new Uo({checks:[],typeName:lt.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...yt(t)})};function Dve(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class wd extends St{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==qe.number){const s=this._getOrReturnCtx(e);return Ke(s,{code:$e.invalid_type,expected:qe.number,received:s.parsedType}),gt}let n;const i=new ni;for(const s of this._def.checks)s.kind==="int"?qt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Ke(n,{code:$e.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:$e.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:$e.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Dve(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:$e.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Ke(n,{code:$e.not_finite,message:s.message}),i.dirty()):qt.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ot.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ot.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ot.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ot.toString(r))}setLimit(e,r,n,i){return new wd({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ot.toString(i)}]})}_addCheck(e){return new wd({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ot.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ot.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ot.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ot.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ot.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ot.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ot.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ot.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ot.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&qt.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}wd.create=t=>new wd({checks:[],typeName:lt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...yt(t)});class bd extends St{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==qe.bigint){const s=this._getOrReturnCtx(e);return Ke(s,{code:$e.invalid_type,expected:qe.bigint,received:s.parsedType}),gt}let n;const i=new ni;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:$e.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:$e.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Ke(n,{code:$e.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):qt.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ot.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ot.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ot.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ot.toString(r))}setLimit(e,r,n,i){return new bd({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ot.toString(i)}]})}_addCheck(e){return new bd({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ot.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ot.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ot.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ot.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ot.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}bd.create=t=>{var e;return new bd({checks:[],typeName:lt.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...yt(t)})};class cy extends St{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==qe.boolean){const n=this._getOrReturnCtx(e);return Ke(n,{code:$e.invalid_type,expected:qe.boolean,received:n.parsedType}),gt}return Ai(e.data)}}cy.create=t=>new cy({typeName:lt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...yt(t)});class Ff extends St{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==qe.date){const s=this._getOrReturnCtx(e);return Ke(s,{code:$e.invalid_type,expected:qe.date,received:s.parsedType}),gt}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Ke(s,{code:$e.invalid_date}),gt}const n=new ni;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:$e.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),Ke(i,{code:$e.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):qt.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ff({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ot.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ot.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Ff.create=t=>new Ff({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:lt.ZodDate,...yt(t)});class NC extends St{_parse(e){if(this._getType(e)!==qe.symbol){const n=this._getOrReturnCtx(e);return Ke(n,{code:$e.invalid_type,expected:qe.symbol,received:n.parsedType}),gt}return Ai(e.data)}}NC.create=t=>new NC({typeName:lt.ZodSymbol,...yt(t)});class uy extends St{_parse(e){if(this._getType(e)!==qe.undefined){const n=this._getOrReturnCtx(e);return Ke(n,{code:$e.invalid_type,expected:qe.undefined,received:n.parsedType}),gt}return Ai(e.data)}}uy.create=t=>new uy({typeName:lt.ZodUndefined,...yt(t)});class ly extends St{_parse(e){if(this._getType(e)!==qe.null){const n=this._getOrReturnCtx(e);return Ke(n,{code:$e.invalid_type,expected:qe.null,received:n.parsedType}),gt}return Ai(e.data)}}ly.create=t=>new ly({typeName:lt.ZodNull,...yt(t)});class ym extends St{constructor(){super(...arguments),this._any=!0}_parse(e){return Ai(e.data)}}ym.create=t=>new ym({typeName:lt.ZodAny,...yt(t)});class Pf extends St{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ai(e.data)}}Pf.create=t=>new Pf({typeName:lt.ZodUnknown,...yt(t)});class Pu extends St{_parse(e){const r=this._getOrReturnCtx(e);return Ke(r,{code:$e.invalid_type,expected:qe.never,received:r.parsedType}),gt}}Pu.create=t=>new Pu({typeName:lt.ZodNever,...yt(t)});class $C extends St{_parse(e){if(this._getType(e)!==qe.undefined){const n=this._getOrReturnCtx(e);return Ke(n,{code:$e.invalid_type,expected:qe.void,received:n.parsedType}),gt}return Ai(e.data)}}$C.create=t=>new $C({typeName:lt.ZodVoid,...yt(t)});class qo extends St{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==qe.array)return Ke(r,{code:$e.invalid_type,expected:qe.array,received:r.parsedType}),gt;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(Ke(r,{code:o?$e.too_big:$e.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Ke(r,{code:$e.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Ke(r,{code:$e.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new Qa(r,o,r.path,a)))).then(o=>ni.mergeArray(n,o));const s=[...r.data].map((o,a)=>i.type._parseSync(new Qa(r,o,r.path,a)));return ni.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new qo({...this._def,minLength:{value:e,message:ot.toString(r)}})}max(e,r){return new qo({...this._def,maxLength:{value:e,message:ot.toString(r)}})}length(e,r){return new qo({...this._def,exactLength:{value:e,message:ot.toString(r)}})}nonempty(e){return this.min(1,e)}}qo.create=(t,e)=>new qo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:lt.ZodArray,...yt(e)});function L0(t){if(t instanceof Mr){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Au.create(L0(n))}return new Mr({...t._def,shape:()=>e})}else return t instanceof qo?new qo({...t._def,type:L0(t.element)}):t instanceof Au?Au.create(L0(t.unwrap())):t instanceof qf?qf.create(L0(t.unwrap())):t instanceof Xa?Xa.create(t.items.map(e=>L0(e))):t}class Mr extends St{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=qt.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==qe.object){const u=this._getOrReturnCtx(e);return Ke(u,{code:$e.invalid_type,expected:qe.object,received:u.parsedType}),gt}const{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Pu&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||a.push(u);const c=[];for(const u of o){const l=s[u],d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Qa(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Pu){const u=this._def.unknownKeys;if(u==="passthrough")for(const l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(u==="strict")a.length>0&&(Ke(i,{code:$e.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const l of a){const d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Qa(i,d,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const l of c){const d=await l.key;u.push({key:d,value:await l.value,alwaysSet:l.alwaysSet})}return u}).then(u=>ni.mergeObjectSync(n,u)):ni.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return ot.errToObj,new Mr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;const c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=ot.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Mr({...this._def,unknownKeys:"strip"})}passthrough(){return new Mr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Mr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Mr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:lt.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Mr({...this._def,catchall:e})}pick(e){const r={};return qt.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Mr({...this._def,shape:()=>r})}omit(e){const r={};return qt.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Mr({...this._def,shape:()=>r})}deepPartial(){return L0(this)}partial(e){const r={};return qt.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new Mr({...this._def,shape:()=>r})}required(e){const r={};return qt.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Au;)s=s._def.innerType;r[n]=s}}),new Mr({...this._def,shape:()=>r})}keyof(){return AZ(qt.objectKeys(this.shape))}}Mr.create=(t,e)=>new Mr({shape:()=>t,unknownKeys:"strip",catchall:Pu.create(),typeName:lt.ZodObject,...yt(e)});Mr.strictCreate=(t,e)=>new Mr({shape:()=>t,unknownKeys:"strict",catchall:Pu.create(),typeName:lt.ZodObject,...yt(e)});Mr.lazycreate=(t,e)=>new Mr({shape:t,unknownKeys:"strip",catchall:Pu.create(),typeName:lt.ZodObject,...yt(e)});class dy extends St{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Ho(a.ctx.common.issues));return Ke(r,{code:$e.invalid_union,unionErrors:o}),gt}if(r.common.async)return Promise.all(n.map(async s=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new Ho(c));return Ke(r,{code:$e.invalid_union,unionErrors:a}),gt}}get options(){return this._def.options}}dy.create=(t,e)=>new dy({options:t,typeName:lt.ZodUnion,...yt(e)});const X4=t=>t instanceof py?X4(t.schema):t instanceof zo?X4(t.innerType()):t instanceof gy?[t.value]:t instanceof yd?t.options:t instanceof my?Object.keys(t.enum):t instanceof wy?X4(t._def.innerType):t instanceof uy?[void 0]:t instanceof ly?[null]:null;class cA extends St{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==qe.object)return Ke(r,{code:$e.invalid_type,expected:qe.object,received:r.parsedType}),gt;const n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(Ke(r,{code:$e.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),gt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const i=new Map;for(const s of r){const o=X4(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new cA({typeName:lt.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...yt(n)})}}function KI(t,e){const r=Ll(t),n=Ll(e);if(t===e)return{valid:!0,data:t};if(r===qe.object&&n===qe.object){const i=qt.objectKeys(e),s=qt.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const c=KI(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(r===qe.array&&n===qe.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const o=t[s],a=e[s],c=KI(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===qe.date&&n===qe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class hy extends St{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(VI(s)||VI(o))return gt;const a=KI(s.value,o.value);return a.valid?((GI(s)||GI(o))&&r.dirty(),{status:r.value,value:a.data}):(Ke(n,{code:$e.invalid_intersection_types}),gt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}hy.create=(t,e,r)=>new hy({left:t,right:e,typeName:lt.ZodIntersection,...yt(r)});class Xa extends St{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.array)return Ke(n,{code:$e.invalid_type,expected:qe.array,received:n.parsedType}),gt;if(n.data.length<this._def.items.length)return Ke(n,{code:$e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&n.data.length>this._def.items.length&&(Ke(n,{code:$e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Qa(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>ni.mergeArray(r,o)):ni.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Xa({...this._def,rest:e})}}Xa.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xa({items:t,typeName:lt.ZodTuple,rest:null,...yt(e)})};class fy extends St{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.object)return Ke(n,{code:$e.invalid_type,expected:qe.object,received:n.parsedType}),gt;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in n.data)i.push({key:s._parse(new Qa(n,a,n.path,a)),value:o._parse(new Qa(n,n.data[a],n.path,a))});return n.common.async?ni.mergeObjectAsync(r,i):ni.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof St?new fy({keyType:e,valueType:r,typeName:lt.ZodRecord,...yt(n)}):new fy({keyType:Uo.create(),valueType:e,typeName:lt.ZodRecord,...yt(r)})}}class jC extends St{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.map)return Ke(n,{code:$e.invalid_type,expected:qe.map,received:n.parsedType}),gt;const i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,c],u)=>({key:i._parse(new Qa(n,a,n.path,[u,"key"])),value:s._parse(new Qa(n,c,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return gt;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const c of o){const u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return gt;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}}jC.create=(t,e,r)=>new jC({valueType:e,keyType:t,typeName:lt.ZodMap,...yt(r)});class Hf extends St{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==qe.set)return Ke(n,{code:$e.invalid_type,expected:qe.set,received:n.parsedType}),gt;const i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Ke(n,{code:$e.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Ke(n,{code:$e.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const s=this._def.valueType;function o(c){const u=new Set;for(const l of c){if(l.status==="aborted")return gt;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}const a=[...n.data.values()].map((c,u)=>s._parse(new Qa(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,r){return new Hf({...this._def,minSize:{value:e,message:ot.toString(r)}})}max(e,r){return new Hf({...this._def,maxSize:{value:e,message:ot.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Hf.create=(t,e)=>new Hf({valueType:t,minSize:null,maxSize:null,typeName:lt.ZodSet,...yt(e)});class sg extends St{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==qe.function)return Ke(r,{code:$e.invalid_type,expected:qe.function,received:r.parsedType}),gt;function n(a,c){return RC({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,OC(),oy].filter(u=>!!u),issueData:{code:$e.invalid_arguments,argumentsError:c}})}function i(a,c){return RC({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,OC(),oy].filter(u=>!!u),issueData:{code:$e.invalid_return_type,returnTypeError:c}})}const s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof vm){const a=this;return Ai(async function(...c){const u=new Ho([]),l=await a._def.args.parseAsync(c,s).catch(f=>{throw u.addIssue(n(c,f)),u}),d=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw u.addIssue(i(d,f)),u})})}else{const a=this;return Ai(function(...c){const u=a._def.args.safeParse(c,s);if(!u.success)throw new Ho([n(c,u.error)]);const l=Reflect.apply(o,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new Ho([i(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new sg({...this._def,args:Xa.create(e).rest(Pf.create())})}returns(e){return new sg({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new sg({args:e||Xa.create([]).rest(Pf.create()),returns:r||Pf.create(),typeName:lt.ZodFunction,...yt(n)})}}class py extends St{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}py.create=(t,e)=>new py({getter:t,typeName:lt.ZodLazy,...yt(e)});class gy extends St{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return Ke(r,{received:r.data,code:$e.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:e.data}}get value(){return this._def.value}}gy.create=(t,e)=>new gy({value:t,typeName:lt.ZodLiteral,...yt(e)});function AZ(t,e){return new yd({values:t,typeName:lt.ZodEnum,...yt(e)})}class yd extends St{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return Ke(r,{expected:qt.joinValues(n),received:r.parsedType,code:$e.invalid_type}),gt}if(this._def.values.indexOf(e.data)===-1){const r=this._getOrReturnCtx(e),n=this._def.values;return Ke(r,{received:r.data,code:$e.invalid_enum_value,options:n}),gt}return Ai(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e){return yd.create(e)}exclude(e){return yd.create(this.options.filter(r=>!e.includes(r)))}}yd.create=AZ;class my extends St{_parse(e){const r=qt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==qe.string&&n.parsedType!==qe.number){const i=qt.objectValues(r);return Ke(n,{expected:qt.joinValues(i),received:n.parsedType,code:$e.invalid_type}),gt}if(r.indexOf(e.data)===-1){const i=qt.objectValues(r);return Ke(n,{received:n.data,code:$e.invalid_enum_value,options:i}),gt}return Ai(e.data)}get enum(){return this._def.values}}my.create=(t,e)=>new my({values:t,typeName:lt.ZodNativeEnum,...yt(e)});class vm extends St{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==qe.promise&&r.common.async===!1)return Ke(r,{code:$e.invalid_type,expected:qe.promise,received:r.parsedType}),gt;const n=r.parsedType===qe.promise?r.data:Promise.resolve(r.data);return Ai(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}vm.create=(t,e)=>new vm({type:t,typeName:lt.ZodPromise,...yt(e)});class zo extends St{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{Ke(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?gt:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?gt:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ay(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>ay(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);qt.assertNever(i)}}zo.create=(t,e,r)=>new zo({schema:t,typeName:lt.ZodEffects,effect:e,...yt(r)});zo.createWithPreprocess=(t,e,r)=>new zo({schema:e,effect:{type:"preprocess",transform:t},typeName:lt.ZodEffects,...yt(r)});class Au extends St{_parse(e){return this._getType(e)===qe.undefined?Ai(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Au.create=(t,e)=>new Au({innerType:t,typeName:lt.ZodOptional,...yt(e)});class qf extends St{_parse(e){return this._getType(e)===qe.null?Ai(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}qf.create=(t,e)=>new qf({innerType:t,typeName:lt.ZodNullable,...yt(e)});class wy extends St{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===qe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}wy.create=(t,e)=>new wy({innerType:t,typeName:lt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...yt(e)});class BC extends St{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return kC(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ho(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ho(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}BC.create=(t,e)=>new BC({innerType:t,typeName:lt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...yt(e)});class DC extends St{_parse(e){if(this._getType(e)!==qe.nan){const n=this._getOrReturnCtx(e);return Ke(n,{code:$e.invalid_type,expected:qe.nan,received:n.parsedType}),gt}return{status:"valid",value:e.data}}}DC.create=t=>new DC({typeName:lt.ZodNaN,...yt(t)});const Mve=Symbol("zod_brand");class xZ extends St{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Fv extends St{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?gt:s.status==="dirty"?(r.dirty(),CZ(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?gt:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new Fv({in:e,out:r,typeName:lt.ZodPipeline})}}class MC extends St{_parse(e){const r=this._def.innerType._parse(e);return ay(r)&&(r.value=Object.freeze(r.value)),r}}MC.create=(t,e)=>new MC({innerType:t,typeName:lt.ZodReadonly,...yt(e)});const SZ=(t,e={},r)=>t?ym.create().superRefine((n,i)=>{var s,o;if(!t(n)){const a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:c})}}):ym.create(),Lve={object:Mr.lazycreate};var lt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(lt||(lt={}));const Uve=(t,e={message:`Input not instance of ${t.name}`})=>SZ(r=>r instanceof t,e),TZ=Uo.create,IZ=wd.create,Fve=DC.create,Hve=bd.create,PZ=cy.create,qve=Ff.create,zve=NC.create,Wve=uy.create,Vve=ly.create,Gve=ym.create,Kve=Pf.create,Zve=Pu.create,Yve=$C.create,Jve=qo.create,Qve=Mr.create,Xve=Mr.strictCreate,e2e=dy.create,t2e=cA.create,r2e=hy.create,n2e=Xa.create,i2e=fy.create,s2e=jC.create,o2e=Hf.create,a2e=sg.create,c2e=py.create,u2e=gy.create,l2e=yd.create,d2e=my.create,h2e=vm.create,mj=zo.create,f2e=Au.create,p2e=qf.create,g2e=zo.createWithPreprocess,m2e=Fv.create,w2e=()=>TZ().optional(),b2e=()=>IZ().optional(),y2e=()=>PZ().optional(),v2e={string:t=>Uo.create({...t,coerce:!0}),number:t=>wd.create({...t,coerce:!0}),boolean:t=>cy.create({...t,coerce:!0}),bigint:t=>bd.create({...t,coerce:!0}),date:t=>Ff.create({...t,coerce:!0})},_2e=gt;var V=Object.freeze({__proto__:null,defaultErrorMap:oy,setErrorMap:xve,getErrorMap:OC,makeIssue:RC,EMPTY_PATH:Sve,addIssueToContext:Ke,ParseStatus:ni,INVALID:gt,DIRTY:CZ,OK:Ai,isAborted:VI,isDirty:GI,isValid:ay,isAsync:kC,get util(){return qt},get objectUtil(){return WI},ZodParsedType:qe,getParsedType:Ll,ZodType:St,ZodString:Uo,ZodNumber:wd,ZodBigInt:bd,ZodBoolean:cy,ZodDate:Ff,ZodSymbol:NC,ZodUndefined:uy,ZodNull:ly,ZodAny:ym,ZodUnknown:Pf,ZodNever:Pu,ZodVoid:$C,ZodArray:qo,ZodObject:Mr,ZodUnion:dy,ZodDiscriminatedUnion:cA,ZodIntersection:hy,ZodTuple:Xa,ZodRecord:fy,ZodMap:jC,ZodSet:Hf,ZodFunction:sg,ZodLazy:py,ZodLiteral:gy,ZodEnum:yd,ZodNativeEnum:my,ZodPromise:vm,ZodEffects:zo,ZodTransformer:zo,ZodOptional:Au,ZodNullable:qf,ZodDefault:wy,ZodCatch:BC,ZodNaN:DC,BRAND:Mve,ZodBranded:xZ,ZodPipeline:Fv,ZodReadonly:MC,custom:SZ,Schema:St,ZodSchema:St,late:Lve,get ZodFirstPartyTypeKind(){return lt},coerce:v2e,any:Gve,array:Jve,bigint:Hve,boolean:PZ,date:qve,discriminatedUnion:t2e,effect:mj,enum:l2e,function:a2e,instanceof:Uve,intersection:r2e,lazy:c2e,literal:u2e,map:s2e,nan:Fve,nativeEnum:d2e,never:Zve,null:Vve,nullable:p2e,number:IZ,object:Qve,oboolean:y2e,onumber:b2e,optional:f2e,ostring:w2e,pipeline:m2e,preprocess:g2e,promise:h2e,record:i2e,set:o2e,strictObject:Xve,string:TZ,symbol:zve,transformer:mj,tuple:n2e,undefined:Wve,union:e2e,unknown:Kve,void:Yve,NEVER:_2e,ZodIssueCode:$e,quotelessJson:Ave,ZodError:Ho});const Ur=V.object({message:V.string()});function Ve(t){return V.literal(Ye[t])}V.object({accessList:V.array(V.string()),blockHash:V.string().nullable(),blockNumber:V.string().nullable(),chainId:V.string().or(V.number()),from:V.string(),gas:V.string(),hash:V.string(),input:V.string().nullable(),maxFeePerGas:V.string(),maxPriorityFeePerGas:V.string(),nonce:V.string(),r:V.string(),s:V.string(),to:V.string(),transactionIndex:V.string().nullable(),type:V.string(),v:V.string(),value:V.string()});const E2e=V.object({chainId:V.string().or(V.number())}),C2e=V.object({email:V.string().email()}),A2e=V.object({otp:V.string()}),x2e=V.object({uri:V.string(),preferredAccountType:V.optional(V.string()),chainId:V.optional(V.string().or(V.number()))}),S2e=V.object({chainId:V.optional(V.string().or(V.number())),preferredAccountType:V.optional(V.string()),socialUri:V.optional(V.string())}),T2e=V.object({provider:V.enum(["google","github","apple","facebook","x","discord"])}),I2e=V.object({email:V.string().email()}),P2e=V.object({otp:V.string()}),O2e=V.object({otp:V.string()}),R2e=V.object({themeMode:V.optional(V.enum(["light","dark"])),themeVariables:V.optional(V.record(V.string(),V.string().or(V.number()))),w3mThemeVariables:V.optional(V.record(V.string(),V.string()))}),k2e=V.object({metadata:V.object({name:V.string(),description:V.string(),url:V.string(),icons:V.array(V.string())}).optional(),sdkVersion:V.string().optional(),sdkType:V.string().optional(),projectId:V.string()}),N2e=V.object({type:V.string()}),$2e=V.object({action:V.enum(["VERIFY_DEVICE","VERIFY_OTP","CONNECT"])}),j2e=V.object({url:V.string()}),B2e=V.object({userName:V.string()}),D2e=V.object({email:V.string().optional().nullable(),address:V.string(),chainId:V.string().or(V.number()),accounts:V.array(V.object({address:V.string(),type:V.enum([bt.ACCOUNT_TYPES.EOA,bt.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),userName:V.string().optional().nullable(),preferredAccountType:V.optional(V.string())}),M2e=V.object({action:V.enum(["VERIFY_PRIMARY_OTP","VERIFY_SECONDARY_OTP"])}),L2e=V.object({email:V.string().email().optional().nullable(),address:V.string(),chainId:V.string().or(V.number()),smartAccountDeployed:V.optional(V.boolean()),accounts:V.array(V.object({address:V.string(),type:V.enum([bt.ACCOUNT_TYPES.EOA,bt.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),preferredAccountType:V.optional(V.string())}),U2e=V.object({uri:V.string()}),F2e=V.object({isConnected:V.boolean()}),H2e=V.object({chainId:V.string().or(V.number())}),q2e=V.object({chainId:V.string().or(V.number())}),z2e=V.object({newEmail:V.string().email()}),W2e=V.object({smartAccountEnabledNetworks:V.array(V.number())});V.object({address:V.string(),isDeployed:V.boolean()});const V2e=V.object({version:V.string().optional()}),G2e=V.object({type:V.string(),address:V.string()}),K2e=V.any(),Z2e=V.object({method:V.literal("eth_accounts")}),Y2e=V.object({method:V.literal("eth_blockNumber")}),J2e=V.object({method:V.literal("eth_call"),params:V.array(V.any())}),Q2e=V.object({method:V.literal("eth_chainId")}),X2e=V.object({method:V.literal("eth_estimateGas"),params:V.array(V.any())}),e3e=V.object({method:V.literal("eth_feeHistory"),params:V.array(V.any())}),t3e=V.object({method:V.literal("eth_gasPrice")}),r3e=V.object({method:V.literal("eth_getAccount"),params:V.array(V.any())}),n3e=V.object({method:V.literal("eth_getBalance"),params:V.array(V.any())}),i3e=V.object({method:V.literal("eth_getBlockByHash"),params:V.array(V.any())}),s3e=V.object({method:V.literal("eth_getBlockByNumber"),params:V.array(V.any())}),o3e=V.object({method:V.literal("eth_getBlockReceipts"),params:V.array(V.any())}),a3e=V.object({method:V.literal("eth_getBlockTransactionCountByHash"),params:V.array(V.any())}),c3e=V.object({method:V.literal("eth_getBlockTransactionCountByNumber"),params:V.array(V.any())}),u3e=V.object({method:V.literal("eth_getCode"),params:V.array(V.any())}),l3e=V.object({method:V.literal("eth_getFilterChanges"),params:V.array(V.any())}),d3e=V.object({method:V.literal("eth_getFilterLogs"),params:V.array(V.any())}),h3e=V.object({method:V.literal("eth_getLogs"),params:V.array(V.any())}),f3e=V.object({method:V.literal("eth_getProof"),params:V.array(V.any())}),p3e=V.object({method:V.literal("eth_getStorageAt"),params:V.array(V.any())}),g3e=V.object({method:V.literal("eth_getTransactionByBlockHashAndIndex"),params:V.array(V.any())}),m3e=V.object({method:V.literal("eth_getTransactionByBlockNumberAndIndex"),params:V.array(V.any())}),w3e=V.object({method:V.literal("eth_getTransactionByHash"),params:V.array(V.any())}),b3e=V.object({method:V.literal("eth_getTransactionCount"),params:V.array(V.any())}),y3e=V.object({method:V.literal("eth_getTransactionReceipt"),params:V.array(V.any())}),v3e=V.object({method:V.literal("eth_getUncleCountByBlockHash"),params:V.array(V.any())}),_3e=V.object({method:V.literal("eth_getUncleCountByBlockNumber"),params:V.array(V.any())}),E3e=V.object({method:V.literal("eth_maxPriorityFeePerGas")}),C3e=V.object({method:V.literal("eth_newBlockFilter")}),A3e=V.object({method:V.literal("eth_newFilter"),params:V.array(V.any())}),x3e=V.object({method:V.literal("eth_newPendingTransactionFilter")}),S3e=V.object({method:V.literal("eth_sendRawTransaction"),params:V.array(V.any())}),T3e=V.object({method:V.literal("eth_syncing"),params:V.array(V.any())}),I3e=V.object({method:V.literal("eth_uninstallFilter"),params:V.array(V.any())}),wj=V.object({method:V.literal("personal_sign"),params:V.array(V.any())}),P3e=V.object({method:V.literal("eth_signTypedData_v4"),params:V.array(V.any())}),O3e=V.object({method:V.literal("eth_sendTransaction"),params:V.array(V.any())}),R3e=V.object({method:V.literal("solana_signMessage"),params:V.object({message:V.string(),pubkey:V.string()})}),k3e=V.object({method:V.literal("solana_signTransaction"),params:V.object({transaction:V.string()})}),N3e=V.object({method:V.literal("solana_signAllTransactions"),params:V.object({transactions:V.array(V.string())})}),$3e=V.object({method:V.literal("solana_signAndSendTransaction"),params:V.object({transaction:V.string(),options:V.object({skipPreflight:V.boolean().optional(),preflightCommitment:V.enum(["processed","confirmed","finalized","recent","single","singleGossip","root","max"]).optional(),maxRetries:V.number().optional(),minContextSlot:V.number().optional()}).optional()})}),j3e=V.object({method:V.literal("wallet_sendCalls"),params:V.array(V.object({chainId:V.string().or(V.number()).optional(),from:V.string().optional(),version:V.string().optional(),capabilities:V.any().optional(),calls:V.array(V.object({to:V.string().startsWith("0x"),data:V.string().startsWith("0x").optional(),value:V.string().optional()}))}))}),B3e=V.object({method:V.literal("wallet_getCallsStatus"),params:V.array(V.string())}),D3e=V.object({method:V.literal("wallet_getCapabilities")}),M3e=V.object({method:V.literal("wallet_grantPermissions"),params:V.array(V.any())}),L3e=V.object({method:V.literal("wallet_revokePermissions"),params:V.any()}),U3e=V.object({method:V.literal("wallet_getAssets"),params:V.any()}),bj=V.object({token:V.string()}),Ge=V.object({id:V.string().optional()}),G1={appEvent:Ge.extend({type:Ve("APP_SWITCH_NETWORK"),payload:E2e}).or(Ge.extend({type:Ve("APP_CONNECT_EMAIL"),payload:C2e})).or(Ge.extend({type:Ve("APP_CONNECT_DEVICE")})).or(Ge.extend({type:Ve("APP_CONNECT_OTP"),payload:A2e})).or(Ge.extend({type:Ve("APP_CONNECT_SOCIAL"),payload:x2e})).or(Ge.extend({type:Ve("APP_GET_FARCASTER_URI")})).or(Ge.extend({type:Ve("APP_CONNECT_FARCASTER")})).or(Ge.extend({type:Ve("APP_GET_USER"),payload:V.optional(S2e)})).or(Ge.extend({type:Ve("APP_GET_SOCIAL_REDIRECT_URI"),payload:T2e})).or(Ge.extend({type:Ve("APP_SIGN_OUT")})).or(Ge.extend({type:Ve("APP_IS_CONNECTED"),payload:V.optional(bj)})).or(Ge.extend({type:Ve("APP_GET_CHAIN_ID")})).or(Ge.extend({type:Ve("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or(Ge.extend({type:Ve("APP_INIT_SMART_ACCOUNT")})).or(Ge.extend({type:Ve("APP_SET_PREFERRED_ACCOUNT"),payload:N2e})).or(Ge.extend({type:Ve("APP_RPC_REQUEST"),payload:wj.or(U3e).or(Z2e).or(Y2e).or(J2e).or(Q2e).or(X2e).or(e3e).or(t3e).or(r3e).or(n3e).or(i3e).or(s3e).or(o3e).or(a3e).or(c3e).or(u3e).or(l3e).or(d3e).or(h3e).or(f3e).or(p3e).or(g3e).or(m3e).or(w3e).or(b3e).or(y3e).or(v3e).or(_3e).or(E3e).or(C3e).or(A3e).or(x3e).or(S3e).or(T3e).or(I3e).or(wj).or(P3e).or(O3e).or(R3e).or(k3e).or(N3e).or($3e).or(B3e).or(j3e).or(D3e).or(M3e).or(L3e)})).or(Ge.extend({type:Ve("APP_UPDATE_EMAIL"),payload:I2e})).or(Ge.extend({type:Ve("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:P2e})).or(Ge.extend({type:Ve("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:O2e})).or(Ge.extend({type:Ve("APP_SYNC_THEME"),payload:R2e})).or(Ge.extend({type:Ve("APP_SYNC_DAPP_DATA"),payload:k2e})).or(Ge.extend({type:Ve("APP_RELOAD")})),frameEvent:Ge.extend({type:Ve("FRAME_SWITCH_NETWORK_ERROR"),payload:Ur}).or(Ge.extend({type:Ve("FRAME_SWITCH_NETWORK_SUCCESS"),payload:q2e})).or(Ge.extend({type:Ve("FRAME_CONNECT_EMAIL_SUCCESS"),payload:$2e})).or(Ge.extend({type:Ve("FRAME_CONNECT_EMAIL_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_GET_FARCASTER_URI_SUCCESS"),payload:j2e})).or(Ge.extend({type:Ve("FRAME_GET_FARCASTER_URI_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_CONNECT_FARCASTER_SUCCESS"),payload:B2e})).or(Ge.extend({type:Ve("FRAME_CONNECT_FARCASTER_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_CONNECT_OTP_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_CONNECT_OTP_SUCCESS")})).or(Ge.extend({type:Ve("FRAME_CONNECT_DEVICE_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_CONNECT_DEVICE_SUCCESS")})).or(Ge.extend({type:Ve("FRAME_CONNECT_SOCIAL_SUCCESS"),payload:D2e})).or(Ge.extend({type:Ve("FRAME_CONNECT_SOCIAL_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_GET_USER_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_GET_USER_SUCCESS"),payload:L2e})).or(Ge.extend({type:Ve("FRAME_GET_SOCIAL_REDIRECT_URI_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS"),payload:U2e})).or(Ge.extend({type:Ve("FRAME_SIGN_OUT_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_SIGN_OUT_SUCCESS")})).or(Ge.extend({type:Ve("FRAME_IS_CONNECTED_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_IS_CONNECTED_SUCCESS"),payload:F2e})).or(Ge.extend({type:Ve("FRAME_GET_CHAIN_ID_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_GET_CHAIN_ID_SUCCESS"),payload:H2e})).or(Ge.extend({type:Ve("FRAME_RPC_REQUEST_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_RPC_REQUEST_SUCCESS"),payload:K2e})).or(Ge.extend({type:Ve("FRAME_SESSION_UPDATE"),payload:bj})).or(Ge.extend({type:Ve("FRAME_UPDATE_EMAIL_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_UPDATE_EMAIL_SUCCESS"),payload:M2e})).or(Ge.extend({type:Ve("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or(Ge.extend({type:Ve("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:z2e})).or(Ge.extend({type:Ve("FRAME_SYNC_THEME_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_SYNC_THEME_SUCCESS")})).or(Ge.extend({type:Ve("FRAME_SYNC_DAPP_DATA_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or(Ge.extend({type:Ve("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:W2e})).or(Ge.extend({type:Ve("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:G2e})).or(Ge.extend({type:Ve("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_READY"),payload:V2e})).or(Ge.extend({type:Ve("FRAME_RELOAD_ERROR"),payload:Ur})).or(Ge.extend({type:Ve("FRAME_RELOAD_SUCCESS")}))};function aS(t,e={}){var r;return typeof(e==null?void 0:e.type)=="string"&&((r=e==null?void 0:e.type)==null?void 0:r.includes(t))}class F3e{constructor({projectId:e,isAppClient:r=!1,chainId:n="eip155:1",enableLogger:i=!0}){if(this.iframe=null,this.iframeIsReady=!1,this.rpcUrl=_e.BLOCKCHAIN_API_RPC_URL,this.initFrame=()=>{const s=document.getElementById("w3m-iframe");this.iframe&&!s&&document.body.appendChild(this.iframe)},this.events={registerFrameEventHandler:(s,o,a)=>{function c({data:u}){if(!aS(Ye.FRAME_EVENT_KEY,u))return;const l=G1.frameEvent.parse(u);l.id===s&&(o(l),window.removeEventListener("message",c))}ei.isClient&&(window.addEventListener("message",c),a.addEventListener("abort",()=>{window.removeEventListener("message",c)}))},onFrameEvent:s=>{ei.isClient&&window.addEventListener("message",({data:o})=>{if(!aS(Ye.FRAME_EVENT_KEY,o))return;const a=G1.frameEvent.parse(o);s(a)})},onAppEvent:s=>{ei.isClient&&window.addEventListener("message",({data:o})=>{if(!aS(Ye.APP_EVENT_KEY,o))return;const a=G1.appEvent.parse(o);s(a)})},postAppEvent:s=>{var o;if(ei.isClient){if(!((o=this.iframe)!=null&&o.contentWindow))throw new Error("W3mFrame: iframe is not set");G1.appEvent.parse(s),this.iframe.contentWindow.postMessage(s,"*")}},postFrameEvent:s=>{if(ei.isClient){if(!parent)throw new Error("W3mFrame: parent is not set");G1.frameEvent.parse(s),parent.postMessage(s,"*")}}},this.projectId=e,this.frameLoadPromise=new Promise((s,o)=>{this.frameLoadPromiseResolver={resolve:s,reject:o}}),r&&(this.frameLoadPromise=new Promise((s,o)=>{this.frameLoadPromiseResolver={resolve:s,reject:o}}),ei.isClient)){const s=document.createElement("iframe");s.id="w3m-iframe",s.src=`${Zne}?projectId=${e}&chainId=${n}&version=${Jne}&enableLogger=${i}`,s.name="w3m-secure-iframe",s.style.position="fixed",s.style.zIndex="999999",s.style.display="none",s.style.border="none",s.style.animationDelay="0s, 50ms",s.style.borderBottomLeftRadius="clamp(0px, var(--wui-border-radius-l), 44px)",s.style.borderBottomRightRadius="clamp(0px, var(--wui-border-radius-l), 44px)",this.iframe=s,this.iframe.onerror=()=>{var o;(o=this.frameLoadPromiseResolver)==null||o.reject("Unable to load email login dependency")},this.events.onFrameEvent(o=>{var a;o.type==="@w3m-frame/READY"&&(this.iframeIsReady=!0,(a=this.frameLoadPromiseResolver)==null||a.resolve(void 0))})}}get networks(){const e=["eip155:1","eip155:5","eip155:11155111","eip155:10","eip155:420","eip155:42161","eip155:421613","eip155:137","eip155:80001","eip155:42220","eip155:1313161554","eip155:1313161555","eip155:56","eip155:97","eip155:43114","eip155:43113","eip155:324","eip155:280","eip155:100","eip155:8453","eip155:84531","eip155:84532","eip155:7777777","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"].map(r=>({[r]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=${r}&projectId=${this.projectId}`,chainId:r}}));return Object.assign({},...e)}}class H3e{constructor(e){var s;const r=Xm({level:Yne}),{logger:n,chunkLoggerController:i}=N9({opts:r});this.logger=si(n,this.constructor.name),this.chunkLoggerController=i,typeof window<"u"&&((s=this.chunkLoggerController)!=null&&s.downloadLogsBlobInBrowser)&&(window.downloadAppKitLogsBlob||(window.downloadAppKitLogsBlob={}),window.downloadAppKitLogsBlob.sdk=()=>{var o;(o=this.chunkLoggerController)!=null&&o.downloadLogsBlobInBrowser&&this.chunkLoggerController.downloadLogsBlobInBrowser({projectId:e})})}}class s7{constructor({projectId:e,chainId:r,enableLogger:n=!0,onTimeout:i,abortController:s}){this.openRpcRequests=[],this.isInitialized=!1,n&&(this.w3mLogger=new H3e(e)),this.abortController=s,this.w3mFrame=new F3e({projectId:e,isAppClient:!0,chainId:r,enableLogger:n}),this.onTimeout=i,this.getLoginEmailUsed()&&this.createFrame()}async createFrame(){this.w3mFrame.initFrame(),this.initPromise=new Promise(e=>{this.w3mFrame.events.onFrameEvent(r=>{r.type===Ye.FRAME_READY&&setTimeout(()=>{e()},500)})}),await this.initPromise,this.isInitialized=!0,this.initPromise=void 0}async init(){if(!this.isInitialized){if(this.initPromise){await this.initPromise;return}await this.createFrame()}}getLoginEmailUsed(){return!!Bn.get(Ye.EMAIL_LOGIN_USED_KEY)}getEmail(){return Bn.get(Ye.EMAIL)}getUsername(){return Bn.get(Ye.SOCIAL_USERNAME)}async reload(){var e;try{await this.appEvent({type:Ye.APP_RELOAD})}catch(r){throw(e=this.w3mLogger)==null||e.logger.error({error:r},"Error reloading iframe"),r}}async connectEmail(e){var r;try{ei.checkIfAllowedToTriggerEmail(),await this.init();const n=await this.appEvent({type:Ye.APP_CONNECT_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),n}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error connecting email"),n}}async connectDevice(){var e;try{return this.appEvent({type:Ye.APP_CONNECT_DEVICE})}catch(r){throw(e=this.w3mLogger)==null||e.logger.error({error:r},"Error connecting device"),r}}async connectOtp(e){var r;try{return this.appEvent({type:Ye.APP_CONNECT_OTP,payload:e})}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error connecting otp"),n}}async isConnected(){var e;try{if(!this.getLoginEmailUsed())return{isConnected:!1};const r=await this.appEvent({type:Ye.APP_IS_CONNECTED});return r!=null&&r.isConnected||this.deleteAuthLoginCache(),r}catch(r){throw this.deleteAuthLoginCache(),(e=this.w3mLogger)==null||e.logger.error({error:r},"Error checking connection"),r}}async getChainId(){var e;try{const r=await this.appEvent({type:Ye.APP_GET_CHAIN_ID});return this.setLastUsedChainId(r.chainId),r}catch(r){throw(e=this.w3mLogger)==null||e.logger.error({error:r},"Error getting chain id"),r}}async getSocialRedirectUri(e){var r;try{return await this.init(),this.appEvent({type:Ye.APP_GET_SOCIAL_REDIRECT_URI,payload:e})}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error getting social redirect uri"),n}}async updateEmail(e){var r;try{const n=await this.appEvent({type:Ye.APP_UPDATE_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),n}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error updating email"),n}}async updateEmailPrimaryOtp(e){var r;try{return this.appEvent({type:Ye.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:e})}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error updating email primary otp"),n}}async updateEmailSecondaryOtp(e){var r;try{const n=await this.appEvent({type:Ye.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:e});return this.setLoginSuccess(n.newEmail),n}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error updating email secondary otp"),n}}async syncTheme(e){var r;try{return this.appEvent({type:Ye.APP_SYNC_THEME,payload:e})}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error syncing theme"),n}}async syncDappData(e){var r;try{return this.appEvent({type:Ye.APP_SYNC_DAPP_DATA,payload:e})}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error syncing dapp data"),n}}async getSmartAccountEnabledNetworks(){var e;try{const r=await this.appEvent({type:Ye.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS});return this.persistSmartAccountEnabledNetworks(r.smartAccountEnabledNetworks),r}catch(r){throw this.persistSmartAccountEnabledNetworks([]),(e=this.w3mLogger)==null||e.logger.error({error:r},"Error getting smart account enabled networks"),r}}async setPreferredAccount(e){var r;try{return this.appEvent({type:Ye.APP_SET_PREFERRED_ACCOUNT,payload:{type:e}})}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error setting preferred account"),n}}async connect(e){var r,n;if(e!=null&&e.socialUri)try{await this.init();const i=await this.appEvent({type:Ye.APP_CONNECT_SOCIAL,payload:{uri:e.socialUri,preferredAccountType:e.preferredAccountType,chainId:e.chainId}});return i.userName&&this.setSocialLoginSuccess(i.userName),this.setLoginSuccess(i.email),this.setLastUsedChainId(i.chainId),this.user=i,i}catch(i){throw(r=this.w3mLogger)==null||r.logger.error({error:i},"Error connecting social"),i}else try{const i=(e==null?void 0:e.chainId)||this.getLastUsedChainId()||1,s=await this.getUser({chainId:i,preferredAccountType:e==null?void 0:e.preferredAccountType});return this.setLoginSuccess(s.email),this.setLastUsedChainId(s.chainId),this.user=s,s}catch(i){throw(n=this.w3mLogger)==null||n.logger.error({error:i},"Error connecting"),i}}async getUser(e){var r;try{await this.init();const n=(e==null?void 0:e.chainId)||this.getLastUsedChainId()||1,i=await this.appEvent({type:Ye.APP_GET_USER,payload:{...e,chainId:n}});return this.user=i,i}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error connecting"),n}}async connectSocial(e){var r;try{await this.init();const n=await this.appEvent({type:Ye.APP_CONNECT_SOCIAL,payload:{uri:e}});return n.userName&&this.setSocialLoginSuccess(n.userName),n}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error connecting social"),n}}async getFarcasterUri(){var e;try{return await this.init(),await this.appEvent({type:Ye.APP_GET_FARCASTER_URI})}catch(r){throw(e=this.w3mLogger)==null||e.logger.error({error:r},"Error getting farcaster uri"),r}}async connectFarcaster(){var e;try{const r=await this.appEvent({type:Ye.APP_CONNECT_FARCASTER});return r.userName&&this.setSocialLoginSuccess(r.userName),r}catch(r){throw(e=this.w3mLogger)==null||e.logger.error({error:r},"Error connecting farcaster"),r}}async switchNetwork(e){var r;try{const n=await this.appEvent({type:Ye.APP_SWITCH_NETWORK,payload:{chainId:e}});return this.setLastUsedChainId(n.chainId),n}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error switching network"),n}}async disconnect(){var e;try{return this.deleteAuthLoginCache(),await new Promise(async n=>{const i=setTimeout(()=>{n()},3e3);await this.appEvent({type:Ye.APP_SIGN_OUT}),clearTimeout(i),n()})}catch(r){throw(e=this.w3mLogger)==null||e.logger.error({error:r},"Error disconnecting"),r}}async request(e){var r,n,i,s;try{if(bt.GET_CHAIN_ID===e.method)return this.getLastUsedChainId();(r=this.rpcRequestHandler)==null||r.call(this,e);const o=await this.appEvent({type:Ye.APP_RPC_REQUEST,payload:e});return(n=this.rpcSuccessHandler)==null||n.call(this,o,e),o}catch(o){throw(i=this.rpcErrorHandler)==null||i.call(this,o,e),(s=this.w3mLogger)==null||s.logger.error({error:o},"Error requesting"),o}}onRpcRequest(e){this.rpcRequestHandler=e}onRpcSuccess(e){this.rpcSuccessHandler=e}onRpcError(e){this.rpcErrorHandler=e}onIsConnected(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Ye.FRAME_IS_CONNECTED_SUCCESS&&r.payload.isConnected&&e()})}onNotConnected(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Ye.FRAME_IS_CONNECTED_ERROR&&e(),r.type===Ye.FRAME_IS_CONNECTED_SUCCESS&&!r.payload.isConnected&&e()})}onConnect(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Ye.FRAME_GET_USER_SUCCESS&&e(r.payload)})}onSocialConnected(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Ye.FRAME_CONNECT_SOCIAL_SUCCESS&&e(r.payload)})}async getCapabilities(){try{return await this.request({method:"wallet_getCapabilities"})||{}}catch{return{}}}onSetPreferredAccount(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Ye.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?e(r.payload):r.type===Ye.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&e({type:bt.ACCOUNT_TYPES.EOA})})}onGetSmartAccountEnabledNetworks(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Ye.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS?e(r.payload.smartAccountEnabledNetworks):r.type===Ye.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR&&e([])})}getAvailableChainIds(){return Object.keys(this.w3mFrame.networks)}rejectRpcRequests(){var e;try{this.openRpcRequests.forEach(({abortController:r,method:n})=>{bt.SAFE_RPC_METHODS.includes(n)||r.abort()}),this.openRpcRequests=[]}catch(r){(e=this.w3mLogger)==null||e.logger.error({error:r},"Error aborting RPC request")}}async appEvent(e){let r,n;function i(c){return c.replace("@w3m-app/","")}const s=[Ye.APP_SYNC_DAPP_DATA,Ye.APP_SYNC_THEME,Ye.APP_SET_PREFERRED_ACCOUNT],o=i(e.type);return!this.w3mFrame.iframeIsReady&&!s.includes(e.type)&&(n=setTimeout(()=>{var c;(c=this.onTimeout)==null||c.call(this,"iframe_load_failed"),this.abortController.abort()},2e4)),await this.w3mFrame.frameLoadPromise,clearTimeout(n),[Ye.APP_CONNECT_EMAIL,Ye.APP_CONNECT_DEVICE,Ye.APP_CONNECT_OTP,Ye.APP_CONNECT_SOCIAL,Ye.APP_GET_SOCIAL_REDIRECT_URI].map(i).includes(o)&&(r=setTimeout(()=>{var c;(c=this.onTimeout)==null||c.call(this,"iframe_request_timeout"),this.abortController.abort()},3e4)),new Promise((c,u)=>{var f,g,p;const l=Math.random().toString(36).substring(7);(p=(f=this.w3mLogger)==null?void 0:(g=f.logger).info)==null||p.call(g,{event:e,id:l},"Sending app event"),this.w3mFrame.events.postAppEvent({...e,id:l});const d=new AbortController;if(o==="RPC_REQUEST"){const m=e;this.openRpcRequests=[...this.openRpcRequests,{...m.payload,abortController:d}]}d.signal.addEventListener("abort",()=>{o==="RPC_REQUEST"?u(new Error("Request was aborted")):o!=="GET_FARCASTER_URI"&&u(new Error("Something went wrong"))});function h(m,b){var v,E,w;m.id===l&&((E=b==null?void 0:(v=b.logger).info)==null||E.call(v,{framEvent:m,id:l},"Received frame response"),m.type===`@w3m-frame/${o}_SUCCESS`?(r&&clearTimeout(r),n&&clearTimeout(n),"payload"in m&&c(m.payload),c(void 0)):m.type===`@w3m-frame/${o}_ERROR`&&(r&&clearTimeout(r),n&&clearTimeout(n),"payload"in m&&u(new Error(((w=m.payload)==null?void 0:w.message)||"An error occurred")),u(new Error("An error occurred"))))}this.w3mFrame.events.registerFrameEventHandler(l,m=>h(m,this.w3mLogger),this.abortController.signal)})}setNewLastEmailLoginTime(){Bn.set(Ye.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setSocialLoginSuccess(e){Bn.set(Ye.SOCIAL_USERNAME,e)}setLoginSuccess(e){e&&Bn.set(Ye.EMAIL,e),Bn.set(Ye.EMAIL_LOGIN_USED_KEY,"true"),Bn.delete(Ye.LAST_EMAIL_LOGIN_TIME)}deleteAuthLoginCache(){Bn.delete(Ye.EMAIL_LOGIN_USED_KEY),Bn.delete(Ye.EMAIL),Bn.delete(Ye.LAST_USED_CHAIN_KEY),Bn.delete(Ye.SOCIAL_USERNAME)}setLastUsedChainId(e){e&&Bn.set(Ye.LAST_USED_CHAIN_KEY,String(e))}getLastUsedChainId(){const e=Bn.get(Ye.LAST_USED_CHAIN_KEY)??void 0,r=Number(e);return isNaN(r)?e:r}persistSmartAccountEnabledNetworks(e){Bn.set(Ye.SMART_ACCOUNT_ENABLED_NETWORKS,e.join(","))}}class mb{constructor(){}static getInstance({projectId:e,chainId:r,enableLogger:n,onTimeout:i,abortController:s}){return mb.instance||(mb.instance=new s7({projectId:e,chainId:r,enableLogger:n,onTimeout:i,abortController:s})),mb.instance}}function q3e(){try{return ue.returnOpenHref(`${_e.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes")}catch{throw new Error("Could not open social popup")}}async function z3e(){X.push("ConnectingFarcaster");const t=ge.getAuthConnector();if(t&&!re.state.farcasterUrl)try{const{url:e}=await t.provider.getFarcasterUri();re.setFarcasterUrl(e,F.state.activeChain)}catch(e){X.goBack(),Fe.showError(e)}}async function W3e(t){X.push("ConnectingSocial");const e=ge.getAuthConnector();let r=null;try{const n=setTimeout(()=>{throw new Error("Social login timed out. Please try again.")},45e3);if(e&&t){if(ue.isTelegram()||(r=q3e()),r)re.setSocialWindow(r,F.state.activeChain);else if(!ue.isTelegram())throw new Error("Could not create social popup");const{uri:i}=await e.provider.getSocialRedirectUri({provider:t});if(!i)throw r==null||r.close(),new Error("Could not fetch the social redirect uri");if(r&&(r.location.href=i),ue.isTelegram()){Le.setTelegramSocialProvider(t);const s=ue.formatTelegramSocialLoginUrl(i);ue.openHref(s,"_top")}clearTimeout(n)}}catch(n){r==null||r.close(),Fe.showError(n==null?void 0:n.message)}}async function OZ(t){re.setSocialProvider(t,F.state.activeChain),Re.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:t}}),t==="farcaster"?await z3e():await W3e(t)}function b3(t,e){return ge.getConnectorId(t)===e}function V3e(t){const e=Array.from(F.state.chains.keys());let r=[];return t?(r.push([t,F.state.chains.get(t)]),b3(t,_e.CONNECTOR_ID.WALLET_CONNECT)?e.forEach(n=>{n!==t&&b3(n,_e.CONNECTOR_ID.WALLET_CONNECT)&&r.push([n,F.state.chains.get(n)])}):b3(t,_e.CONNECTOR_ID.AUTH)&&e.forEach(n=>{n!==t&&b3(n,_e.CONNECTOR_ID.AUTH)&&r.push([n,F.state.chains.get(n)])})):r=Array.from(F.state.chains.entries()),r}var yj={};const Fo={ACCOUNT_TABS:[{label:"Tokens"},{label:"NFTs"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof process<"u"&&typeof yj<"u"?yj.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},DEFAULT_CONNECT_METHOD_ORDER:["email","social","wallet"],ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150}},Ou={filterOutDuplicatesByRDNS(t){const e=oe.state.enableEIP6963?ge.state.connectors:[],r=Le.getRecentWallets(),n=e.map(a=>{var c;return(c=a.info)==null?void 0:c.rdns}).filter(Boolean),i=r.map(a=>a.rdns).filter(Boolean),s=n.concat(i);if(s.includes("io.metamask.mobile")&&ue.isMobile()){const a=s.indexOf("io.metamask.mobile");s[a]="io.metamask"}return t.filter(a=>!s.includes(String(a==null?void 0:a.rdns)))},filterOutDuplicatesByIds(t){const e=ge.state.connectors.filter(a=>a.type==="ANNOUNCED"||a.type==="INJECTED"),r=Le.getRecentWallets(),n=e.map(a=>a.explorerId),i=r.map(a=>a.id),s=n.concat(i);return t.filter(a=>!s.includes(a==null?void 0:a.id))},filterOutDuplicateWallets(t){const e=this.filterOutDuplicatesByRDNS(t);return this.filterOutDuplicatesByIds(e)},markWalletsAsInstalled(t){const{connectors:e}=ge.state,{featuredWalletIds:r}=oe.state,n=e.filter(o=>o.type==="ANNOUNCED").reduce((o,a)=>{var c;return(c=a.info)!=null&&c.rdns&&(o[a.info.rdns]=!0),o},{});return t.map(o=>({...o,installed:!!o.rdns&&!!n[o.rdns??""]})).sort((o,a)=>{const c=Number(a.installed)-Number(o.installed);if(c!==0)return c;if(r!=null&&r.length){const u=r.indexOf(o.id),l=r.indexOf(a.id);if(u!==-1&&l!==-1)return u-l;if(u!==-1)return-1;if(l!==-1)return 1}return 0})},getConnectOrderMethod(t,e){var c;const r=(t==null?void 0:t.connectMethodsOrder)||((c=oe.state.features)==null?void 0:c.connectMethodsOrder),n=e||ge.state.connectors;if(r)return r;const{injected:i,announced:s}=xu.getConnectorsByType(n,Ne.state.recommended,Ne.state.featured),o=i.filter(xu.showConnector),a=s.filter(xu.showConnector);return o.length||a.length?["wallet","email","social"]:Fo.DEFAULT_CONNECT_METHOD_ORDER},isExcluded(t){const e=!!t.rdns&&Ne.state.excludedWallets.some(n=>n.rdns===t.rdns),r=!!t.name&&Ne.state.excludedWallets.some(n=>aA.isLowerCaseMatch(n.name,t.name));return e||r}},xu={getConnectorsByType(t,e,r){const{customWallets:n}=oe.state,i=Le.getRecentWallets(),s=Ou.filterOutDuplicateWallets(e),o=Ou.filterOutDuplicateWallets(r),a=t.filter(d=>d.type==="MULTI_CHAIN"),c=t.filter(d=>d.type==="ANNOUNCED"),u=t.filter(d=>d.type==="INJECTED"),l=t.filter(d=>d.type==="EXTERNAL");return{custom:n,recent:i,external:l,multiChain:a,announced:c,injected:u,recommended:s,featured:o}},showConnector(t){var i;const e=(i=t.info)==null?void 0:i.rdns,r=!!e&&Ne.state.excludedWallets.some(s=>!!s.rdns&&s.rdns===e),n=!!t.name&&Ne.state.excludedWallets.some(s=>aA.isLowerCaseMatch(s.name,t.name));return!(t.type==="INJECTED"&&(t.name==="Browser Wallet"&&(!ue.isMobile()||ue.isMobile()&&!e&&!xe.checkInstalled())||r||n)||(t.type==="ANNOUNCED"||t.type==="EXTERNAL")&&(r||n))},getIsConnectedWithWC(){return Array.from(F.state.chains.values()).some(r=>ge.getConnectorId(r.namespace)===_e.CONNECTOR_ID.WALLET_CONNECT)},getConnectorTypeOrder({recommended:t,featured:e,custom:r,recent:n,announced:i,injected:s,multiChain:o,external:a,overriddenConnectors:c=(u=>(u=oe.state.features)==null?void 0:u.connectorTypeOrder)()??[]}){const l=xu.getIsConnectedWithWC(),f=[{type:"walletConnect",isEnabled:oe.state.enableWalletConnect&&!l},{type:"recent",isEnabled:n.length>0},{type:"injected",isEnabled:[...s,...i,...o].length>0},{type:"featured",isEnabled:e.length>0},{type:"custom",isEnabled:r&&r.length>0},{type:"external",isEnabled:a.length>0},{type:"recommended",isEnabled:t.length>0}].filter(b=>b.isEnabled),g=new Set(f.map(b=>b.type)),p=c.filter(b=>g.has(b)).map(b=>({type:b,isEnabled:!0})),m=f.filter(({type:b})=>!p.some(({type:E})=>E===b));return Array.from(new Set([...p,...m].map(({type:b})=>b)))}},K0={interpolate(t,e,r){if(t.length!==2||e.length!==2)throw new Error("inputRange and outputRange must be an array of length 2");const n=t[0]||0,i=t[1]||0,s=e[0]||0,o=e[1]||0;return r<n?s:r>i?o:(o-s)/(i-n)*(r-n)+s}};/**
- * @license
- * Copyright 2019 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */const eC=globalThis,o7=eC.ShadowRoot&&(eC.ShadyCSS===void 0||eC.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a7=Symbol(),vj=new WeakMap;let RZ=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==a7)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(o7&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=vj.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&vj.set(r,e))}return e}toString(){return this.cssText}};const Vs=t=>new RZ(typeof t=="string"?t:t+"",void 0,a7),de=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new RZ(r,t,a7)},G3e=(t,e)=>{if(o7)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const n=document.createElement("style"),i=eC.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},_j=o7?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return Vs(r)})(t):t;/**
- * @license
- * Copyright 2017 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */const{is:K3e,defineProperty:Z3e,getOwnPropertyDescriptor:Y3e,getOwnPropertyNames:J3e,getOwnPropertySymbols:Q3e,getPrototypeOf:X3e}=Object,hd=globalThis,Ej=hd.trustedTypes,e_e=Ej?Ej.emptyScript:"",cS=hd.reactiveElementPolyfillSupport,wb=(t,e)=>t,LC={toAttribute(t,e){switch(e){case Boolean:t=t?e_e:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},c7=(t,e)=>!K3e(t,e),Cj={attribute:!0,type:String,converter:LC,reflect:!1,useDefault:!1,hasChanged:c7};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),hd.litPropertyMetadata??(hd.litPropertyMetadata=new WeakMap);let U0=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=Cj){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Z3e(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){const{get:i,set:s}=Y3e(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:i,set(o){const a=i==null?void 0:i.call(this);s==null||s.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Cj}static _$Ei(){if(this.hasOwnProperty(wb("elementProperties")))return;const e=X3e(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(wb("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(wb("properties"))){const r=this.properties,n=[...J3e(r),...Q3e(r)];for(const i of n)this.createProperty(i,r[i])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[r,n]of this.elementProperties){const i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)r.unshift(_j(i))}else e!==void 0&&r.push(_j(e));return r}static _$Eu(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return G3e(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostConnected)==null?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostDisconnected)==null?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$ET(e,r){var s;const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const o=(((s=n.converter)==null?void 0:s.toAttribute)!==void 0?n.converter:LC).toAttribute(r,n.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,r){var s,o;const n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const a=n.getPropertyOptions(i),c=typeof a.converter=="function"?{fromAttribute:a.converter}:((s=a.converter)==null?void 0:s.fromAttribute)!==void 0?a.converter:LC;this._$Em=i,this[i]=c.fromAttribute(r,a.type)??((o=this._$Ej)==null?void 0:o.get(i))??null,this._$Em=null}}requestUpdate(e,r,n){var i;if(e!==void 0){const s=this.constructor,o=this[e];if(n??(n=s.getPropertyOptions(e)),!((n.hasChanged??c7)(o,r)||n.useDefault&&n.reflect&&o===((i=this._$Ej)==null?void 0:i.get(e))&&!this.hasAttribute(s._$Eu(e,n))))return;this.C(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:n,reflect:i,wrapped:s},o){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??r??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(r=void 0),this._$AL.set(e,r)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,o]of i){const{wrapped:a}=o,c=this[s];a!==!0||this._$AL.has(s)||c===void 0||this.C(s,void 0,o,c)}}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),(n=this._$EO)==null||n.forEach(i=>{var s;return(s=i.hostUpdate)==null?void 0:s.call(i)}),this.update(r)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(r)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(r=>this._$ET(r,this[r]))),this._$EM()}updated(e){}firstUpdated(e){}};U0.elementStyles=[],U0.shadowRootOptions={mode:"open"},U0[wb("elementProperties")]=new Map,U0[wb("finalized")]=new Map,cS==null||cS({ReactiveElement:U0}),(hd.reactiveElementVersions??(hd.reactiveElementVersions=[])).push("2.1.0");/**
- * @license
- * Copyright 2017 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */const bb=globalThis,UC=bb.trustedTypes,Aj=UC?UC.createPolicy("lit-html",{createHTML:t=>t}):void 0,kZ="$lit$",Ul=`lit$${Math.random().toFixed(9).slice(2)}$`,NZ="?"+Ul,t_e=`<${NZ}>`,zf=document,by=()=>zf.createComment(""),yy=t=>t===null||typeof t!="object"&&typeof t!="function",u7=Array.isArray,r_e=t=>u7(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",uS=`[
- \f\r]`,K1=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xj=/-->/g,Sj=/>/g,hh=RegExp(`>|${uS}(?:([^\\s"'>=/]+)(${uS}*=${uS}*(?:[^
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Tj=/'/g,Ij=/"/g,$Z=/^(?:script|style|textarea|title)$/i,jZ=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),M=jZ(1),Se=jZ(2),Ru=Symbol.for("lit-noChange"),Jr=Symbol.for("lit-nothing"),Pj=new WeakMap,Qh=zf.createTreeWalker(zf,129);function BZ(t,e){if(!u7(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Aj!==void 0?Aj.createHTML(e):e}const n_e=(t,e)=>{const r=t.length-1,n=[];let i,s=e===2?"<svg>":e===3?"<math>":"",o=K1;for(let a=0;a<r;a++){const c=t[a];let u,l,d=-1,h=0;for(;h<c.length&&(o.lastIndex=h,l=o.exec(c),l!==null);)h=o.lastIndex,o===K1?l[1]==="!--"?o=xj:l[1]!==void 0?o=Sj:l[2]!==void 0?($Z.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=hh):l[3]!==void 0&&(o=hh):o===hh?l[0]===">"?(o=i??K1,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,u=l[1],o=l[3]===void 0?hh:l[3]==='"'?Ij:Tj):o===Ij||o===Tj?o=hh:o===xj||o===Sj?o=K1:(o=hh,i=void 0);const f=o===hh&&t[a+1].startsWith("/>")?" ":"";s+=o===K1?c+t_e:d>=0?(n.push(u),c.slice(0,d)+kZ+c.slice(d)+Ul+f):c+Ul+(d===-2?a:f)}return[BZ(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};let ZI=class DZ{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,o=0;const a=e.length-1,c=this.parts,[u,l]=n_e(e,r);if(this.el=DZ.createElement(u,n),Qh.currentNode=this.el.content,r===2||r===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=Qh.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(kZ)){const h=l[o++],f=i.getAttribute(d).split(Ul),g=/([.?@])?(.*)/.exec(h);c.push({type:1,index:s,name:g[2],strings:f,ctor:g[1]==="."?s_e:g[1]==="?"?o_e:g[1]==="@"?a_e:uA}),i.removeAttribute(d)}else d.startsWith(Ul)&&(c.push({type:6,index:s}),i.removeAttribute(d));if($Z.test(i.tagName)){const d=i.textContent.split(Ul),h=d.length-1;if(h>0){i.textContent=UC?UC.emptyScript:"";for(let f=0;f<h;f++)i.append(d[f],by()),Qh.nextNode(),c.push({type:2,index:++s});i.append(d[h],by())}}}else if(i.nodeType===8)if(i.data===NZ)c.push({type:2,index:s});else{let d=-1;for(;(d=i.data.indexOf(Ul,d+1))!==-1;)c.push({type:7,index:s}),d+=Ul.length-1}s++}}static createElement(e,r){const n=zf.createElement("template");return n.innerHTML=e,n}};function _m(t,e,r=t,n){var o,a;if(e===Ru)return e;let i=n!==void 0?(o=r._$Co)==null?void 0:o[n]:r._$Cl;const s=yy(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),s===void 0?i=void 0:(i=new s(t),i._$AT(t,r,n)),n!==void 0?(r._$Co??(r._$Co=[]))[n]=i:r._$Cl=i),i!==void 0&&(e=_m(t,i._$AS(t,e.values),i,n)),e}let i_e=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:r},parts:n}=this._$AD,i=((e==null?void 0:e.creationScope)??zf).importNode(r,!0);Qh.currentNode=i;let s=Qh.nextNode(),o=0,a=0,c=n[0];for(;c!==void 0;){if(o===c.index){let u;c.type===2?u=new Hv(s,s.nextSibling,this,e):c.type===1?u=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(u=new c_e(s,this,e)),this._$AV.push(u),c=n[++a]}o!==(c==null?void 0:c.index)&&(s=Qh.nextNode(),o++)}return Qh.currentNode=zf,i}p(e){let r=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}};class Hv{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,r,n,i){this.type=2,this._$AH=Jr,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=_m(this,e,r),yy(e)?e===Jr||e==null||e===""?(this._$AH!==Jr&&this._$AR(),this._$AH=Jr):e!==this._$AH&&e!==Ru&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):r_e(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Jr&&yy(this._$AH)?this._$AA.nextSibling.data=e:this.T(zf.createTextNode(e)),this._$AH=e}$(e){var s;const{values:r,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=ZI.createElement(BZ(n.h,n.h[0]),this.options)),n);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(r);else{const o=new i_e(i,this),a=o.u(this.options);o.p(r),this.T(a),this._$AH=o}}_$AC(e){let r=Pj.get(e.strings);return r===void 0&&Pj.set(e.strings,r=new ZI(e)),r}k(e){u7(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,i=0;for(const s of e)i===r.length?r.push(n=new Hv(this.O(by()),this.O(by()),this,this.options)):n=r[i],n._$AI(s),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,r);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cv=e,(r=this._$AP)==null||r.call(this,e))}}let uA=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,n,i,s){this.type=1,this._$AH=Jr,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Jr}_$AI(e,r=this,n,i){const s=this.strings;let o=!1;if(s===void 0)e=_m(this,e,r,0),o=!yy(e)||e!==this._$AH&&e!==Ru,o&&(this._$AH=e);else{const a=e;let c,u;for(e=s[0],c=0;c<s.length-1;c++)u=_m(this,a[n+c],r,c),u===Ru&&(u=this._$AH[c]),o||(o=!yy(u)||u!==this._$AH[c]),u===Jr?e=Jr:e!==Jr&&(e+=(u??"")+s[c+1]),this._$AH[c]=u}o&&!i&&this.j(e)}j(e){e===Jr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}};class s_e extends uA{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Jr?void 0:e}}let o_e=class extends uA{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Jr)}},a_e=class extends uA{constructor(e,r,n,i,s){super(e,r,n,i,s),this.type=5}_$AI(e,r=this){if((e=_m(this,e,r,0)??Jr)===Ru)return;const n=this._$AH,i=e===Jr&&n!==Jr||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==Jr&&(n===Jr||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r;typeof this._$AH=="function"?this._$AH.call(((r=this.options)==null?void 0:r.host)??this.element,e):this._$AH.handleEvent(e)}},c_e=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){_m(this,e)}};const lS=bb.litHtmlPolyfillSupport;lS==null||lS(ZI,Hv),(bb.litHtmlVersions??(bb.litHtmlVersions=[])).push("3.3.0");const u_e=(t,e,r)=>{const n=(r==null?void 0:r.renderBefore)??e;let i=n._$litPart$;if(i===void 0){const s=(r==null?void 0:r.renderBefore)??null;n._$litPart$=i=new Hv(e.insertBefore(by(),s),s,void 0,r??{})}return i._$AI(t),i};/**
- * @license
- * Copyright 2017 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */const Of=globalThis;let se=class extends U0{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=u_e(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Ru}};var GW;se._$litElement$=!0,se.finalized=!0,(GW=Of.litElementHydrateSupport)==null||GW.call(Of,{LitElement:se});const dS=Of.litElementPolyfillSupport;dS==null||dS({LitElement:se});(Of.litElementVersions??(Of.litElementVersions=[])).push("4.2.0");let yb,fd,pd;function l_e(t,e){yb=document.createElement("style"),fd=document.createElement("style"),pd=document.createElement("style"),yb.textContent=og(t).core.cssText,fd.textContent=og(t).dark.cssText,pd.textContent=og(t).light.cssText,document.head.appendChild(yb),document.head.appendChild(fd),document.head.appendChild(pd),MZ(e)}function MZ(t){fd&&pd&&(t==="light"?(fd.removeAttribute("media"),pd.media="enabled"):(pd.removeAttribute("media"),fd.media="enabled"))}function d_e(t){yb&&fd&&pd&&(yb.textContent=og(t).core.cssText,fd.textContent=og(t).dark.cssText,pd.textContent=og(t).light.cssText)}function og(t){return{core:de`
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
- @keyframes w3m-shake {
- 0% {
- transform: scale(1) rotate(0deg);
- }
- 20% {
- transform: scale(1) rotate(-1deg);
- }
- 40% {
- transform: scale(1) rotate(1.5deg);
- }
- 60% {
- transform: scale(1) rotate(-1.5deg);
- }
- 80% {
- transform: scale(1) rotate(1deg);
- }
- 100% {
- transform: scale(1) rotate(0deg);
- }
- }
- @keyframes w3m-iframe-fade-out {
- 0% {
- opacity: 1;
- }
- 100% {
- opacity: 0;
- }
- }
- @keyframes w3m-iframe-zoom-in {
- 0% {
- transform: translateY(50px);
- opacity: 0;
- }
- 100% {
- transform: translateY(0px);
- opacity: 1;
- }
- }
- @keyframes w3m-iframe-zoom-in-mobile {
- 0% {
- transform: scale(0.95);
- opacity: 0;
- }
- 100% {
- transform: scale(1);
- opacity: 1;
- }
- }
- :root {
- --w3m-modal-width: 360px;
- --w3m-color-mix-strength: ${Vs(t!=null&&t["--w3m-color-mix-strength"]?`${t["--w3m-color-mix-strength"]}%`:"0%")};
- --w3m-font-family: ${Vs((t==null?void 0:t["--w3m-font-family"])||"Inter, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;")};
- --w3m-font-size-master: ${Vs((t==null?void 0:t["--w3m-font-size-master"])||"10px")};
- --w3m-border-radius-master: ${Vs((t==null?void 0:t["--w3m-border-radius-master"])||"4px")};
- --w3m-z-index: ${Vs((t==null?void 0:t["--w3m-z-index"])||999)};
- --wui-font-family: var(--w3m-font-family);
- --wui-font-size-mini: calc(var(--w3m-font-size-master) * 0.8);
- --wui-font-size-micro: var(--w3m-font-size-master);
- --wui-font-size-tiny: calc(var(--w3m-font-size-master) * 1.2);
- --wui-font-size-small: calc(var(--w3m-font-size-master) * 1.4);
- --wui-font-size-paragraph: calc(var(--w3m-font-size-master) * 1.6);
- --wui-font-size-medium: calc(var(--w3m-font-size-master) * 1.8);
- --wui-font-size-large: calc(var(--w3m-font-size-master) * 2);
- --wui-font-size-title-6: calc(var(--w3m-font-size-master) * 2.2);
- --wui-font-size-medium-title: calc(var(--w3m-font-size-master) * 2.4);
- --wui-font-size-2xl: calc(var(--w3m-font-size-master) * 4);
- --wui-border-radius-5xs: var(--w3m-border-radius-master);
- --wui-border-radius-4xs: calc(var(--w3m-border-radius-master) * 1.5);
- --wui-border-radius-3xs: calc(var(--w3m-border-radius-master) * 2);
- --wui-border-radius-xxs: calc(var(--w3m-border-radius-master) * 3);
- --wui-border-radius-xs: calc(var(--w3m-border-radius-master) * 4);
- --wui-border-radius-s: calc(var(--w3m-border-radius-master) * 5);
- --wui-border-radius-m: calc(var(--w3m-border-radius-master) * 7);
- --wui-border-radius-l: calc(var(--w3m-border-radius-master) * 9);
- --wui-border-radius-3xl: calc(var(--w3m-border-radius-master) * 20);
- --wui-font-weight-light: 400;
- --wui-font-weight-regular: 500;
- --wui-font-weight-medium: 600;
- --wui-font-weight-bold: 700;
- --wui-letter-spacing-2xl: -1.6px;
- --wui-letter-spacing-medium-title: -0.96px;
- --wui-letter-spacing-title-6: -0.88px;
- --wui-letter-spacing-large: -0.8px;
- --wui-letter-spacing-medium: -0.72px;
- --wui-letter-spacing-paragraph: -0.64px;
- --wui-letter-spacing-small: -0.56px;
- --wui-letter-spacing-tiny: -0.48px;
- --wui-letter-spacing-micro: -0.2px;
- --wui-letter-spacing-mini: -0.16px;
- --wui-spacing-0: 0px;
- --wui-spacing-4xs: 2px;
- --wui-spacing-3xs: 4px;
- --wui-spacing-xxs: 6px;
- --wui-spacing-2xs: 7px;
- --wui-spacing-xs: 8px;
- --wui-spacing-1xs: 10px;
- --wui-spacing-s: 12px;
- --wui-spacing-m: 14px;
- --wui-spacing-l: 16px;
- --wui-spacing-2l: 18px;
- --wui-spacing-xl: 20px;
- --wui-spacing-xxl: 24px;
- --wui-spacing-2xl: 32px;
- --wui-spacing-3xl: 40px;
- --wui-spacing-4xl: 90px;
- --wui-spacing-5xl: 95px;
- --wui-icon-box-size-xxs: 14px;
- --wui-icon-box-size-xs: 20px;
- --wui-icon-box-size-sm: 24px;
- --wui-icon-box-size-md: 32px;
- --wui-icon-box-size-mdl: 36px;
- --wui-icon-box-size-lg: 40px;
- --wui-icon-box-size-2lg: 48px;
- --wui-icon-box-size-xl: 64px;
- --wui-icon-size-inherit: inherit;
- --wui-icon-size-xxs: 10px;
- --wui-icon-size-xs: 12px;
- --wui-icon-size-sm: 14px;
- --wui-icon-size-md: 16px;
- --wui-icon-size-mdl: 18px;
- --wui-icon-size-lg: 20px;
- --wui-icon-size-xl: 24px;
- --wui-icon-size-xxl: 28px;
- --wui-wallet-image-size-inherit: inherit;
- --wui-wallet-image-size-sm: 40px;
- --wui-wallet-image-size-md: 56px;
- --wui-wallet-image-size-lg: 80px;
- --wui-visual-size-size-inherit: inherit;
- --wui-visual-size-sm: 40px;
- --wui-visual-size-md: 55px;
- --wui-visual-size-lg: 80px;
- --wui-box-size-md: 100px;
- --wui-box-size-lg: 120px;
- --wui-ease-out-power-2: cubic-bezier(0, 0, 0.22, 1);
- --wui-ease-out-power-1: cubic-bezier(0, 0, 0.55, 1);
- --wui-ease-in-power-3: cubic-bezier(0.66, 0, 1, 1);
- --wui-ease-in-power-2: cubic-bezier(0.45, 0, 1, 1);
- --wui-ease-in-power-1: cubic-bezier(0.3, 0, 1, 1);
- --wui-ease-inout-power-1: cubic-bezier(0.45, 0, 0.55, 1);
- --wui-duration-lg: 200ms;
- --wui-duration-md: 125ms;
- --wui-duration-sm: 75ms;
- --wui-path-network-sm: path(
- 'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z'
- );
- --wui-path-network-md: path(
- 'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z'
- );
- --wui-path-network-lg: path(
- 'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z'
- );
- --wui-width-network-sm: 36px;
- --wui-width-network-md: 48px;
- --wui-width-network-lg: 86px;
- --wui-height-network-sm: 40px;
- --wui-height-network-md: 54px;
- --wui-height-network-lg: 96px;
- --wui-icon-size-network-xs: 12px;
- --wui-icon-size-network-sm: 16px;
- --wui-icon-size-network-md: 24px;
- --wui-icon-size-network-lg: 42px;
- --wui-color-inherit: inherit;
- --wui-color-inverse-100: #fff;
- --wui-color-inverse-000: #000;
- --wui-cover: rgba(20, 20, 20, 0.8);
- --wui-color-modal-bg: var(--wui-color-modal-bg-base);
- --wui-color-accent-100: var(--wui-color-accent-base-100);
- --wui-color-accent-090: var(--wui-color-accent-base-090);
- --wui-color-accent-080: var(--wui-color-accent-base-080);
- --wui-color-success-100: var(--wui-color-success-base-100);
- --wui-color-success-125: var(--wui-color-success-base-125);
- --wui-color-warning-100: var(--wui-color-warning-base-100);
- --wui-color-error-100: var(--wui-color-error-base-100);
- --wui-color-error-125: var(--wui-color-error-base-125);
- --wui-color-blue-100: var(--wui-color-blue-base-100);
- --wui-color-blue-90: var(--wui-color-blue-base-90);
- --wui-icon-box-bg-error-100: var(--wui-icon-box-bg-error-base-100);
- --wui-icon-box-bg-blue-100: var(--wui-icon-box-bg-blue-base-100);
- --wui-icon-box-bg-success-100: var(--wui-icon-box-bg-success-base-100);
- --wui-icon-box-bg-inverse-100: var(--wui-icon-box-bg-inverse-base-100);
- --wui-all-wallets-bg-100: var(--wui-all-wallets-bg-100);
- --wui-avatar-border: var(--wui-avatar-border-base);
- --wui-thumbnail-border: var(--wui-thumbnail-border-base);
- --wui-wallet-button-bg: var(--wui-wallet-button-bg-base);
- --wui-box-shadow-blue: var(--wui-color-accent-glass-020);
- }
- @supports (background: color-mix(in srgb, white 50%, black)) {
- :root {
- --wui-color-modal-bg: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-modal-bg-base)
- );
- --wui-box-shadow-blue: color-mix(in srgb, var(--wui-color-accent-100) 20%, transparent);
- --wui-color-accent-100: color-mix(
- in srgb,
- var(--wui-color-accent-base-100) 100%,
- transparent
- );
- --wui-color-accent-090: color-mix(
- in srgb,
- var(--wui-color-accent-base-100) 90%,
- transparent
- );
- --wui-color-accent-080: color-mix(
- in srgb,
- var(--wui-color-accent-base-100) 80%,
- transparent
- );
- --wui-color-accent-glass-090: color-mix(
- in srgb,
- var(--wui-color-accent-base-100) 90%,
- transparent
- );
- --wui-color-accent-glass-080: color-mix(
- in srgb,
- var(--wui-color-accent-base-100) 80%,
- transparent
- );
- --wui-color-accent-glass-020: color-mix(
- in srgb,
- var(--wui-color-accent-base-100) 20%,
- transparent
- );
- --wui-color-accent-glass-015: color-mix(
- in srgb,
- var(--wui-color-accent-base-100) 15%,
- transparent
- );
- --wui-color-accent-glass-010: color-mix(
- in srgb,
- var(--wui-color-accent-base-100) 10%,
- transparent
- );
- --wui-color-accent-glass-005: color-mix(
- in srgb,
- var(--wui-color-accent-base-100) 5%,
- transparent
- );
- --wui-color-accent-002: color-mix(
- in srgb,
- var(--wui-color-accent-base-100) 2%,
- transparent
- );
- --wui-color-fg-100: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-fg-100)
- );
- --wui-color-fg-125: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-fg-125)
- );
- --wui-color-fg-150: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-fg-150)
- );
- --wui-color-fg-175: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-fg-175)
- );
- --wui-color-fg-200: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-fg-200)
- );
- --wui-color-fg-225: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-fg-225)
- );
- --wui-color-fg-250: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-fg-250)
- );
- --wui-color-fg-275: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-fg-275)
- );
- --wui-color-fg-300: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-fg-300)
- );
- --wui-color-fg-325: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-fg-325)
- );
- --wui-color-fg-350: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-fg-350)
- );
- --wui-color-bg-100: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-bg-100)
- );
- --wui-color-bg-125: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-bg-125)
- );
- --wui-color-bg-150: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-bg-150)
- );
- --wui-color-bg-175: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-bg-175)
- );
- --wui-color-bg-200: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-bg-200)
- );
- --wui-color-bg-225: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-bg-225)
- );
- --wui-color-bg-250: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-bg-250)
- );
- --wui-color-bg-275: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-bg-275)
- );
- --wui-color-bg-300: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-bg-300)
- );
- --wui-color-bg-325: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-bg-325)
- );
- --wui-color-bg-350: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-bg-350)
- );
- --wui-color-success-100: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-success-base-100)
- );
- --wui-color-success-125: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-success-base-125)
- );
- --wui-color-warning-100: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-warning-base-100)
- );
- --wui-color-error-100: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-error-base-100)
- );
- --wui-color-blue-100: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-blue-base-100)
- );
- --wui-color-blue-90: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-blue-base-90)
- );
- --wui-color-error-125: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-color-error-base-125)
- );
- --wui-icon-box-bg-error-100: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-icon-box-bg-error-base-100)
- );
- --wui-icon-box-bg-accent-100: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-icon-box-bg-blue-base-100)
- );
- --wui-icon-box-bg-success-100: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-icon-box-bg-success-base-100)
- );
- --wui-icon-box-bg-inverse-100: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-icon-box-bg-inverse-base-100)
- );
- --wui-all-wallets-bg-100: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-all-wallets-bg-100)
- );
- --wui-avatar-border: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-avatar-border-base)
- );
- --wui-thumbnail-border: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-thumbnail-border-base)
- );
- --wui-wallet-button-bg: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--wui-wallet-button-bg-base)
- );
- }
- }
- `,light:de`
- :root {
- --w3m-color-mix: ${Vs((t==null?void 0:t["--w3m-color-mix"])||"#fff")};
- --w3m-accent: ${Vs(za(t,"dark")["--w3m-accent"])};
- --w3m-default: #fff;
- --wui-color-modal-bg-base: ${Vs(za(t,"dark")["--w3m-background"])};
- --wui-color-accent-base-100: var(--w3m-accent);
- --wui-color-blueberry-100: hsla(230, 100%, 67%, 1);
- --wui-color-blueberry-090: hsla(231, 76%, 61%, 1);
- --wui-color-blueberry-080: hsla(230, 59%, 55%, 1);
- --wui-color-blueberry-050: hsla(231, 100%, 70%, 0.1);
- --wui-color-fg-100: #e4e7e7;
- --wui-color-fg-125: #d0d5d5;
- --wui-color-fg-150: #a8b1b1;
- --wui-color-fg-175: #a8b0b0;
- --wui-color-fg-200: #949e9e;
- --wui-color-fg-225: #868f8f;
- --wui-color-fg-250: #788080;
- --wui-color-fg-275: #788181;
- --wui-color-fg-300: #6e7777;
- --wui-color-fg-325: #9a9a9a;
- --wui-color-fg-350: #363636;
- --wui-color-bg-100: #141414;
- --wui-color-bg-125: #191a1a;
- --wui-color-bg-150: #1e1f1f;
- --wui-color-bg-175: #222525;
- --wui-color-bg-200: #272a2a;
- --wui-color-bg-225: #2c3030;
- --wui-color-bg-250: #313535;
- --wui-color-bg-275: #363b3b;
- --wui-color-bg-300: #3b4040;
- --wui-color-bg-325: #252525;
- --wui-color-bg-350: #ffffff;
- --wui-color-success-base-100: #26d962;
- --wui-color-success-base-125: #30a46b;
- --wui-color-warning-base-100: #f3a13f;
- --wui-color-error-base-100: #f25a67;
- --wui-color-error-base-125: #df4a34;
- --wui-color-blue-base-100: rgba(102, 125, 255, 1);
- --wui-color-blue-base-90: rgba(102, 125, 255, 0.9);
- --wui-color-success-glass-001: rgba(38, 217, 98, 0.01);
- --wui-color-success-glass-002: rgba(38, 217, 98, 0.02);
- --wui-color-success-glass-005: rgba(38, 217, 98, 0.05);
- --wui-color-success-glass-010: rgba(38, 217, 98, 0.1);
- --wui-color-success-glass-015: rgba(38, 217, 98, 0.15);
- --wui-color-success-glass-020: rgba(38, 217, 98, 0.2);
- --wui-color-success-glass-025: rgba(38, 217, 98, 0.25);
- --wui-color-success-glass-030: rgba(38, 217, 98, 0.3);
- --wui-color-success-glass-060: rgba(38, 217, 98, 0.6);
- --wui-color-success-glass-080: rgba(38, 217, 98, 0.8);
- --wui-color-success-glass-reown-020: rgba(48, 164, 107, 0.2);
- --wui-color-warning-glass-reown-020: rgba(243, 161, 63, 0.2);
- --wui-color-error-glass-001: rgba(242, 90, 103, 0.01);
- --wui-color-error-glass-002: rgba(242, 90, 103, 0.02);
- --wui-color-error-glass-005: rgba(242, 90, 103, 0.05);
- --wui-color-error-glass-010: rgba(242, 90, 103, 0.1);
- --wui-color-error-glass-015: rgba(242, 90, 103, 0.15);
- --wui-color-error-glass-020: rgba(242, 90, 103, 0.2);
- --wui-color-error-glass-025: rgba(242, 90, 103, 0.25);
- --wui-color-error-glass-030: rgba(242, 90, 103, 0.3);
- --wui-color-error-glass-060: rgba(242, 90, 103, 0.6);
- --wui-color-error-glass-080: rgba(242, 90, 103, 0.8);
- --wui-color-error-glass-reown-020: rgba(223, 74, 52, 0.2);
- --wui-color-gray-glass-001: rgba(255, 255, 255, 0.01);
- --wui-color-gray-glass-002: rgba(255, 255, 255, 0.02);
- --wui-color-gray-glass-005: rgba(255, 255, 255, 0.05);
- --wui-color-gray-glass-010: rgba(255, 255, 255, 0.1);
- --wui-color-gray-glass-015: rgba(255, 255, 255, 0.15);
- --wui-color-gray-glass-020: rgba(255, 255, 255, 0.2);
- --wui-color-gray-glass-025: rgba(255, 255, 255, 0.25);
- --wui-color-gray-glass-030: rgba(255, 255, 255, 0.3);
- --wui-color-gray-glass-060: rgba(255, 255, 255, 0.6);
- --wui-color-gray-glass-080: rgba(255, 255, 255, 0.8);
- --wui-color-gray-glass-090: rgba(255, 255, 255, 0.9);
- --wui-color-dark-glass-100: rgba(42, 42, 42, 1);
- --wui-icon-box-bg-error-base-100: #3c2426;
- --wui-icon-box-bg-blue-base-100: #20303f;
- --wui-icon-box-bg-success-base-100: #1f3a28;
- --wui-icon-box-bg-inverse-base-100: #243240;
- --wui-all-wallets-bg-100: #222b35;
- --wui-avatar-border-base: #252525;
- --wui-thumbnail-border-base: #252525;
- --wui-wallet-button-bg-base: var(--wui-color-bg-125);
- --w3m-card-embedded-shadow-color: rgb(17 17 18 / 25%);
- }
- `,dark:de`
- :root {
- --w3m-color-mix: ${Vs((t==null?void 0:t["--w3m-color-mix"])||"#000")};
- --w3m-accent: ${Vs(za(t,"light")["--w3m-accent"])};
- --w3m-default: #000;
- --wui-color-modal-bg-base: ${Vs(za(t,"light")["--w3m-background"])};
- --wui-color-accent-base-100: var(--w3m-accent);
- --wui-color-blueberry-100: hsla(231, 100%, 70%, 1);
- --wui-color-blueberry-090: hsla(231, 97%, 72%, 1);
- --wui-color-blueberry-080: hsla(231, 92%, 74%, 1);
- --wui-color-fg-100: #141414;
- --wui-color-fg-125: #2d3131;
- --wui-color-fg-150: #474d4d;
- --wui-color-fg-175: #636d6d;
- --wui-color-fg-200: #798686;
- --wui-color-fg-225: #828f8f;
- --wui-color-fg-250: #8b9797;
- --wui-color-fg-275: #95a0a0;
- --wui-color-fg-300: #9ea9a9;
- --wui-color-fg-325: #9a9a9a;
- --wui-color-fg-350: #d0d0d0;
- --wui-color-bg-100: #ffffff;
- --wui-color-bg-125: #f5fafa;
- --wui-color-bg-150: #f3f8f8;
- --wui-color-bg-175: #eef4f4;
- --wui-color-bg-200: #eaf1f1;
- --wui-color-bg-225: #e5eded;
- --wui-color-bg-250: #e1e9e9;
- --wui-color-bg-275: #dce7e7;
- --wui-color-bg-300: #d8e3e3;
- --wui-color-bg-325: #f3f3f3;
- --wui-color-bg-350: #202020;
- --wui-color-success-base-100: #26b562;
- --wui-color-success-base-125: #30a46b;
- --wui-color-warning-base-100: #f3a13f;
- --wui-color-error-base-100: #f05142;
- --wui-color-error-base-125: #df4a34;
- --wui-color-blue-base-100: rgba(102, 125, 255, 1);
- --wui-color-blue-base-90: rgba(102, 125, 255, 0.9);
- --wui-color-success-glass-001: rgba(38, 181, 98, 0.01);
- --wui-color-success-glass-002: rgba(38, 181, 98, 0.02);
- --wui-color-success-glass-005: rgba(38, 181, 98, 0.05);
- --wui-color-success-glass-010: rgba(38, 181, 98, 0.1);
- --wui-color-success-glass-015: rgba(38, 181, 98, 0.15);
- --wui-color-success-glass-020: rgba(38, 181, 98, 0.2);
- --wui-color-success-glass-025: rgba(38, 181, 98, 0.25);
- --wui-color-success-glass-030: rgba(38, 181, 98, 0.3);
- --wui-color-success-glass-060: rgba(38, 181, 98, 0.6);
- --wui-color-success-glass-080: rgba(38, 181, 98, 0.8);
- --wui-color-success-glass-reown-020: rgba(48, 164, 107, 0.2);
- --wui-color-warning-glass-reown-020: rgba(243, 161, 63, 0.2);
- --wui-color-error-glass-001: rgba(240, 81, 66, 0.01);
- --wui-color-error-glass-002: rgba(240, 81, 66, 0.02);
- --wui-color-error-glass-005: rgba(240, 81, 66, 0.05);
- --wui-color-error-glass-010: rgba(240, 81, 66, 0.1);
- --wui-color-error-glass-015: rgba(240, 81, 66, 0.15);
- --wui-color-error-glass-020: rgba(240, 81, 66, 0.2);
- --wui-color-error-glass-025: rgba(240, 81, 66, 0.25);
- --wui-color-error-glass-030: rgba(240, 81, 66, 0.3);
- --wui-color-error-glass-060: rgba(240, 81, 66, 0.6);
- --wui-color-error-glass-080: rgba(240, 81, 66, 0.8);
- --wui-color-error-glass-reown-020: rgba(223, 74, 52, 0.2);
- --wui-icon-box-bg-error-base-100: #f4dfdd;
- --wui-icon-box-bg-blue-base-100: #d9ecfb;
- --wui-icon-box-bg-success-base-100: #daf0e4;
- --wui-icon-box-bg-inverse-base-100: #dcecfc;
- --wui-all-wallets-bg-100: #e8f1fa;
- --wui-avatar-border-base: #f3f4f4;
- --wui-thumbnail-border-base: #eaefef;
- --wui-wallet-button-bg-base: var(--wui-color-bg-125);
- --wui-color-gray-glass-001: rgba(0, 0, 0, 0.01);
- --wui-color-gray-glass-002: rgba(0, 0, 0, 0.02);
- --wui-color-gray-glass-005: rgba(0, 0, 0, 0.05);
- --wui-color-gray-glass-010: rgba(0, 0, 0, 0.1);
- --wui-color-gray-glass-015: rgba(0, 0, 0, 0.15);
- --wui-color-gray-glass-020: rgba(0, 0, 0, 0.2);
- --wui-color-gray-glass-025: rgba(0, 0, 0, 0.25);
- --wui-color-gray-glass-030: rgba(0, 0, 0, 0.3);
- --wui-color-gray-glass-060: rgba(0, 0, 0, 0.6);
- --wui-color-gray-glass-080: rgba(0, 0, 0, 0.8);
- --wui-color-gray-glass-090: rgba(0, 0, 0, 0.9);
- --wui-color-dark-glass-100: rgba(233, 233, 233, 1);
- --w3m-card-embedded-shadow-color: rgb(224 225 233 / 25%);
- }
- `}}const He=de`
- *,
- *::after,
- *::before,
- :host {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- font-style: normal;
- text-rendering: optimizeSpeed;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- -webkit-tap-highlight-color: transparent;
- font-family: var(--wui-font-family);
- backface-visibility: hidden;
- }
- `,vt=de`
- button,
- a {
- cursor: pointer;
- display: flex;
- justify-content: center;
- align-items: center;
- position: relative;
- transition:
- color var(--wui-duration-lg) var(--wui-ease-out-power-1),
- background-color var(--wui-duration-lg) var(--wui-ease-out-power-1),
- border var(--wui-duration-lg) var(--wui-ease-out-power-1),
- border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1),
- box-shadow var(--wui-duration-lg) var(--wui-ease-out-power-1);
- will-change: background-color, color, border, box-shadow, border-radius;
- outline: none;
- border: none;
- column-gap: var(--wui-spacing-3xs);
- background-color: transparent;
- text-decoration: none;
- }
- wui-flex {
- transition: border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1);
- will-change: border-radius;
- }
- button:disabled > wui-wallet-image,
- button:disabled > wui-all-wallets-image,
- button:disabled > wui-network-image,
- button:disabled > wui-image,
- button:disabled > wui-transaction-visual,
- button:disabled > wui-logo {
- filter: grayscale(1);
- }
- @media (hover: hover) and (pointer: fine) {
- button:hover:enabled {
- background-color: var(--wui-color-gray-glass-005);
- }
- button:active:enabled {
- background-color: var(--wui-color-gray-glass-010);
- }
- }
- button:disabled > wui-icon-box {
- opacity: 0.5;
- }
- input {
- border: none;
- outline: none;
- appearance: none;
- }
- `,qv=de`
- .wui-color-inherit {
- color: var(--wui-color-inherit);
- }
- .wui-color-accent-100 {
- color: var(--wui-color-accent-100);
- }
- .wui-color-error-100 {
- color: var(--wui-color-error-100);
- }
- .wui-color-blue-100 {
- color: var(--wui-color-blue-100);
- }
- .wui-color-blue-90 {
- color: var(--wui-color-blue-90);
- }
- .wui-color-error-125 {
- color: var(--wui-color-error-125);
- }
- .wui-color-success-100 {
- color: var(--wui-color-success-100);
- }
- .wui-color-success-125 {
- color: var(--wui-color-success-125);
- }
- .wui-color-inverse-100 {
- color: var(--wui-color-inverse-100);
- }
- .wui-color-inverse-000 {
- color: var(--wui-color-inverse-000);
- }
- .wui-color-fg-100 {
- color: var(--wui-color-fg-100);
- }
- .wui-color-fg-200 {
- color: var(--wui-color-fg-200);
- }
- .wui-color-fg-300 {
- color: var(--wui-color-fg-300);
- }
- .wui-color-fg-325 {
- color: var(--wui-color-fg-325);
- }
- .wui-color-fg-350 {
- color: var(--wui-color-fg-350);
- }
- .wui-bg-color-inherit {
- background-color: var(--wui-color-inherit);
- }
- .wui-bg-color-blue-100 {
- background-color: var(--wui-color-accent-100);
- }
- .wui-bg-color-error-100 {
- background-color: var(--wui-color-error-100);
- }
- .wui-bg-color-error-125 {
- background-color: var(--wui-color-error-125);
- }
- .wui-bg-color-success-100 {
- background-color: var(--wui-color-success-100);
- }
- .wui-bg-color-success-125 {
- background-color: var(--wui-color-success-100);
- }
- .wui-bg-color-inverse-100 {
- background-color: var(--wui-color-inverse-100);
- }
- .wui-bg-color-inverse-000 {
- background-color: var(--wui-color-inverse-000);
- }
- .wui-bg-color-fg-100 {
- background-color: var(--wui-color-fg-100);
- }
- .wui-bg-color-fg-200 {
- background-color: var(--wui-color-fg-200);
- }
- .wui-bg-color-fg-300 {
- background-color: var(--wui-color-fg-300);
- }
- .wui-color-fg-325 {
- background-color: var(--wui-color-fg-325);
- }
- .wui-color-fg-350 {
- background-color: var(--wui-color-fg-350);
- }
- `,nt={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--wui-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--wui-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},getHostName(t){try{return new URL(t).hostname}catch{return""}},getTruncateString({string:t,charsStart:e,charsEnd:r,truncate:n}){return t.length<=e+r?t:n==="end"?`${t.substring(0,e)}...`:n==="start"?`...${t.substring(t.length-r)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(r))}`},generateAvatarColors(t){const r=t.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),n=this.hexToRgb(r),i=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),o=100-3*Number(i==null?void 0:i.replace("px","")),a=`${o}% ${o}% at 65% 40%`,c=[];for(let u=0;u<5;u+=1){const l=this.tintColor(n,.15*u);c.push(`rgb(${l[0]}, ${l[1]}, ${l[2]})`)}return`
- --local-color-1: ${c[0]};
- --local-color-2: ${c[1]};
- --local-color-3: ${c[2]};
- --local-color-4: ${c[3]};
- --local-color-5: ${c[4]};
- --local-radial-circle: ${a}
- `},hexToRgb(t){const e=parseInt(t,16),r=e>>16&255,n=e>>8&255,i=e&255;return[r,n,i]},tintColor(t,e){const[r,n,i]=t,s=Math.round(r+(255-r)*e),o=Math.round(n+(255-n)*e),a=Math.round(i+(255-i)*e);return[s,o,a]},isNumber(t){return{number:/^[0-9]+$/u}.number.test(t)},getColorTheme(t){var e;return t||(typeof window<"u"&&window.matchMedia?(e=window.matchMedia("(prefers-color-scheme: dark)"))!=null&&e.matches?"dark":"light":"dark")},splitBalance(t){const e=t.split(".");return e.length===2?[e[0],e[1]]:["0","00"]},roundNumber(t,e,r){return t.toString().length>=e?Number(t).toFixed(r):t},formatNumberToLocalString(t,e=2){return t===void 0?"0.00":typeof t=="number"?t.toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e}):parseFloat(t).toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e})}},h_e=3,f_e=["receive","deposit","borrow","claim"],p_e=["withdraw","repay","burn"],Xh={getTransactionGroupTitle(t,e){const r=bC.getYear(),n=bC.getMonthNameByIndex(e);return t===r?n:`${n} ${t}`},getTransactionImages(t){const[e,r]=t,n=!!e&&(t==null?void 0:t.every(o=>!!o.nft_info)),i=(t==null?void 0:t.length)>1;return(t==null?void 0:t.length)===2&&!n?[this.getTransactionImage(e),this.getTransactionImage(r)]:i?t.map(o=>this.getTransactionImage(o)):[this.getTransactionImage(e)]},getTransactionImage(t){return{type:Xh.getTransactionTransferTokenType(t),url:Xh.getTransactionImageURL(t)}},getTransactionImageURL(t){var i,s,o,a,c;let e;const r=!!(t!=null&&t.nft_info),n=!!(t!=null&&t.fungible_info);return t&&r?e=(o=(s=(i=t==null?void 0:t.nft_info)==null?void 0:i.content)==null?void 0:s.preview)==null?void 0:o.url:t&&n&&(e=(c=(a=t==null?void 0:t.fungible_info)==null?void 0:a.icon)==null?void 0:c.url),e},getTransactionTransferTokenType(t){if(t!=null&&t.fungible_info)return"FUNGIBLE";if(t!=null&&t.nft_info)return"NFT"},getTransactionDescriptions(t){var d,h,f;const e=(d=t==null?void 0:t.metadata)==null?void 0:d.operationType,r=t==null?void 0:t.transfers,n=((h=t==null?void 0:t.transfers)==null?void 0:h.length)>0,i=((f=t==null?void 0:t.transfers)==null?void 0:f.length)>1,s=n&&(r==null?void 0:r.every(g=>!!(g!=null&&g.fungible_info))),[o,a]=r;let c=this.getTransferDescription(o),u=this.getTransferDescription(a);if(!n)return(e==="send"||e==="receive")&&s?(c=nt.getTruncateString({string:t==null?void 0:t.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),u=nt.getTruncateString({string:t==null?void 0:t.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[c,u]):[t.metadata.status];if(i)return r.map(g=>this.getTransferDescription(g));let l="";return f_e.includes(e)?l="+":p_e.includes(e)&&(l="-"),c=l.concat(c),[c]},getTransferDescription(t){var r;let e="";return t&&(t!=null&&t.nft_info?e=((r=t==null?void 0:t.nft_info)==null?void 0:r.name)||"-":t!=null&&t.fungible_info&&(e=this.getFungibleTransferDescription(t)||"-")),e},getFungibleTransferDescription(t){var n;return t?[this.getQuantityFixedValue(t==null?void 0:t.quantity.numeric),(n=t==null?void 0:t.fungible_info)==null?void 0:n.symbol].join(" ").trim():null},getQuantityFixedValue(t){return t?parseFloat(t).toFixed(h_e):null}};function g_e(t,e){const{kind:r,elements:n}=e;return{kind:r,elements:n,finisher(i){customElements.get(t)||customElements.define(t,i)}}}function m_e(t,e){return customElements.get(t)||customElements.define(t,e),e}function te(t){return function(r){return typeof r=="function"?m_e(t,r):g_e(t,r)}}const wu={ERROR_CODE_UNRECOGNIZED_CHAIN_ID:4902,ERROR_CODE_DEFAULT:5e3,ERROR_INVALID_CHAIN_ID:32603,DEFAULT_ALLOWED_ANCESTORS:["http://localhost:*","https://*.pages.dev","https://*.vercel.app","https://*.ngrok-free.app","https://secure-mobile.walletconnect.com","https://secure-mobile.walletconnect.org"]},w_e={solana:["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts","solana_signAllTransactions","solana_signAndSendTransaction"],eip155:["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_showCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"],bip122:["sendTransfer","signMessage","signPsbt","getAccountAddresses"]},tC={getMethodsByChainNamespace(t){return w_e[t]||[]},createDefaultNamespace(t){return{methods:this.getMethodsByChainNamespace(t),events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}}},applyNamespaceOverrides(t,e){if(!e)return{...t};const r={...t},n=new Set;if(e.methods&&Object.keys(e.methods).forEach(i=>n.add(i)),e.chains&&Object.keys(e.chains).forEach(i=>n.add(i)),e.events&&Object.keys(e.events).forEach(i=>n.add(i)),e.rpcMap&&Object.keys(e.rpcMap).forEach(i=>{const[s]=i.split(":");s&&n.add(s)}),n.forEach(i=>{r[i]||(r[i]=this.createDefaultNamespace(i))}),e.methods&&Object.entries(e.methods).forEach(([i,s])=>{r[i]&&(r[i].methods=s)}),e.chains&&Object.entries(e.chains).forEach(([i,s])=>{r[i]&&(r[i].chains=s)}),e.events&&Object.entries(e.events).forEach(([i,s])=>{r[i]&&(r[i].events=s)}),e.rpcMap){const i=new Set;Object.entries(e.rpcMap).forEach(([s,o])=>{const[a,c]=s.split(":");!a||!c||!r[a]||(r[a].rpcMap||(r[a].rpcMap={}),i.has(a)||(r[a].rpcMap={},i.add(a)),r[a].rpcMap[c]=o)})}return r},createNamespaces(t,e){const r=t.reduce((n,i)=>{const{id:s,chainNamespace:o,rpcUrls:a}=i,c=a.default.http[0];n[o]||(n[o]=this.createDefaultNamespace(o));const u=`${o}:${s}`,l=n[o];switch(l.chains.push(u),u){case UR.caipNetworkId:l.chains.push(UR.deprecatedCaipNetworkId);break;case FR.caipNetworkId:l.chains.push(FR.deprecatedCaipNetworkId);break}return l!=null&&l.rpcMap&&c&&(l.rpcMap[s]=c),n},{});return this.applyNamespaceOverrides(r,e)},resolveReownName:async t=>{var n;const e=await ys.resolveName(t);return((n=(Object.values(e==null?void 0:e.addresses)||[])[0])==null?void 0:n.address)||!1},getChainsFromNamespaces(t={}){return Object.values(t).flatMap(e=>{const r=e.chains||[],n=e.accounts.map(i=>{const[s,o]=i.split(":");return`${s}:${o}`});return Array.from(new Set([...r,...n]))})},isSessionEventData(t){return typeof t=="object"&&t!==null&&"id"in t&&"topic"in t&&"params"in t&&typeof t.params=="object"&&t.params!==null&&"chainId"in t.params&&"event"in t.params&&typeof t.params.event=="object"&&t.params.event!==null},isOriginAllowed(t,e,r){for(const n of[...e,...r])if(n.includes("*")){const s=`^${n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&").replace(/\\\*/gu,".*")}$`;if(new RegExp(s,"u").test(t))return!0}else try{if(new URL(n).origin===t)return!0}catch{if(n===t)return!0}return!1}};class l7{constructor({provider:e,namespace:r}){this.id=_e.CONNECTOR_ID.WALLET_CONNECT,this.name=Ua.ConnectorNamesMap[_e.CONNECTOR_ID.WALLET_CONNECT],this.type="WALLET_CONNECT",this.imageId=Ua.ConnectorImageIds[_e.CONNECTOR_ID.WALLET_CONNECT],this.getCaipNetworks=F.getCaipNetworks.bind(F),this.caipNetworks=this.getCaipNetworks(),this.provider=e,this.chain=r}get chains(){return this.getCaipNetworks()}async connectWalletConnect(){if(!await this.authenticate()){const r=this.getCaipNetworks(),n=oe.state.universalProviderConfigOverride,i=tC.createNamespaces(r,n);await this.provider.connect({optionalNamespaces:i})}return{clientId:await this.provider.client.core.crypto.getClientId(),session:this.provider.session}}async disconnect(){await this.provider.disconnect()}async authenticate(){const e=this.chains.map(r=>r.caipNetworkId);return Cu.universalProviderAuthenticate({universalProvider:this.provider,chains:e,methods:b_e})}}const b_e=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"];class LZ{constructor(e){this.availableConnectors=[],this.eventListeners=new Map,this.getCaipNetworks=r=>F.getCaipNetworks(r),e&&this.construct(e)}construct(e){this.projectId=e.projectId,this.namespace=e.namespace,this.adapterType=e.adapterType}get connectors(){return this.availableConnectors}get networks(){return this.getCaipNetworks(this.namespace)}setAuthProvider(e){this.addConnector({id:_e.CONNECTOR_ID.AUTH,type:"AUTH",name:_e.CONNECTOR_NAMES.AUTH,provider:e,imageId:Ua.ConnectorImageIds[_e.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}addConnector(...e){const r=new Set;this.availableConnectors=[...e,...this.availableConnectors].filter(n=>r.has(n.id)?!1:(r.add(n.id),!0)),this.emit("connectors",this.availableConnectors)}setStatus(e,r){re.setStatus(e,r)}on(e,r){var n;this.eventListeners.has(e)||this.eventListeners.set(e,new Set),(n=this.eventListeners.get(e))==null||n.add(r)}off(e,r){const n=this.eventListeners.get(e);n&&n.delete(r)}removeAllEventListeners(){this.eventListeners.forEach(e=>{e.clear()})}emit(e,r){const n=this.eventListeners.get(e);n&&n.forEach(i=>i(r))}async connectWalletConnect(e){return{clientId:(await this.getWalletConnectConnector().connectWalletConnect()).clientId}}async switchNetwork(e){var s;const{caipNetwork:r,providerType:n}=e;if(!e.provider)return;const i="provider"in e.provider?e.provider.provider:e.provider;if(n==="WALLET_CONNECT"){i.setDefaultChain(r.caipNetworkId);return}if(i&&n==="AUTH"){const o=i,a=(s=re.state.preferredAccountTypes)==null?void 0:s[r.chainNamespace];await o.switchNetwork(r.caipNetworkId);const c=await o.getUser({chainId:r.caipNetworkId,preferredAccountType:a});this.emit("switchNetwork",c)}}getWalletConnectConnector(){const e=this.connectors.find(r=>r instanceof l7);if(!e)throw new Error("WalletConnectConnector not found");return e}}class y_e extends LZ{setUniversalProvider(e){this.addConnector(new l7({provider:e,caipNetworks:this.getCaipNetworks(),namespace:this.namespace}))}async connect(e){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:Number(e.chainId),provider:this.provider,address:""})}async disconnect(){try{await this.getWalletConnectConnector().disconnect()}catch(e){console.warn("UniversalAdapter:disconnect - error",e)}}async getAccounts({namespace:e}){var i,s,o,a;const r=this.provider,n=((a=(o=(s=(i=r==null?void 0:r.session)==null?void 0:i.namespaces)==null?void 0:s[e])==null?void 0:o.accounts)==null?void 0:a.map(c=>{const[,,u]=c.split(":");return u}).filter((c,u,l)=>l.indexOf(c)===u))||[];return Promise.resolve({accounts:n.map(c=>ue.createAccount(e,c,e==="bip122"?"payment":"eoa"))})}async syncConnectors(){return Promise.resolve()}async getBalance(e){var s,o,a,c,u;if(!(e.caipNetwork&&ct.BALANCE_SUPPORTED_CHAINS.includes((s=e.caipNetwork)==null?void 0:s.chainNamespace))||(o=e.caipNetwork)!=null&&o.testnet)return{balance:"0.00",symbol:((a=e.caipNetwork)==null?void 0:a.nativeCurrency.symbol)||""};if(re.state.balanceLoading&&e.chainId===((c=F.state.activeCaipNetwork)==null?void 0:c.id))return{balance:re.state.balance||"0.00",symbol:re.state.balanceSymbol||""};const i=(await re.fetchTokenBalance()).find(l=>{var d,h;return l.chainId===`${(d=e.caipNetwork)==null?void 0:d.chainNamespace}:${e.chainId}`&&l.symbol===((h=e.caipNetwork)==null?void 0:h.nativeCurrency.symbol)});return{balance:(i==null?void 0:i.quantity.numeric)||"0.00",symbol:(i==null?void 0:i.symbol)||((u=e.caipNetwork)==null?void 0:u.nativeCurrency.symbol)||""}}async signMessage(e){var o,a,c;const{provider:r,message:n,address:i}=e;if(!r)throw new Error("UniversalAdapter:signMessage - provider is undefined");let s="";return((o=F.state.activeCaipNetwork)==null?void 0:o.chainNamespace)===_e.CHAIN.SOLANA?s=(await r.request({method:"solana_signMessage",params:{message:KG.encode(new TextEncoder().encode(n)),pubkey:i}},(a=F.state.activeCaipNetwork)==null?void 0:a.caipNetworkId)).signature:s=await r.request({method:"personal_sign",params:[n,i]},(c=F.state.activeCaipNetwork)==null?void 0:c.caipNetworkId),{signature:s}}async estimateGas(){return Promise.resolve({gas:BigInt(0)})}async sendTransaction(){return Promise.resolve({hash:""})}walletGetAssets(e){return Promise.resolve({})}async writeContract(){return Promise.resolve({hash:""})}parseUnits(){return 0n}formatUnits(){return"0"}async getCapabilities(){return Promise.resolve({})}async grantPermissions(){return Promise.resolve({})}async revokePermissions(){return Promise.resolve("0x")}async syncConnection(){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:1,provider:this.provider,address:""})}async switchNetwork(e){var i,s,o,a,c,u;const{caipNetwork:r}=e,n=this.getWalletConnectConnector();if(r.chainNamespace===_e.CHAIN.EVM)try{await((i=n.provider)==null?void 0:i.request({method:"wallet_switchEthereumChain",params:[{chainId:Tb(r.id)}]}))}catch(l){if(l.code===wu.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||l.code===wu.ERROR_INVALID_CHAIN_ID||l.code===wu.ERROR_CODE_DEFAULT||((o=(s=l==null?void 0:l.data)==null?void 0:s.originalError)==null?void 0:o.code)===wu.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)try{await((u=n.provider)==null?void 0:u.request({method:"wallet_addEthereumChain",params:[{chainId:Tb(r.id),rpcUrls:[(a=r==null?void 0:r.rpcUrls.chainDefault)==null?void 0:a.http],chainName:r.name,nativeCurrency:r.nativeCurrency,blockExplorerUrls:[(c=r.blockExplorers)==null?void 0:c.default.url]}]}))}catch{throw new Error("Chain is not supported")}}n.provider.setDefaultChain(r.caipNetworkId)}getWalletConnectProvider(){const e=this.connectors.find(n=>n.type==="WALLET_CONNECT");return e==null?void 0:e.provider}}const v_e=["email","socials","swaps","onramp","activity","reownBranding"],y3={email:{apiFeatureName:"social_login",localFeatureName:"email",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>{if(!(t!=null&&t.config))return!1;const e=t.config;return!!t.isEnabled&&e.includes("email")},processFallback:t=>t===void 0?ct.DEFAULT_REMOTE_FEATURES.email:!!t},socials:{apiFeatureName:"social_login",localFeatureName:"socials",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>{if(!(t!=null&&t.config))return!1;const e=t.config;return t.isEnabled&&e.length>0?e.filter(r=>r!=="email"):!1},processFallback:t=>t===void 0?ct.DEFAULT_REMOTE_FEATURES.socials:typeof t=="boolean"?t?ct.DEFAULT_REMOTE_FEATURES.socials:!1:t},swaps:{apiFeatureName:"swap",localFeatureName:"swaps",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>{if(!(t!=null&&t.config))return!1;const e=t.config;return t.isEnabled&&e.length>0?e:!1},processFallback:t=>t===void 0?ct.DEFAULT_REMOTE_FEATURES.swaps:typeof t=="boolean"?t?ct.DEFAULT_REMOTE_FEATURES.swaps:!1:t},onramp:{apiFeatureName:"onramp",localFeatureName:"onramp",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>{if(!(t!=null&&t.config))return!1;const e=t.config;return t.isEnabled&&e.length>0?e:!1},processFallback:t=>t===void 0?ct.DEFAULT_REMOTE_FEATURES.onramp:typeof t=="boolean"?t?ct.DEFAULT_REMOTE_FEATURES.onramp:!1:t},activity:{apiFeatureName:"activity",localFeatureName:"history",returnType:!1,isLegacy:!0,isAvailableOnBasic:!1,processApi:t=>!!t.isEnabled,processFallback:t=>t===void 0?ct.DEFAULT_REMOTE_FEATURES.activity:!!t},reownBranding:{apiFeatureName:"reown_branding",localFeatureName:"reownBranding",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>!!t.isEnabled,processFallback:t=>t===void 0?ct.DEFAULT_REMOTE_FEATURES.reownBranding:!!t}},__e={localSettingsOverridden:new Set,getApiConfig(t,e){return e==null?void 0:e.find(r=>r.id===t)},addWarning(t,e){if(t!==void 0){const r=y3[e],n=r.isLegacy?`"features.${r.localFeatureName}" (now "${e}")`:`"features.${e}"`;this.localSettingsOverridden.add(n)}},processFeature(t,e,r,n,i){const s=y3[t],o=e[s.localFeatureName];if(i&&!s.isAvailableOnBasic)return!1;if(n){const a=this.getApiConfig(s.apiFeatureName,r);return(a==null?void 0:a.config)===null?this.processFallbackFeature(t,o):a!=null&&a.config?(o!==void 0&&this.addWarning(o,t),this.processApiFeature(t,a)):!1}return this.processFallbackFeature(t,o)},processApiFeature(t,e){return y3[t].processApi(e)},processFallbackFeature(t,e){return y3[t].processFallback(e)},async fetchRemoteFeatures(t){const e=t.basic??!1,r=t.features||{};this.localSettingsOverridden.clear();let n=null,i=!1;try{n=await Ne.fetchProjectConfig(),i=n!=null}catch(o){console.warn("[Reown Config] Failed to fetch remote project configuration. Using local/default values.",o)}const s=i&&!e?ct.DEFAULT_REMOTE_FEATURES:ct.DEFAULT_REMOTE_FEATURES_DISABLED;try{for(const o of v_e){const a=this.processFeature(o,r,n,i,e);Object.assign(s,{[o]:a})}}catch(o){return console.warn("[Reown Config] Failed to process the configuration from Cloud. Using default values.",o),ct.DEFAULT_REMOTE_FEATURES}if(i&&this.localSettingsOverridden.size>0){const o=`Your local configuration for ${Array.from(this.localSettingsOverridden).join(", ")} was ignored because a remote configuration was successfully fetched. Please manage these features via your project dashboard on dashboard.reown.com.`;Fn.open({shortMessage:"Local configuration ignored",longMessage:`[Reown Config Notice] ${o}`},"warning")}return s}};class E_e{constructor(e){this.chainNamespaces=[],this.remoteFeatures={},this.reportedAlertErrors={},this.getCaipNetwork=(r,n)=>{var i,s,o,a;if(r){const c=(s=(i=F.getNetworkData(r))==null?void 0:i.requestedCaipNetworks)==null?void 0:s.find(d=>d.id===n);if(c)return c;const u=(o=F.getNetworkData(r))==null?void 0:o.caipNetwork;return u||((a=F.getRequestedCaipNetworks(r).filter(d=>d.chainNamespace===r))==null?void 0:a[0])}return F.state.activeCaipNetwork||this.defaultCaipNetwork},this.getCaipNetworkId=()=>{const r=this.getCaipNetwork();if(r)return r.id},this.getCaipNetworks=r=>F.getCaipNetworks(r),this.getActiveChainNamespace=()=>F.state.activeChain,this.setRequestedCaipNetworks=(r,n)=>{F.setRequestedCaipNetworks(r,n)},this.getApprovedCaipNetworkIds=()=>F.getAllApprovedCaipNetworkIds(),this.getCaipAddress=r=>F.state.activeChain===r||!r?F.state.activeCaipAddress:F.getAccountProp("caipAddress",r),this.setClientId=r=>{Xe.setClientId(r)},this.getProvider=r=>kt.getProvider(r),this.getProviderType=r=>kt.getProviderId(r),this.getPreferredAccountType=r=>{var n;return(n=re.state.preferredAccountTypes)==null?void 0:n[r]},this.setCaipAddress=(r,n)=>{re.setCaipAddress(r,n),r&&oe.state.enableEmbedded&&this.close()},this.setBalance=(r,n,i)=>{re.setBalance(r,n,i)},this.setProfileName=(r,n)=>{re.setProfileName(r,n)},this.setProfileImage=(r,n)=>{re.setProfileImage(r,n)},this.setUser=(r,n)=>{re.setUser(r,n)},this.resetAccount=r=>{re.resetAccount(r)},this.setCaipNetwork=r=>{F.setActiveCaipNetwork(r)},this.setCaipNetworkOfNamespace=(r,n)=>{F.setChainNetworkData(n,{caipNetwork:r})},this.setAllAccounts=(r,n)=>{re.setAllAccounts(r,n),oe.setHasMultipleAddresses((r==null?void 0:r.length)>1)},this.setStatus=(r,n)=>{re.setStatus(r,n),ge.isConnected()?Le.setConnectionStatus("connected"):Le.setConnectionStatus("disconnected")},this.getAddressByChainNamespace=r=>F.getAccountProp("address",r),this.setConnectors=r=>{const n=[...ge.state.allConnectors,...r];ge.setConnectors(n)},this.setConnections=(r,n)=>{xe.setConnections(r,n)},this.fetchIdentity=r=>Xe.fetchIdentity(r),this.getReownName=r=>ys.getNamesForAddress(r),this.getConnectors=()=>ge.getConnectors(),this.getConnectorImage=r=>pt.getConnectorImage(r),this.setConnectedWalletInfo=(r,n)=>{const i=kt.getProviderId(n),s=r?{...r,type:i}:void 0;re.setConnectedWalletInfo(s,n)},this.getIsConnectedState=()=>!!F.state.activeCaipAddress,this.addAddressLabel=(r,n,i)=>{re.addAddressLabel(r,n,i)},this.removeAddressLabel=(r,n)=>{re.removeAddressLabel(r,n)},this.getAddress=r=>F.state.activeChain===r||!r?re.state.address:F.getAccountProp("address",r),this.setApprovedCaipNetworksData=r=>F.setApprovedCaipNetworksData(r),this.resetNetwork=r=>{F.resetNetwork(r)},this.addConnector=r=>{ge.addConnector(r)},this.resetWcConnection=()=>{xe.resetWcConnection()},this.setAddressExplorerUrl=(r,n)=>{re.setAddressExplorerUrl(r,n)},this.setSmartAccountDeployed=(r,n)=>{re.setSmartAccountDeployed(r,n)},this.setSmartAccountEnabledNetworks=(r,n)=>{F.setSmartAccountEnabledNetworks(r,n)},this.setPreferredAccountType=(r,n)=>{re.setPreferredAccountType(r,n)},this.setEIP6963Enabled=r=>{oe.setEIP6963Enabled(r)},this.handleUnsafeRPCRequest=()=>{if(this.isOpen()){if(this.isTransactionStackEmpty())return;this.redirect("ApproveTransaction")}else this.open({view:"ApproveTransaction"})},this.options=e,this.version=e.sdkVersion,this.caipNetworks=this.extendCaipNetworks(e),this.chainNamespaces=this.getChainNamespacesSet(e.adapters,this.caipNetworks),this.defaultCaipNetwork=this.extendDefaultCaipNetwork(e),this.chainAdapters=this.createAdapters(e.adapters),this.readyPromise=this.initialize(e)}getChainNamespacesSet(e,r){const n=e==null?void 0:e.map(s=>s.namespace).filter(s=>!!s);if(n!=null&&n.length)return[...new Set(n)];const i=r==null?void 0:r.map(s=>s.chainNamespace);return[...new Set(i)]}async initialize(e){var r,n,i;this.initializeProjectSettings(e),this.initControllers(e),await this.initChainAdapters(),this.sendInitializeEvent(e),await this.syncExistingConnection(),this.remoteFeatures=await __e.fetchRemoteFeatures(e),oe.setRemoteFeatures(this.remoteFeatures),this.remoteFeatures.onramp&&$t.setOnrampProviders(this.remoteFeatures.onramp),((r=oe.state.remoteFeatures)!=null&&r.email||Array.isArray((n=oe.state.remoteFeatures)==null?void 0:n.socials)&&((i=oe.state.remoteFeatures)==null?void 0:i.socials.length)>0)&&await this.checkAllowedOrigins()}async checkAllowedOrigins(){const e=await Ne.fetchAllowedOrigins();if(e&&ue.isClient()){const r=window.location.origin;tC.isOriginAllowed(r,e,wu.DEFAULT_ALLOWED_ANCESTORS)||Fn.open(Do.ALERT_ERRORS.INVALID_APP_CONFIGURATION,"error")}else Fn.open(Do.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error")}sendInitializeEvent(e){var n;const{...r}=e;delete r.adapters,delete r.universalProvider,Re.sendEvent({type:"track",event:"INITIALIZE",properties:{...r,networks:e.networks.map(i=>i.id),siweConfig:{options:((n=e.siweConfig)==null?void 0:n.options)||{}}}})}initControllers(e){this.initializeOptionsController(e),this.initializeChainController(e),this.initializeThemeController(e),this.initializeConnectionController(e),this.initializeConnectorController()}initializeThemeController(e){e.themeMode&&ar.setThemeMode(e.themeMode),e.themeVariables&&ar.setThemeVariables(e.themeVariables)}initializeChainController(e){if(!this.connectionControllerClient||!this.networkControllerClient)throw new Error("ConnectionControllerClient and NetworkControllerClient must be set");F.initialize(e.adapters??[],this.caipNetworks,{connectionControllerClient:this.connectionControllerClient,networkControllerClient:this.networkControllerClient});const r=this.getDefaultNetwork();r&&F.setActiveCaipNetwork(r)}initializeConnectionController(e){xe.setWcBasic(e.basic??!1)}initializeConnectorController(){ge.initialize(this.chainNamespaces)}initializeProjectSettings(e){oe.setProjectId(e.projectId),oe.setSdkVersion(e.sdkVersion)}initializeOptionsController(e){var o;oe.setDebug(e.debug!==!1),oe.setEnableWalletConnect(e.enableWalletConnect!==!1),oe.setEnableWalletGuide(e.enableWalletGuide!==!1),oe.setEnableWallets(e.enableWallets!==!1),oe.setEIP6963Enabled(e.enableEIP6963!==!1),oe.setEnableNetworkSwitch(e.enableNetworkSwitch!==!1),oe.setEnableAuthLogger(e.enableAuthLogger!==!1),oe.setCustomRpcUrls(e.customRpcUrls),oe.setEnableEmbedded(e.enableEmbedded),oe.setAllWallets(e.allWallets),oe.setIncludeWalletIds(e.includeWalletIds),oe.setExcludeWalletIds(e.excludeWalletIds),oe.setFeaturedWalletIds(e.featuredWalletIds),oe.setTokens(e.tokens),oe.setTermsConditionsUrl(e.termsConditionsUrl),oe.setPrivacyPolicyUrl(e.privacyPolicyUrl),oe.setCustomWallets(e.customWallets),oe.setFeatures(e.features),oe.setAllowUnsupportedChain(e.allowUnsupportedChain),oe.setUniversalProviderConfigOverride(e.universalProviderConfigOverride),oe.setPreferUniversalLinks(e.experimental_preferUniversalLinks),oe.setDefaultAccountTypes(e.defaultAccountTypes);const r=Le.getPreferredAccountTypes()||{},n={...oe.state.defaultAccountTypes,...r};re.setPreferredAccountTypes(n);const i=this.getDefaultMetaData();if(!e.metadata&&i&&(e.metadata=i),oe.setMetadata(e.metadata),oe.setDisableAppend(e.disableAppend),oe.setEnableEmbedded(e.enableEmbedded),oe.setSIWX(e.siwx),!e.projectId){Fn.open(Do.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");return}if(((o=e.adapters)==null?void 0:o.find(a=>a.namespace===_e.CHAIN.EVM))&&e.siweConfig){if(e.siwx)throw new Error("Cannot set both `siweConfig` and `siwx` options");oe.setSIWX(e.siweConfig.mapToSIWX())}}getDefaultMetaData(){var e,r,n,i;return ue.isClient()?{name:((r=(e=document.getElementsByTagName("title"))==null?void 0:e[0])==null?void 0:r.textContent)||"",description:((n=document.querySelector('meta[property="og:description"]'))==null?void 0:n.content)||"",url:window.location.origin,icons:[((i=document.querySelector('link[rel~="icon"]'))==null?void 0:i.href)||""]}:null}setUnsupportedNetwork(e){const r=this.getActiveChainNamespace();if(r){const n=M0.getUnsupportedNetwork(`${r}:${e}`);F.setActiveCaipNetwork(n)}}getDefaultNetwork(){return M0.getCaipNetworkFromStorage(this.defaultCaipNetwork)}extendCaipNetwork(e,r){return M0.extendCaipNetwork(e,{customNetworkImageUrls:r.chainImages,projectId:r.projectId})}extendCaipNetworks(e){return M0.extendCaipNetworks(e.networks,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId})}extendDefaultCaipNetwork(e){const r=e.networks.find(i=>{var s;return i.id===((s=e.defaultNetwork)==null?void 0:s.id)});return r?M0.extendCaipNetwork(r,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId}):void 0}async disconnectNamespace(e){try{const r=this.getAdapter(e),n=kt.getProvider(e),i=kt.getProviderId(e),{caipAddress:s}=F.getAccountData(e)||{};this.setLoading(!0,e),s&&(r!=null&&r.disconnect)&&await r.disconnect({provider:n,providerType:i}),Le.removeConnectedNamespace(e),kt.resetChain(e),this.setUser(void 0,e),this.setStatus("disconnected",e),this.setConnectedWalletInfo(void 0,e),ge.removeConnectorId(e),F.resetAccount(e),F.resetNetwork(e),this.setLoading(!1,e)}catch(r){throw this.setLoading(!1,e),new Error(`Failed to disconnect chain ${e}: ${r.message}`)}}createClients(){this.connectionControllerClient={connectWalletConnect:async()=>{var s;const e=F.state.activeChain,r=this.getAdapter(e),n=(s=this.getCaipNetwork(e))==null?void 0:s.id;if(!r)throw new Error("Adapter not found");const i=await r.connectWalletConnect(n);this.close(),this.setClientId((i==null?void 0:i.clientId)||null),Le.setConnectedNamespaces([...F.state.chains.keys()]),this.chainNamespaces.forEach(o=>{ge.setConnectorId(Xt.CONNECTOR_TYPE_WALLET_CONNECT,o)}),await this.syncWalletConnectAccount()},connectExternal:async({id:e,info:r,type:n,provider:i,chain:s,caipNetwork:o,socialUri:a})=>{var p,m,b,v,E,w;const c=F.state.activeChain,u=s||c,l=this.getAdapter(u);if(s&&s!==c&&!o){const C=this.getCaipNetworks().find(y=>y.chainNamespace===s);C&&this.setCaipNetwork(C)}if(!l)throw new Error("Adapter not found");const d=this.getCaipNetwork(u),h=await l.connect({id:e,info:r,type:n,provider:i,socialUri:a,chainId:(o==null?void 0:o.id)||(d==null?void 0:d.id),rpcUrl:((b=(m=(p=o==null?void 0:o.rpcUrls)==null?void 0:p.default)==null?void 0:m.http)==null?void 0:b[0])||((w=(E=(v=d==null?void 0:d.rpcUrls)==null?void 0:v.default)==null?void 0:E.http)==null?void 0:w[0])});if(!h)return;Le.addConnectedNamespace(u),this.syncProvider({...h,chainNamespace:u});const f=re.state.allAccounts,{accounts:g}=(f==null?void 0:f.length)>0?{accounts:[...f]}:await l.getAccounts({namespace:u,id:e});this.setAllAccounts(g,u),this.setStatus("connected",u),this.syncConnectedWalletInfo(u)},reconnectExternal:async({id:e,info:r,type:n,provider:i})=>{var a;const s=F.state.activeChain,o=this.getAdapter(s);o!=null&&o.reconnect&&(await(o==null?void 0:o.reconnect({id:e,info:r,type:n,provider:i,chainId:(a=this.getCaipNetwork())==null?void 0:a.id})),Le.addConnectedNamespace(s),this.syncConnectedWalletInfo(s))},disconnect:async e=>{const r=V3e(e);try{const n=await Promise.allSettled(r.map(async([s])=>this.disconnectNamespace(s)));Qe.resetSend(),xe.resetWcConnection(),await Cu.clearSessions(),ge.setFilterByNamespace(void 0);const i=n.filter(s=>s.status==="rejected");if(i.length>0)throw new Error(i.map(s=>s.reason.message).join(", "));Le.deleteConnectedSocialProvider(),Re.sendEvent({type:"track",event:"DISCONNECT_SUCCESS",properties:{namespace:e||"all"}})}catch(n){throw new Error(`Failed to disconnect chains: ${n.message}`)}},checkInstalled:e=>e?e.some(r=>{var n;return!!((n=window.ethereum)!=null&&n[String(r)])}):!!window.ethereum,signMessage:async e=>{const r=this.getAdapter(F.state.activeChain),n=await(r==null?void 0:r.signMessage({message:e,address:re.state.address,provider:kt.getProvider(F.state.activeChain)}));return(n==null?void 0:n.signature)||""},sendTransaction:async e=>{const r=e.chainNamespace;if(ct.SEND_SUPPORTED_NAMESPACES.includes(r)){const n=this.getAdapter(F.state.activeChain),i=kt.getProvider(r),s=await(n==null?void 0:n.sendTransaction({...e,caipNetwork:this.getCaipNetwork(),provider:i}));return(s==null?void 0:s.hash)||""}return""},estimateGas:async e=>{if(e.chainNamespace===_e.CHAIN.EVM){const r=this.getAdapter(F.state.activeChain),n=kt.getProvider(F.state.activeChain),i=this.getCaipNetwork();if(!i)throw new Error("CaipNetwork is undefined");const s=await(r==null?void 0:r.estimateGas({...e,provider:n,caipNetwork:i}));return(s==null?void 0:s.gas)||0n}return 0n},getEnsAvatar:async()=>{var e;return await this.syncIdentity({address:re.state.address,chainId:Number((e=this.getCaipNetwork())==null?void 0:e.id),chainNamespace:F.state.activeChain}),re.state.profileImage||!1},getEnsAddress:async e=>await tC.resolveReownName(e),writeContract:async e=>{const r=this.getAdapter(F.state.activeChain),n=this.getCaipNetwork(),i=this.getCaipAddress(),s=kt.getProvider(F.state.activeChain);if(!n||!i)throw new Error("CaipNetwork or CaipAddress is undefined");const o=await(r==null?void 0:r.writeContract({...e,caipNetwork:n,provider:s,caipAddress:i}));return o==null?void 0:o.hash},parseUnits:(e,r)=>{const n=this.getAdapter(F.state.activeChain);return(n==null?void 0:n.parseUnits({value:e,decimals:r}))??0n},formatUnits:(e,r)=>{const n=this.getAdapter(F.state.activeChain);return(n==null?void 0:n.formatUnits({value:e,decimals:r}))??"0"},getCapabilities:async e=>{const r=this.getAdapter(F.state.activeChain);return await(r==null?void 0:r.getCapabilities(e))},grantPermissions:async e=>{const r=this.getAdapter(F.state.activeChain);return await(r==null?void 0:r.grantPermissions(e))},revokePermissions:async e=>{const r=this.getAdapter(F.state.activeChain);return r!=null&&r.revokePermissions?await r.revokePermissions(e):"0x"},walletGetAssets:async e=>{const r=this.getAdapter(F.state.activeChain);return await(r==null?void 0:r.walletGetAssets(e))??{}},updateBalance:e=>{const r=this.getCaipNetwork(e);!r||!re.state.address||this.updateNativeBalance(re.state.address,r==null?void 0:r.id,e)}},this.networkControllerClient={switchCaipNetwork:async e=>await this.switchCaipNetwork(e),getApprovedCaipNetworksData:async()=>this.getApprovedCaipNetworksData()},xe.setClient(this.connectionControllerClient)}getApprovedCaipNetworksData(){var r,n,i,s,o;if(kt.getProviderId(F.state.activeChain)===Xt.CONNECTOR_TYPE_WALLET_CONNECT){const a=(n=(r=this.universalProvider)==null?void 0:r.session)==null?void 0:n.namespaces;return{supportsAllNetworks:((o=(s=(i=this.universalProvider)==null?void 0:i.session)==null?void 0:s.peer)==null?void 0:o.metadata.name)==="MetaMask Wallet",approvedCaipNetworkIds:this.getChainsFromNamespaces(a)}}return{supportsAllNetworks:!0,approvedCaipNetworkIds:[]}}async switchCaipNetwork(e){if(!e)return;const r=e.chainNamespace;if(this.getAddressByChainNamespace(e.chainNamespace)){const i=kt.getProvider(r),s=kt.getProviderId(r);if(e.chainNamespace===F.state.activeChain){const o=this.getAdapter(r);await(o==null?void 0:o.switchNetwork({caipNetwork:e,provider:i,providerType:s}))}else if(this.setCaipNetwork(e),s===Xt.CONNECTOR_TYPE_WALLET_CONNECT)this.syncWalletConnectAccount();else{const o=this.getAddressByChainNamespace(r);o&&this.syncAccount({address:o,chainId:e.id,chainNamespace:r})}}else this.setCaipNetwork(e)}getChainsFromNamespaces(e={}){return Object.values(e).flatMap(r=>{const n=r.chains||[],i=r.accounts.map(s=>{const{chainId:o,chainNamespace:a}=bs.parseCaipAddress(s);return`${a}:${o}`});return Array.from(new Set([...n,...i]))})}createAdapters(e){return this.createClients(),this.chainNamespaces.reduce((r,n)=>{var s;const i=e==null?void 0:e.find(o=>o.namespace===n);return i?(i.construct({namespace:n,projectId:(s=this.options)==null?void 0:s.projectId,networks:this.getCaipNetworks()}),r[n]=i):r[n]=new y_e({namespace:n,networks:this.getCaipNetworks()}),r},{})}async initChainAdapter(e){var r;this.onConnectors(e),this.listenAdapter(e),await((r=this.chainAdapters)==null?void 0:r[e].syncConnectors(this.options,this)),await this.createUniversalProviderForAdapter(e)}async initChainAdapters(){await Promise.all(this.chainNamespaces.map(async e=>{await this.initChainAdapter(e)}))}onConnectors(e){const r=this.getAdapter(e);r==null||r.on("connectors",this.setConnectors.bind(this))}listenAdapter(e){const r=this.getAdapter(e);if(!r)return;const n=Le.getConnectionStatus();n==="connected"?this.setStatus("connecting",e):n==="disconnected"?(Le.clearAddressCache(),this.setStatus(n,e)):this.setStatus(n,e),r.on("switchNetwork",({address:i,chainId:s})=>{const o=this.getCaipNetworks().find(u=>u.id===s||u.caipNetworkId===s),a=F.state.activeChain===e,c=F.getAccountProp("address",e);if(o){const u=a&&i?i:c;u&&this.syncAccount({address:u,chainId:o.id,chainNamespace:e})}else this.setUnsupportedNetwork(s)}),r.on("disconnect",this.disconnect.bind(this,e)),r.on("connections",i=>{this.setConnections(i,e)}),r.on("pendingTransactions",()=>{const i=re.state.address,s=F.state.activeCaipNetwork;!i||!(s!=null&&s.id)||this.updateNativeBalance(i,s.id,s.chainNamespace)}),r.on("accountChanged",({address:i,chainId:s})=>{var a,c;const o=F.state.activeChain===e;o&&s?this.syncAccount({address:i,chainId:s,chainNamespace:e}):o&&((a=F.state.activeCaipNetwork)!=null&&a.id)?this.syncAccount({address:i,chainId:(c=F.state.activeCaipNetwork)==null?void 0:c.id,chainNamespace:e}):this.syncAccountInfo(i,s,e),this.syncAllAccounts(e)})}async createUniversalProviderForAdapter(e){var r,n,i;await this.getUniversalProvider(),this.universalProvider&&((i=(n=(r=this.chainAdapters)==null?void 0:r[e])==null?void 0:n.setUniversalProvider)==null||i.call(n,this.universalProvider))}async syncExistingConnection(){await Promise.allSettled(this.chainNamespaces.map(e=>this.syncNamespaceConnection(e)))}async syncNamespaceConnection(e){try{e===_e.CHAIN.EVM&&ue.isSafeApp()&&ge.setConnectorId(_e.CONNECTOR_ID.SAFE,e);const r=ge.getConnectorId(e);switch(this.setStatus("connecting",e),r){case _e.CONNECTOR_ID.WALLET_CONNECT:await this.syncWalletConnectAccount();break;case _e.CONNECTOR_ID.AUTH:break;default:await this.syncAdapterConnection(e)}}catch(r){console.warn("AppKit couldn't sync existing connection",r),this.setStatus("disconnected",e)}}async syncAdapterConnection(e){var a,c,u;const r=this.getAdapter(e),n=ge.getConnectorId(e),i=this.getCaipNetwork(e),o=ge.getConnectors(e).find(l=>l.id===n);try{if(!r||!o)throw new Error(`Adapter or connector not found for namespace ${e}`);if(!(i!=null&&i.id))throw new Error("CaipNetwork not found");const l=await(r==null?void 0:r.syncConnection({namespace:e,id:o.id,chainId:i.id,rpcUrl:(u=(c=(a=i==null?void 0:i.rpcUrls)==null?void 0:a.default)==null?void 0:c.http)==null?void 0:u[0]}));if(l){const d=await(r==null?void 0:r.getAccounts({namespace:e,id:o.id}));d&&d.accounts.length>0?this.setAllAccounts(d.accounts,e):this.setAllAccounts([ue.createAccount(e,l.address,"eoa")],e),this.syncProvider({...l,chainNamespace:e}),await this.syncAccount({...l,chainNamespace:e}),this.setStatus("connected",e)}else this.setStatus("disconnected",e)}catch{this.setStatus("disconnected",e)}}async syncWalletConnectAccount(){const e=this.chainNamespaces.map(async r=>{var a,c,u,l,d;const n=this.getAdapter(r),i=((l=(u=(c=(a=this.universalProvider)==null?void 0:a.session)==null?void 0:c.namespaces)==null?void 0:u[r])==null?void 0:l.accounts)||[],s=(d=F.state.activeCaipNetwork)==null?void 0:d.id,o=i.find(h=>{const{chainId:f}=bs.parseCaipAddress(h);return f===(s==null?void 0:s.toString())})||i[0];if(o){const h=bs.validateCaipAddress(o),{chainId:f,address:g}=bs.parseCaipAddress(h);if(kt.setProviderId(r,Xt.CONNECTOR_TYPE_WALLET_CONNECT),this.caipNetworks&&F.state.activeCaipNetwork&&(n==null?void 0:n.namespace)!==_e.CHAIN.EVM){const p=n==null?void 0:n.getWalletConnectProvider({caipNetworks:this.getCaipNetworks(),provider:this.universalProvider,activeCaipNetwork:F.state.activeCaipNetwork});kt.setProvider(r,p)}else kt.setProvider(r,this.universalProvider);ge.setConnectorId(_e.CONNECTOR_ID.WALLET_CONNECT,r),Le.addConnectedNamespace(r),this.syncWalletConnectAccounts(r),await this.syncAccount({address:g,chainId:f,chainNamespace:r})}else this.setStatus("disconnected",r);this.syncConnectedWalletInfo(r),await F.setApprovedCaipNetworksData(r)});await Promise.all(e)}syncWalletConnectAccounts(e){var n,i,s,o,a;const r=(a=(o=(s=(i=(n=this.universalProvider)==null?void 0:n.session)==null?void 0:i.namespaces)==null?void 0:s[e])==null?void 0:o.accounts)==null?void 0:a.map(c=>{const{address:u}=bs.parseCaipAddress(c);return u}).filter((c,u,l)=>l.indexOf(c)===u);r&&this.setAllAccounts(r.map(c=>ue.createAccount(e,c,e==="bip122"?"payment":"eoa")),e)}syncProvider({type:e,provider:r,id:n,chainNamespace:i}){kt.setProviderId(i,e),kt.setProvider(i,r),ge.setConnectorId(n,i)}async syncAllAccounts(e){const r=ge.getConnectorId(e);if(!r)return;const n=this.getAdapter(e),i=await(n==null?void 0:n.getAccounts({namespace:e,id:r}));i&&i.accounts.length>0&&this.setAllAccounts(i.accounts,e)}async syncAccount(e){var d,h;const r=e.chainNamespace===F.state.activeChain,n=F.getCaipNetworkByNamespace(e.chainNamespace,e.chainId),{address:i,chainId:s,chainNamespace:o}=e,{chainId:a}=Le.getActiveNetworkProps(),c=s||a,u=((d=F.state.activeCaipNetwork)==null?void 0:d.name)===_e.UNSUPPORTED_NETWORK_NAME,l=F.getNetworkProp("supportsAllNetworks",o);if(this.setStatus("connected",o),!(u&&!l)&&c){let f=this.getCaipNetworks().find(m=>m.id.toString()===c.toString()),g=this.getCaipNetworks().find(m=>m.chainNamespace===o);if(!l&&!f&&!g){const m=this.getApprovedCaipNetworkIds()||[],b=m.find(E=>{var w;return((w=bs.parseCaipNetworkId(E))==null?void 0:w.chainId)===c.toString()}),v=m.find(E=>{var w;return((w=bs.parseCaipNetworkId(E))==null?void 0:w.chainNamespace)===o});f=this.getCaipNetworks().find(E=>E.caipNetworkId===b),g=this.getCaipNetworks().find(E=>E.caipNetworkId===v||"deprecatedCaipNetworkId"in E&&E.deprecatedCaipNetworkId===v)}const p=f||g;(p==null?void 0:p.chainNamespace)===F.state.activeChain?oe.state.enableNetworkSwitch&&!oe.state.allowUnsupportedChain&&((h=F.state.activeCaipNetwork)==null?void 0:h.name)===_e.UNSUPPORTED_NETWORK_NAME?F.showUnsupportedChainUI():this.setCaipNetwork(p):r||n&&this.setCaipNetworkOfNamespace(n,o),this.syncConnectedWalletInfo(o),aA.isLowerCaseMatch(i,re.state.address)||this.syncAccountInfo(i,p==null?void 0:p.id,o),r?await this.syncBalance({address:i,chainId:p==null?void 0:p.id,chainNamespace:o}):await this.syncBalance({address:i,chainId:n==null?void 0:n.id,chainNamespace:o})}}async syncAccountInfo(e,r,n){const i=this.getCaipAddress(n),s=r||(i==null?void 0:i.split(":")[1]);if(!s)return;const o=`${n}:${s}:${e}`;this.setCaipAddress(o,n),await this.syncIdentity({address:e,chainId:s,chainNamespace:n})}async syncReownName(e,r){try{const n=await this.getReownName(e);if(n[0]){const i=n[0];this.setProfileName(i.name,r)}else this.setProfileName(null,r)}catch{this.setProfileName(null,r)}}syncConnectedWalletInfo(e){var i;const r=ge.getConnectorId(e),n=kt.getProviderId(e);if(n===Xt.CONNECTOR_TYPE_ANNOUNCED||n===Xt.CONNECTOR_TYPE_INJECTED){if(r){const s=this.getConnectors().find(o=>o.id===r);if(s){const{info:o,name:a,imageUrl:c}=s,u=c||this.getConnectorImage(s);this.setConnectedWalletInfo({name:a,icon:u,...o},e)}}}else if(n===Xt.CONNECTOR_TYPE_WALLET_CONNECT){const s=kt.getProvider(e);s!=null&&s.session&&this.setConnectedWalletInfo({...s.session.peer.metadata,name:s.session.peer.metadata.name,icon:(i=s.session.peer.metadata.icons)==null?void 0:i[0]},e)}else if(r&&r===_e.CONNECTOR_ID.COINBASE){const s=this.getConnectors().find(o=>o.id===_e.CONNECTOR_ID.COINBASE);this.setConnectedWalletInfo({name:"Coinbase Wallet",icon:this.getConnectorImage(s)},e)}}async syncBalance(e){!AV.getNetworksByNamespace(this.getCaipNetworks(),e.chainNamespace).find(n=>{var i;return n.id.toString()===((i=e.chainId)==null?void 0:i.toString())})||!e.chainId||await this.updateNativeBalance(e.address,e.chainId,e.chainNamespace)}async ready(){await this.readyPromise}async updateNativeBalance(e,r,n){const i=this.getAdapter(n),s=F.getCaipNetworkByNamespace(n,r);if(i){const o=await i.getBalance({address:e,chainId:r,caipNetwork:s,tokens:this.options.tokens});return this.setBalance(o.balance,o.symbol,n),o}}async initializeUniversalAdapter(){var n,i,s,o,a,c,u,l,d,h;const e=Eve.createLogger((f,...g)=>{f&&this.handleAlertError(f),console.error(...g)}),r={projectId:(n=this.options)==null?void 0:n.projectId,metadata:{name:(i=this.options)!=null&&i.metadata?(s=this.options)==null?void 0:s.metadata.name:"",description:(o=this.options)!=null&&o.metadata?(a=this.options)==null?void 0:a.metadata.description:"",url:(c=this.options)!=null&&c.metadata?(u=this.options)==null?void 0:u.metadata.url:"",icons:(l=this.options)!=null&&l.metadata?(d=this.options)==null?void 0:d.metadata.icons:[""]},logger:e};oe.setManualWCControl(!!((h=this.options)!=null&&h.manualWCControl)),this.universalProvider=this.options.universalProvider??await yve.init(r),this.listenWalletConnect()}listenWalletConnect(){this.universalProvider&&(this.universalProvider.on("display_uri",e=>{xe.setUri(e)}),this.universalProvider.on("connect",xe.finalizeWcConnection),this.universalProvider.on("disconnect",()=>{this.chainNamespaces.forEach(e=>{this.resetAccount(e)}),xe.resetWcConnection()}),this.universalProvider.on("chainChanged",e=>{const r=this.getCaipNetworks().find(i=>i.id==e),n=this.getCaipNetwork();if(!r){this.setUnsupportedNetwork(e);return}(n==null?void 0:n.id)!==(r==null?void 0:r.id)&&this.setCaipNetwork(r)}),this.universalProvider.on("session_event",e=>{if(tC.isSessionEventData(e)){const{name:r,data:n}=e.params.event;r==="accountsChanged"&&Array.isArray(n)&&ue.isCaipAddress(n[0])&&this.syncAccount(bs.parseCaipAddress(n[0]))}}))}createUniversalProvider(){var e;return!this.universalProviderInitPromise&&ue.isClient()&&((e=this.options)!=null&&e.projectId)&&(this.universalProviderInitPromise=this.initializeUniversalAdapter()),this.universalProviderInitPromise}async getUniversalProvider(){if(!this.universalProvider)try{await this.createUniversalProvider()}catch(e){Re.sendEvent({type:"error",event:"INTERNAL_SDK_ERROR",properties:{errorType:"UniversalProviderInitError",errorMessage:e instanceof Error?e.message:"Unknown",uncaught:!1}}),console.error("AppKit:getUniversalProvider - Cannot create provider",e)}return this.universalProvider}handleAlertError(e){const r=Object.entries(Do.UniversalProviderErrors).find(([,{message:a}])=>e.message.includes(a)),[n,i]=r??[],{message:s,alertErrorKey:o}=i??{};if(n&&s&&!this.reportedAlertErrors[n]){const a=Do.ALERT_ERRORS[o];a&&(Fn.open(a,"error"),this.reportedAlertErrors[n]=!0)}}getAdapter(e){var r;if(e)return(r=this.chainAdapters)==null?void 0:r[e]}createAdapter(e){var i;if(!e)return;const r=e.namespace;if(!r)return;this.createClients();const n=e;n.namespace=r,n.construct({namespace:r,projectId:(i=this.options)==null?void 0:i.projectId,networks:this.getCaipNetworks()}),this.chainNamespaces.includes(r)||this.chainNamespaces.push(r),this.chainAdapters&&(this.chainAdapters[r]=n)}async open(e){if(await this.injectModalUi(),e!=null&&e.uri&&xe.setUri(e.uri),e!=null&&e.arguments)switch(e==null?void 0:e.view){case"Swap":return We.open({...e,data:{swap:e.arguments}})}return We.open(e)}async close(){await this.injectModalUi(),We.close()}setLoading(e,r){We.setLoading(e,r)}async disconnect(e){await xe.disconnect(e)}getSIWX(){return oe.state.siwx}getError(){return""}getChainId(){var e;return(e=F.state.activeCaipNetwork)==null?void 0:e.id}async switchNetwork(e){const r=this.getCaipNetworks().find(n=>n.id===e.id);if(!r){Fn.open(Do.ALERT_ERRORS.SWITCH_NETWORK_NOT_FOUND,"error");return}await F.switchActiveNetwork(r)}getWalletProvider(){return F.state.activeChain?kt.state.providers[F.state.activeChain]:null}getWalletProviderType(){return kt.getProviderId(F.state.activeChain)}subscribeProviders(e){return kt.subscribeProviders(e)}getThemeMode(){return ar.state.themeMode}getThemeVariables(){return ar.state.themeVariables}setThemeMode(e){ar.setThemeMode(e),MZ(ar.state.themeMode)}setTermsConditionsUrl(e){oe.setTermsConditionsUrl(e)}setPrivacyPolicyUrl(e){oe.setPrivacyPolicyUrl(e)}setThemeVariables(e){ar.setThemeVariables(e),d_e(ar.state.themeVariables)}subscribeTheme(e){return ar.subscribe(e)}getWalletInfo(){return re.state.connectedWalletInfo}getAccount(e){var o;const r=ge.getAuthConnector(e),n=F.getAccountData(e),i=F.state.activeChain,s=Le.getConnectedConnectorId(e||i);if(n)return{allAccounts:n.allAccounts,caipAddress:n.caipAddress,address:ue.getPlainAddress(n.caipAddress),isConnected:!!n.caipAddress,status:n.status,embeddedWalletInfo:r&&s===_e.CONNECTOR_ID.AUTH?{user:n.user?{...n.user,username:Le.getConnectedSocialUsername()}:void 0,authProvider:n.socialProvider||"email",accountType:(o=n.preferredAccountTypes)==null?void 0:o[e||i],isSmartAccountDeployed:!!n.smartAccountDeployed}:void 0}}subscribeAccount(e,r){const n=()=>{const i=this.getAccount(r);i&&e(i)};r?F.subscribeChainProp("accountState",n,r):F.subscribe(n),ge.subscribe(n)}subscribeNetwork(e){return F.subscribe(({activeCaipNetwork:r})=>{e({caipNetwork:r,chainId:r==null?void 0:r.id,caipNetworkId:r==null?void 0:r.caipNetworkId})})}subscribeWalletInfo(e){return re.subscribeKey("connectedWalletInfo",e)}subscribeShouldUpdateToAddress(e){re.subscribeKey("shouldUpdateToAddress",e)}subscribeCaipNetworkChange(e){F.subscribeKey("activeCaipNetwork",e)}getState(){return Ga.state}subscribeState(e){return Ga.subscribe(e)}showErrorMessage(e){Fe.showError(e)}showSuccessMessage(e){Fe.showSuccess(e)}getEvent(){return{...Re.state}}subscribeEvents(e){return Re.subscribe(e)}replace(e){X.replace(e)}redirect(e){X.push(e)}popTransactionStack(e){X.popTransactionStack(e)}isOpen(){return We.state.open}isTransactionStackEmpty(){return X.state.transactionStack.length===0}static getInstance(){return this.instance}updateFeatures(e){oe.setFeatures(e)}updateRemoteFeatures(e){oe.setRemoteFeatures(e)}updateOptions(e){const n={...oe.state||{},...e};oe.setOptions(n)}setConnectMethodsOrder(e){oe.setConnectMethodsOrder(e)}setWalletFeaturesOrder(e){oe.setWalletFeaturesOrder(e)}setCollapseWallets(e){oe.setCollapseWallets(e)}setSocialsOrder(e){oe.setSocialsOrder(e)}getConnectMethodsOrder(){return Ou.getConnectOrderMethod(oe.state.features,ge.getConnectors())}addNetwork(e,r){if(this.chainAdapters&&!this.chainAdapters[e])throw new Error(`Adapter for namespace ${e} doesn't exist`);const n=this.extendCaipNetwork(r,this.options);this.getCaipNetworks().find(i=>i.id===n.id)||F.addNetwork(n)}removeNetwork(e,r){if(this.chainAdapters&&!this.chainAdapters[e])throw new Error(`Adapter for namespace ${e} doesn't exist`);this.getCaipNetworks().find(i=>i.id===r)&&F.removeNetwork(e,r)}}let Oj=!1;class C_e extends E_e{setupAuthConnectorListeners(e){e.onRpcRequest(r=>{ei.checkIfRequestExists(r)?ei.checkIfRequestIsSafe(r)||this.handleUnsafeRPCRequest():(this.open(),console.error(bt.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:r.method}),setTimeout(()=>{this.showErrorMessage(bt.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),e.rejectRpcRequests())}),e.onRpcError(()=>{this.isOpen()&&(this.isTransactionStackEmpty()?this.close():this.popTransactionStack("error"))}),e.onRpcSuccess((r,n)=>{const i=ei.checkIfRequestIsSafe(n),s=re.state.address,o=F.state.activeCaipNetwork;i||(s&&(o!=null&&o.id)&&this.updateNativeBalance(s,o.id,o.chainNamespace),this.isTransactionStackEmpty()?this.close():this.popTransactionStack("success"))}),e.onNotConnected(()=>{const r=F.state.activeChain;ge.getConnectorId(r)===_e.CONNECTOR_ID.AUTH&&(this.setCaipAddress(void 0,r),this.setLoading(!1,r))}),e.onConnect(r=>{var u,l;const n=F.state.activeChain,i=n===_e.CHAIN.EVM?`eip155:${r.chainId}:${r.address}`:`${r.chainId}:${r.address}`,s=oe.state.defaultAccountTypes[n],o=(u=re.state.preferredAccountTypes)==null?void 0:u[n],a=r.preferredAccountType||o||s;aA.isLowerCaseMatch(r.address,re.state.address)||this.syncIdentity({address:r.address,chainId:r.chainId,chainNamespace:n}),this.setCaipAddress(i,n),this.setUser({...re.state.user||{},...r},n),this.setSmartAccountDeployed(!!r.smartAccountDeployed,n),this.setPreferredAccountType(a,n);const c=(l=r.accounts)==null?void 0:l.map(d=>ue.createAccount(n,d.address,d.type||o||s));this.setAllAccounts(c||[ue.createAccount(n,r.address,r.preferredAccountType||a)],n),this.setLoading(!1,n)}),e.onSocialConnected(({userName:r})=>{this.setUser({...re.state.user||{},username:r},F.state.activeChain)}),e.onGetSmartAccountEnabledNetworks(r=>{this.setSmartAccountEnabledNetworks(r,F.state.activeChain)}),e.onSetPreferredAccount(({address:r,type:n})=>{r&&this.setPreferredAccountType(n,F.state.activeChain)})}async syncAuthConnector(e,r){var l,d,h,f;const n=_e.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(r);if(!n)return;this.setLoading(!0,r);const i=e.getLoginEmailUsed();this.setLoading(i,r),i&&this.setStatus("connecting",r);const s=e.getEmail(),o=e.getUsername();this.setUser({...((l=re.state)==null?void 0:l.user)||{},username:o,email:s},r),this.setupAuthConnectorListeners(e);const{isConnected:a}=await e.isConnected(),c=ar.getSnapshot(),u=oe.getSnapshot();await Promise.all([e.syncDappData({metadata:u.metadata,sdkVersion:u.sdkVersion,projectId:u.projectId,sdkType:u.sdkType}),e.syncTheme({themeMode:c.themeMode,themeVariables:c.themeVariables,w3mThemeVariables:za(c.themeVariables,c.themeMode)})]),await e.getSmartAccountEnabledNetworks(),r&&n&&(a&&((d=this.connectionControllerClient)!=null&&d.connectExternal)?(await((f=this.connectionControllerClient)==null?void 0:f.connectExternal({id:_e.CONNECTOR_ID.AUTH,info:{name:_e.CONNECTOR_ID.AUTH},type:Xt.CONNECTOR_TYPE_AUTH,provider:e,chainId:(h=F.state.activeCaipNetwork)==null?void 0:h.id,chain:r})),this.setStatus("connected",r)):ge.getConnectorId(r)===_e.CONNECTOR_ID.AUTH&&(this.setStatus("disconnected",r),Le.removeConnectedNamespace(r))),this.setLoading(!1,r)}async checkExistingTelegramSocialConnection(e){var r;try{if(!ue.isTelegram())return;const n=Le.getTelegramSocialProvider();if(!n||!ue.isClient())return;const s=new URL(window.location.href).searchParams.get("result_uri");if(!s)return;re.setSocialProvider(n,e),await((r=this.authProvider)==null?void 0:r.init());const o=ge.getAuthConnector();n&&o&&(this.setLoading(!0,e),await xe.connectExternal({id:o.id,type:o.type,socialUri:s},o.chain),Le.setConnectedSocialProvider(n),Le.removeTelegramSocialProvider(),Re.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:n}}))}catch(n){this.setLoading(!1,e),console.error("checkExistingSTelegramocialConnection error",n)}try{const n=new URL(window.location.href);n.searchParams.delete("result_uri"),window.history.replaceState({},document.title,n.toString())}catch(n){console.error("tma social login failed",n)}}createAuthProvider(e){var o,a,c,u;if(!_e.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(e))return;const n=(o=this.remoteFeatures)==null?void 0:o.email,i=Array.isArray((a=this.remoteFeatures)==null?void 0:a.socials)&&this.remoteFeatures.socials.length>0,s=n||i;!this.authProvider&&((c=this.options)!=null&&c.projectId)&&s&&(this.authProvider=mb.getInstance({projectId:this.options.projectId,enableLogger:this.options.enableAuthLogger,chainId:(u=this.getCaipNetwork(e))==null?void 0:u.caipNetworkId,abortController:Do.EmbeddedWalletAbortController,onTimeout:l=>{l==="iframe_load_failed"?Fn.open(Do.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):l==="iframe_request_timeout"?Fn.open(Do.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):l==="unverified_domain"&&Fn.open(Do.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")}}),Ga.subscribeOpen(l=>{var d;!l&&this.isTransactionStackEmpty()&&((d=this.authProvider)==null||d.rejectRpcRequests())}),this.syncAuthConnector(this.authProvider,e),this.checkExistingTelegramSocialConnection(e))}createAuthProviderForAdapter(e){var r,n,i;this.createAuthProvider(e),this.authProvider&&((i=(n=(r=this.chainAdapters)==null?void 0:r[e])==null?void 0:n.setAuthProvider)==null||i.call(n,this.authProvider))}initControllers(e){super.initControllers(e),this.options.excludeWalletIds&&Ne.initializeExcludedWallets({ids:this.options.excludeWalletIds})}async switchCaipNetwork(e){var o,a;if(!e)return;const r=F.state.activeChain,n=e.chainNamespace,i=this.getAddressByChainNamespace(n);if(n===r&&i){const c=this.getAdapter(n),u=kt.getProvider(n),l=kt.getProviderId(n);await(c==null?void 0:c.switchNetwork({caipNetwork:e,provider:u,providerType:l})),this.setCaipNetwork(e)}else{const u=kt.getProviderId(r)===Xt.CONNECTOR_TYPE_AUTH,l=kt.getProviderId(n),d=l===Xt.CONNECTOR_TYPE_AUTH,h=_e.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(n);if((u&&l===void 0||d)&&h)try{if(F.state.activeChain=e.chainNamespace,i){const f=this.getAdapter(n);await(f==null?void 0:f.switchNetwork({caipNetwork:e,provider:this.authProvider,providerType:l}))}else await((a=(o=this.connectionControllerClient)==null?void 0:o.connectExternal)==null?void 0:a.call(o,{id:_e.CONNECTOR_ID.AUTH,provider:this.authProvider,chain:n,chainId:e.id,type:Xt.CONNECTOR_TYPE_AUTH,caipNetwork:e}));this.setCaipNetwork(e)}catch{const g=this.getAdapter(n);await(g==null?void 0:g.switchNetwork({caipNetwork:e,provider:this.authProvider,providerType:l}))}else l===Xt.CONNECTOR_TYPE_WALLET_CONNECT?(this.setCaipNetwork(e),this.syncWalletConnectAccount()):(this.setCaipNetwork(e),i&&this.syncAccount({address:i,chainId:e.id,chainNamespace:n}))}}async initialize(e){var r;await super.initialize(e),(r=this.chainNamespaces)==null||r.forEach(n=>{this.createAuthProviderForAdapter(n)}),await this.injectModalUi(),Ga.set({initialized:!0})}async syncIdentity({address:e,chainId:r,chainNamespace:n}){var o;const i=`${n}:${r}`,s=(o=this.caipNetworks)==null?void 0:o.find(a=>a.caipNetworkId===i);if(n!==_e.CHAIN.EVM||s!=null&&s.testnet){this.setProfileName(null,n),this.setProfileImage(null,n);return}try{const{name:a,avatar:c}=await this.fetchIdentity({address:e,caipNetworkId:i});this.setProfileName(a,n),this.setProfileImage(c,n)}catch{await this.syncReownName(e,n),r!==1&&this.setProfileImage(null,n)}}syncConnectedWalletInfo(e){const r=kt.getProviderId(e);if(r===Xt.CONNECTOR_TYPE_AUTH){const n=this.authProvider;if(n){const i=Le.getConnectedSocialProvider()??"email",s=n.getEmail()??n.getUsername();this.setConnectedWalletInfo({name:r,identifier:s,social:i},e)}}else super.syncConnectedWalletInfo(e)}async injectModalUi(){if(ue.isClient()&&!Oj)try{const e={...ct.DEFAULT_FEATURES,...this.options.features},r=this.remoteFeatures;if(await this.loadModalComponents(e,r),ue.isClient()&&!document.querySelector("w3m-modal")){const i=document.createElement("w3m-modal");!oe.state.disableAppend&&!oe.state.enableEmbedded&&document.body.insertAdjacentElement("beforeend",i)}Oj=!0}catch(e){console.error("Error injecting modal UI:",e)}}async loadModalComponents(e,r){if(!ue.isClient())return;const n=[];(r.email||r.socials&&r.socials.length>0)&&n.push(ke(()=>Promise.resolve().then(()=>q6e),void 0)),r.email&&n.push(ke(()=>Promise.resolve().then(()=>eAe),void 0)),r.socials&&n.push(ke(()=>Promise.resolve().then(()=>VAe),void 0)),r.swaps&&r.swaps.length>0&&n.push(ke(()=>Promise.resolve().then(()=>sxe),void 0)),e.send&&n.push(ke(()=>Promise.resolve().then(()=>bxe),void 0)),e.receive&&n.push(ke(()=>Promise.resolve().then(()=>Exe),void 0)),r.onramp&&r.onramp.length>0&&n.push(ke(()=>Promise.resolve().then(()=>h8e),void 0)),r.activity&&n.push(ke(()=>Promise.resolve().then(()=>y8e),void 0)),e.pay&&n.push(ke(()=>Promise.resolve().then(()=>G8e),void 0)),await Promise.all([...n,ke(()=>Promise.resolve().then(()=>yTe),void 0),ke(()=>Promise.resolve().then(()=>kTe),void 0)])}}const A_e="1.7.8";function x_e(t){return new C_e({...t,sdkVersion:ue.generateSdkVersion(t.adapters??[],"html",A_e)})}const S_e="6.13.2";function T_e(t,e,r){const n=e.split("|").map(s=>s.trim());for(let s=0;s<n.length;s++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error(`invalid value for type ${e}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${r}`,i.value=t,i}async function mi(t){const e=Object.keys(t);return(await Promise.all(e.map(n=>Promise.resolve(t[n])))).reduce((n,i,s)=>(n[e[s]]=i,n),{})}function ut(t,e,r){for(let n in e){let i=e[n];const s=r?r[n]:null;s&&T_e(i,s,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function Z0(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(Z0).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n<t.length;n++)r+=e[t[n]>>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return Z0(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(r=>`${Z0(r)}: ${Z0(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function ti(t,e){return t&&t.code===e}function d7(t){return ti(t,"CALL_EXCEPTION")}function Hr(t,e,r){let n=t;{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${Z0(r)}`);for(const o in r){if(o==="shortMessage")continue;const a=r[o];s.push(o+"="+Z0(a))}}s.push(`code=${e}`),s.push(`version=${S_e}`),s.length&&(t+=" ("+s.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return ut(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&ut(i,{shortMessage:n}),i}function Ae(t,e,r,n){if(!t)throw Hr(e,r,n)}function ee(t,e,r,n){Ae(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function UZ(t,e,r){r==null&&(r=""),r&&(r=": "+r),Ae(t>=e,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),Ae(t<=e,"too many arguments"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function zv(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),Ae(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function FZ(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let s=0;s<n.length;s++)n[s]=parseInt(t.substring(i,i+2),16),i+=2;return n}ee(!1,"invalid BytesLike value",e||"value",t)}function jt(t,e){return FZ(t,e,!1)}function wi(t,e){return FZ(t,e,!0)}function vr(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&t.length!==2+2*e||e===!0&&t.length%2!==0)}function h7(t){return vr(t,!0)||t instanceof Uint8Array}const Rj="0123456789abcdef";function Je(t){const e=jt(t);let r="0x";for(let n=0;n<e.length;n++){const i=e[n];r+=Rj[(i&240)>>4]+Rj[i&15]}return r}function en(t){return"0x"+t.map(e=>Je(e).substring(2)).join("")}function ag(t){return vr(t,!0)?(t.length-2)/2:jt(t).length}function qr(t,e,r){const n=jt(t);return r!=null&&r>n.length&&Ae(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),Je(n.slice(e??0,r??n.length))}function HZ(t,e,r){const n=jt(t);Ae(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),Je(i)}function Wf(t,e){return HZ(t,e,!0)}function I_e(t,e){return HZ(t,e,!1)}const lA=BigInt(0),Mo=BigInt(1),Y0=9007199254740991;function FC(t,e){const r=dA(t,"value"),n=BigInt(Et(e,"width"));if(Ae(r>>n===lA,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-Mo){const i=(Mo<<n)-Mo;return-((~r&i)+Mo)}return r}function qZ(t,e){let r=et(t,"value");const n=BigInt(Et(e,"width")),i=Mo<<n-Mo;if(r<lA){r=-r,Ae(r<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const s=(Mo<<n)-Mo;return(~r&s)+Mo}else Ae(r<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return r}function ef(t,e){const r=dA(t,"value"),n=BigInt(Et(e,"bits"));return r&(Mo<<n)-Mo}function et(t,e){switch(typeof t){case"bigint":return t;case"number":return ee(Number.isInteger(t),"underflow",e||"value",t),ee(t>=-Y0&&t<=Y0,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(r){ee(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}ee(!1,"invalid BigNumberish value",e||"value",t)}function dA(t,e){const r=et(t,e);return Ae(r>=lA,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const kj="0123456789abcdef";function hA(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=kj[r>>4],e+=kj[r&15];return BigInt(e)}return et(t)}function Et(t,e){switch(typeof t){case"bigint":return ee(t>=-Y0&&t<=Y0,"overflow",e||"value",t),Number(t);case"number":return ee(Number.isInteger(t),"underflow",e||"value",t),ee(t>=-Y0&&t<=Y0,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Et(BigInt(t),e)}catch(r){ee(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}ee(!1,"invalid numeric value",e||"value",t)}function P_e(t){return Et(hA(t))}function vd(t,e){let n=dA(t,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{const i=Et(e,"width");for(Ae(i*2>=n.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});n.length<i*2;)n="0"+n}return"0x"+n}function bi(t){const e=dA(t,"value");if(e===lA)return new Uint8Array([]);let r=e.toString(16);r.length%2&&(r="0"+r);const n=new Uint8Array(r.length/2);for(let i=0;i<n.length;i++){const s=i*2;n[i]=parseInt(r.substring(s,s+2),16)}return n}function J0(t){let e=Je(h7(t)?t:bi(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const Nj="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const $j=BigInt(58);function O_e(t){const e=jt(t);let r=hA(e),n="";for(;r;)n=Nj[Number(r%$j)]+n,r/=$j;for(let i=0;i<e.length&&!e[i];i++)n=Nj[0]+n;return n}function R_e(t){t=atob(t);const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return jt(e)}function k_e(t){const e=jt(t);let r="";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r)}var gg;class zZ{constructor(e,r,n){ce(this,"filter");ce(this,"emitter");me(this,gg);Z(this,gg,r),ut(this,{emitter:e,filter:n})}async removeListener(){H(this,gg)!=null&&await this.emitter.off(this.filter,H(this,gg))}}gg=new WeakMap;function N_e(t,e,r,n,i){ee(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function WZ(t,e,r,n,i){if(t==="BAD_PREFIX"||t==="UNEXPECTED_CONTINUE"){let s=0;for(let o=e+1;o<r.length&&r[o]>>6===2;o++)s++;return s}return t==="OVERRUN"?r.length-e-1:0}function $_e(t,e,r,n,i){return t==="OVERLONG"?(ee(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),WZ(t,e,r))}const j_e=Object.freeze({error:N_e,ignore:WZ,replace:$_e});function B_e(t,e){e==null&&(e=j_e.error);const r=jt(t,"bytes"),n=[];let i=0;for(;i<r.length;){const s=r[i++];if(s>>7===0){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+o>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let c=s&(1<<8-o-1)-1;for(let u=0;u<o;u++){let l=r[i];if((l&192)!=128){i+=e("MISSING_CONTINUE",i,r,n),c=null;break}c=c<<6|l&63,i++}if(c!==null){if(c>1114111){i+=e("OUT_OF_RANGE",i-1-o,r,n,c);continue}if(c>=55296&&c<=57343){i+=e("UTF16_SURROGATE",i-1-o,r,n,c);continue}if(c<=a){i+=e("OVERLONG",i-1-o,r,n,c);continue}n.push(c)}}return n}function Za(t,e){ee(typeof t=="string","invalid string value","str",t);let r=[];for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);ee(n<t.length&&(s&64512)===56320,"invalid surrogate pair","str",t);const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function D_e(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function HC(t,e){return D_e(B_e(t,e))}function VZ(t){async function e(r,n){Ae(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");const i=r.url.split(":")[0].toLowerCase();Ae(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),Ae(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s=null;const o=new AbortController,a=setTimeout(()=>{s=Hr("request timeout","TIMEOUT"),o.abort()},r.timeout);n&&n.addListener(()=>{s=Hr("request cancelled","CANCELLED"),o.abort()});const c={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:o.signal};let u;try{u=await fetch(r.url,c)}catch(f){throw clearTimeout(a),s||f}clearTimeout(a);const l={};u.headers.forEach((f,g)=>{l[g.toLowerCase()]=f});const d=await u.arrayBuffer(),h=d==null?null:new Uint8Array(d);return{statusCode:u.status,statusMessage:u.statusText,headers:l,body:h}}return e}const M_e=12,L_e=250;let jj=VZ();const U_e=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),F_e=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let hS=!1;async function GZ(t,e){try{const r=t.match(U_e);if(!r)throw new Error("invalid data");return new gd(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?R_e(r[3]):q_e(r[3]))}catch{return new gd(599,"BAD REQUEST (invalid data: URI)",{},null,new ku(t))}}function KZ(t){async function e(r,n){try{const i=r.match(F_e);if(!i)throw new Error("invalid link");return new ku(`${t}${i[2]}`)}catch{return new gd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new ku(r))}}return e}const v3={data:GZ,ipfs:KZ("https://gateway.ipfs.io/ipfs/")},ZZ=new WeakMap;var sf,Fl;class H_e{constructor(e){me(this,sf);me(this,Fl);Z(this,sf,[]),Z(this,Fl,!1),ZZ.set(e,()=>{if(!H(this,Fl)){Z(this,Fl,!0);for(const r of H(this,sf))setTimeout(()=>{r()},0);Z(this,sf,[])}})}addListener(e){Ae(!H(this,Fl),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),H(this,sf).push(e)}get cancelled(){return H(this,Fl)}checkSignal(){Ae(!this.cancelled,"cancelled","CANCELLED",{})}}sf=new WeakMap,Fl=new WeakMap;function _3(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var mg,wg,ko,ru,bg,yg,vn,ps,nu,of,af,cf,Pa,No,Hl,uf,ib;const $6=class $6{constructor(e){me(this,uf);me(this,mg);me(this,wg);me(this,ko);me(this,ru);me(this,bg);me(this,yg);me(this,vn);me(this,ps);me(this,nu);me(this,of);me(this,af);me(this,cf);me(this,Pa);me(this,No);me(this,Hl);Z(this,yg,String(e)),Z(this,mg,!1),Z(this,wg,!0),Z(this,ko,{}),Z(this,ru,""),Z(this,bg,3e5),Z(this,No,{slotInterval:L_e,maxAttempts:M_e}),Z(this,Hl,null)}get url(){return H(this,yg)}set url(e){Z(this,yg,String(e))}get body(){return H(this,vn)==null?null:new Uint8Array(H(this,vn))}set body(e){if(e==null)Z(this,vn,void 0),Z(this,ps,void 0);else if(typeof e=="string")Z(this,vn,Za(e)),Z(this,ps,"text/plain");else if(e instanceof Uint8Array)Z(this,vn,e),Z(this,ps,"application/octet-stream");else if(typeof e=="object")Z(this,vn,Za(JSON.stringify(e))),Z(this,ps,"application/json");else throw new Error("invalid body")}hasBody(){return H(this,vn)!=null}get method(){return H(this,ru)?H(this,ru):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),Z(this,ru,String(e).toUpperCase())}get headers(){const e=Object.assign({},H(this,ko));return H(this,nu)&&(e.authorization=`Basic ${k_e(Za(H(this,nu)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&H(this,ps)&&(e["content-type"]=H(this,ps)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){H(this,ko)[String(e).toLowerCase()]=String(r)}clearHeaders(){Z(this,ko,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n<r.length){const i=r[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return H(this,nu)||null}setCredentials(e,r){ee(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),Z(this,nu,`${e}:${r}`)}get allowGzip(){return H(this,wg)}set allowGzip(e){Z(this,wg,!!e)}get allowInsecureAuthentication(){return!!H(this,mg)}set allowInsecureAuthentication(e){Z(this,mg,!!e)}get timeout(){return H(this,bg)}set timeout(e){ee(e>=0,"timeout must be non-zero","timeout",e),Z(this,bg,e)}get preflightFunc(){return H(this,of)||null}set preflightFunc(e){Z(this,of,e)}get processFunc(){return H(this,af)||null}set processFunc(e){Z(this,af,e)}get retryFunc(){return H(this,cf)||null}set retryFunc(e){Z(this,cf,e)}get getUrlFunc(){return H(this,Hl)||jj}set getUrlFunc(e){Z(this,Hl,e)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${H(this,vn)?Je(H(this,vn)):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(H(this,No).slotInterval=e.slotInterval),e.maxAttempts!=null&&(H(this,No).maxAttempts=e.maxAttempts)}send(){return Ae(H(this,Pa)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),Z(this,Pa,new H_e(this)),Pe(this,uf,ib).call(this,0,Bj()+this.timeout,0,this,new gd(0,"",{},null,this))}cancel(){Ae(H(this,Pa)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=ZZ.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();Ae(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new $6(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,Z(i,ko,Object.assign({},H(this,ko))),H(this,vn)&&Z(i,vn,new Uint8Array(H(this,vn))),Z(i,ps,H(this,ps)),i}clone(){const e=new $6(this.url);return Z(e,ru,H(this,ru)),H(this,vn)&&Z(e,vn,H(this,vn)),Z(e,ps,H(this,ps)),Z(e,ko,Object.assign({},H(this,ko))),Z(e,nu,H(this,nu)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),Z(e,of,H(this,of)),Z(e,af,H(this,af)),Z(e,cf,H(this,cf)),Z(e,No,Object.assign({},H(this,No))),Z(e,Hl,H(this,Hl)),e}static lockConfig(){hS=!0}static getGateway(e){return v3[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(hS)throw new Error("gateways locked");v3[e]=r}static registerGetUrl(e){if(hS)throw new Error("gateways locked");jj=e}static createGetUrlFunc(e){return VZ()}static createDataGateway(){return GZ}static createIpfsGatewayFunc(e){return KZ(e)}};mg=new WeakMap,wg=new WeakMap,ko=new WeakMap,ru=new WeakMap,bg=new WeakMap,yg=new WeakMap,vn=new WeakMap,ps=new WeakMap,nu=new WeakMap,of=new WeakMap,af=new WeakMap,cf=new WeakMap,Pa=new WeakMap,No=new WeakMap,Hl=new WeakMap,uf=new WeakSet,ib=async function(e,r,n,i,s){var l,d,h;if(e>=H(this,No).maxAttempts)return s.makeServerError("exceeded maximum retry limit");Ae(Bj()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),n>0&&await z_e(n);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in v3){const f=await v3[a](o.url,_3(H(i,Pa)));if(f instanceof gd){let g=f;if(this.processFunc){_3(H(i,Pa));try{g=await this.processFunc(o,g)}catch(p){(p.throttle==null||typeof p.stall!="number")&&g.makeServerError("error in post-processing function",p).assertOk()}}return g}o=f}this.preflightFunc&&(o=await this.preflightFunc(o));const c=await this.getUrlFunc(o,_3(H(i,Pa)));let u=new gd(c.statusCode,c.statusMessage,c.headers,c.body,i);if(u.statusCode===301||u.statusCode===302){try{const f=u.headers.location||"";return Pe(l=o.redirect(f),uf,ib).call(l,e+1,r,0,i,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,e))){const f=u.headers["retry-after"];let g=H(this,No).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof f=="string"&&f.match(/^[1-9][0-9]*$/)&&(g=parseInt(f)),Pe(d=o.clone(),uf,ib).call(d,e+1,r,g,i,u)}if(this.processFunc){_3(H(i,Pa));try{u=await this.processFunc(o,u)}catch(f){(f.throttle==null||typeof f.stall!="number")&&u.makeServerError("error in post-processing function",f).assertOk();let g=H(this,No).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return f.stall>=0&&(g=f.stall),Pe(h=o.clone(),uf,ib).call(h,e+1,r,g,i,u)}}return u};let ku=$6;var uv,lv,dv,gs,vg,lf;const _R=class _R{constructor(e,r,n,i,s){me(this,uv);me(this,lv);me(this,dv);me(this,gs);me(this,vg);me(this,lf);Z(this,uv,e),Z(this,lv,r),Z(this,dv,Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{})),Z(this,gs,i==null?null:new Uint8Array(i)),Z(this,vg,s||null),Z(this,lf,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${H(this,gs)?Je(H(this,gs)):"null"}>`}get statusCode(){return H(this,uv)}get statusMessage(){return H(this,lv)}get headers(){return Object.assign({},H(this,dv))}get body(){return H(this,gs)==null?null:new Uint8Array(H(this,gs))}get bodyText(){try{return H(this,gs)==null?"":HC(H(this,gs))}catch{Ae(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{Ae(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n<r.length){const i=r[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(e,r){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);const i=new _R(599,n,this.headers,this.body,H(this,vg)||void 0);return Z(i,lf,{message:e,error:r}),i}throwThrottleError(e,r){r==null?r=-1:ee(Number.isInteger(r)&&r>=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw ut(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return H(this,gs)!=null}get request(){return H(this,vg)}ok(){return H(this,lf).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=H(this,lf);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let i=null;try{H(this,gs)&&(i=HC(H(this,gs)))}catch{}Ae(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r,info:{requestUrl:n,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};uv=new WeakMap,lv=new WeakMap,dv=new WeakMap,gs=new WeakMap,vg=new WeakMap,lf=new WeakMap;let gd=_R;function Bj(){return new Date().getTime()}function q_e(t){return Za(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function z_e(t){return new Promise(e=>setTimeout(e,t))}const W_e=BigInt(-1),Io=BigInt(0),Q0=BigInt(1),V_e=BigInt(5),l0={};let cg="0000";for(;cg.length<80;)cg+=cg;function fh(t){let e=cg;for(;e.length<t;)e+=e;return BigInt("1"+e.substring(0,t))}function Z1(t,e,r){const n=BigInt(e.width);if(e.signed){const i=Q0<<n-Q0;Ae(r==null||t>=-i&&t<i,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:t}),t>Io?t=FC(ef(t,n),n):t=-FC(ef(-t,n),n)}else{const i=Q0<<n;Ae(r==null||t>=0&&t<i,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:t}),t=(t%i+i)%i&i-Q0}return t}function fS(t){typeof t=="number"&&(t=`fixed128x${t}`);let e=!0,r=128,n=18;if(typeof t=="string"){if(t!=="fixed")if(t==="ufixed")e=!1;else{const s=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);ee(s,"invalid fixed format","format",t),e=s[1]!=="u",r=parseInt(s[2]),n=parseInt(s[3])}}else if(t){const s=t,o=(a,c,u)=>s[a]==null?u:(ee(typeof s[a]===c,"invalid fixed format ("+a+" not "+c+")","format."+a,s[a]),s[a]);e=o("signed","boolean",e),r=o("width","number",r),n=o("decimals","number",n)}ee(r%8===0,"invalid FixedNumber width (not byte aligned)","format.width",r),ee(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);const i=(e?"":"u")+"fixed"+String(r)+"x"+String(n);return{signed:e,width:r,decimals:n,name:i}}function G_e(t,e){let r="";t<Io&&(r="-",t*=W_e);let n=t.toString();if(e===0)return r+n;for(;n.length<=e;)n=cg+n;const i=n.length-e;for(n=n.substring(0,i)+"."+n.substring(i);n[0]==="0"&&n[1]!==".";)n=n.substring(1);for(;n[n.length-1]==="0"&&n[n.length-2]!==".";)n=n.substring(0,n.length-1);return r+n}var $o,ir,pi,Zt,Bh,Gc,YI,JI,QI,XI;const Dl=class Dl{constructor(e,r,n){me(this,Zt);ce(this,"format");me(this,$o);me(this,ir);me(this,pi);ce(this,"_value");zv(e,l0,"FixedNumber"),Z(this,ir,r),Z(this,$o,n);const i=G_e(r,n.decimals);ut(this,{format:n.name,_value:i}),Z(this,pi,fh(n.decimals))}get signed(){return H(this,$o).signed}get width(){return H(this,$o).width}get decimals(){return H(this,$o).decimals}get value(){return H(this,ir)}addUnsafe(e){return Pe(this,Zt,YI).call(this,e)}add(e){return Pe(this,Zt,YI).call(this,e,"add")}subUnsafe(e){return Pe(this,Zt,JI).call(this,e)}sub(e){return Pe(this,Zt,JI).call(this,e,"sub")}mulUnsafe(e){return Pe(this,Zt,QI).call(this,e)}mul(e){return Pe(this,Zt,QI).call(this,e,"mul")}mulSignal(e){Pe(this,Zt,Bh).call(this,e);const r=H(this,ir)*H(e,ir);return Ae(r%H(this,pi)===Io,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),Pe(this,Zt,Gc).call(this,r/H(this,pi),"mulSignal")}divUnsafe(e){return Pe(this,Zt,XI).call(this,e)}div(e){return Pe(this,Zt,XI).call(this,e,"div")}divSignal(e){Ae(H(e,ir)!==Io,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),Pe(this,Zt,Bh).call(this,e);const r=H(this,ir)*H(this,pi);return Ae(r%H(e,ir)===Io,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),Pe(this,Zt,Gc).call(this,r/H(e,ir),"divSignal")}cmp(e){let r=this.value,n=e.value;const i=this.decimals-e.decimals;return i>0?n*=fh(i):i<0&&(r*=fh(-i)),r<n?-1:r>n?1:0}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=H(this,ir);return H(this,ir)<Io&&(e-=H(this,pi)-Q0),e=H(this,ir)/H(this,pi)*H(this,pi),Pe(this,Zt,Gc).call(this,e,"floor")}ceiling(){let e=H(this,ir);return H(this,ir)>Io&&(e+=H(this,pi)-Q0),e=H(this,ir)/H(this,pi)*H(this,pi),Pe(this,Zt,Gc).call(this,e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;const r=this.decimals-e,n=V_e*fh(r-1);let i=this.value+n;const s=fh(r);return i=i/s*s,Z1(i,H(this,$o),"round"),new Dl(l0,i,H(this,$o))}isZero(){return H(this,ir)===Io}isNegative(){return H(this,ir)<Io}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Dl.fromString(this.toString(),e)}static fromValue(e,r,n){const i=r==null?0:Et(r),s=fS(n);let o=et(e,"value");const a=i-s.decimals;if(a>0){const c=fh(a);Ae(o%c===Io,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),o/=c}else a<0&&(o*=fh(-a));return Z1(o,s,"fromValue"),new Dl(l0,o,s)}static fromString(e,r){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);ee(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const i=fS(r);let s=n[2]||"0",o=n[3]||"";for(;o.length<i.decimals;)o+=cg;Ae(o.substring(i.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),o=o.substring(0,i.decimals);const a=BigInt(n[1]+s+o);return Z1(a,i,"fromString"),new Dl(l0,a,i)}static fromBytes(e,r){let n=hA(jt(e,"value"));const i=fS(r);return i.signed&&(n=FC(n,i.width)),Z1(n,i,"fromBytes"),new Dl(l0,n,i)}};$o=new WeakMap,ir=new WeakMap,pi=new WeakMap,Zt=new WeakSet,Bh=function(e){ee(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)},Gc=function(e,r){return e=Z1(e,H(this,$o),r),new Dl(l0,e,H(this,$o))},YI=function(e,r){return Pe(this,Zt,Bh).call(this,e),Pe(this,Zt,Gc).call(this,H(this,ir)+H(e,ir),r)},JI=function(e,r){return Pe(this,Zt,Bh).call(this,e),Pe(this,Zt,Gc).call(this,H(this,ir)-H(e,ir),r)},QI=function(e,r){return Pe(this,Zt,Bh).call(this,e),Pe(this,Zt,Gc).call(this,H(this,ir)*H(e,ir)/H(this,pi),r)},XI=function(e,r){return Ae(H(e,ir)!==Io,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),Pe(this,Zt,Bh).call(this,e),Pe(this,Zt,Gc).call(this,H(this,ir)*H(this,pi)/H(e,ir),r)};let qC=Dl;function K_e(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function Dj(t,e,r){let n=0;for(let i=0;i<r;i++)n=n*256+t[e+i];return n}function Mj(t,e,r,n){const i=[];for(;r<e+1+n;){const s=YZ(t,r);i.push(s.result),r+=s.consumed,Ae(r<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:t,length:n,offset:e})}return{consumed:1+n,result:i}}function YZ(t,e){Ae(t.length!==0,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const r=n=>{Ae(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=Dj(t,e+1,n);return r(e+1+n+i),Mj(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),Mj(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=Dj(t,e+1,n);r(e+1+n+i);const s=Je(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=Je(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:K_e(t[e])}}function fA(t){const e=jt(t,"data"),r=YZ(e,0);return ee(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function Lj(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function JZ(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(JZ(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=Lj(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(jt(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=Lj(e.length);return r.unshift(183+r.length),r.concat(e)}const Uj="0123456789abcdef";function Vf(t){let e="0x";for(const r of JZ(t))e+=Uj[r>>4],e+=Uj[r&15];return e}const QZ=["wei","kwei","mwei","gwei","szabo","finney","ether"];function XZ(t,e){let r=18;if(typeof e=="string"){const n=QZ.indexOf(e);ee(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=Et(e,"unit"));return qC.fromValue(t,r,{decimals:r,width:512}).toString()}function Z_e(t,e){ee(typeof t=="string","value must be a string","value",t);let r=18;if(typeof e=="string"){const n=QZ.indexOf(e);ee(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=Et(e,"unit"));return qC.fromString(t,{decimals:r,width:512}).value}function Y_e(t){return XZ(t,18)}const yi=32,eP=new Uint8Array(yi),J_e=["then"],E3={},eY=new WeakMap;function qh(t){return eY.get(t)}function Fj(t,e){eY.set(t,e)}function Y1(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}function tP(t,e,r){return t.indexOf(null)>=0?e.map((n,i)=>n instanceof Em?tP(qh(n),n,r):n):t.reduce((n,i,s)=>{let o=e.getValue(i);return i in n||(r&&o instanceof Em&&(o=tP(qh(o),o,r)),n[i]=o),n},{})}var _g;const eg=class eg extends Array{constructor(...r){const n=r[0];let i=r[1],s=(r[2]||[]).slice(),o=!0;n!==E3&&(i=r,s=[],o=!1);super(i.length);me(this,_g);i.forEach((u,l)=>{this[l]=u});const a=s.reduce((u,l)=>(typeof l=="string"&&u.set(l,(u.get(l)||0)+1),u),new Map);if(Fj(this,Object.freeze(i.map((u,l)=>{const d=s[l];return d!=null&&a.get(d)===1?d:null}))),Z(this,_g,[]),H(this,_g)==null&&H(this,_g),!o)return;Object.freeze(this);const c=new Proxy(this,{get:(u,l,d)=>{if(typeof l=="string"){if(l.match(/^[0-9]+$/)){const f=Et(l,"%index");if(f<0||f>=this.length)throw new RangeError("out of result range");const g=u[f];return g instanceof Error&&Y1(`index ${f}`,g),g}if(J_e.indexOf(l)>=0)return Reflect.get(u,l,d);const h=u[l];if(h instanceof Function)return function(...f){return h.apply(this===d?u:this,f)};if(!(l in u))return u.getValue.apply(this===d?u:this,[l])}return Reflect.get(u,l,d)}});return Fj(c,qh(this)),c}toArray(r){const n=[];return this.forEach((i,s)=>{i instanceof Error&&Y1(`index ${s}`,i),r&&i instanceof eg&&(i=i.toArray(r)),n.push(i)}),n}toObject(r){const n=qh(this);return n.reduce((i,s,o)=>(Ae(s!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),tP(n,this,r)),{})}slice(r,n){r==null&&(r=0),r<0&&(r+=this.length,r<0&&(r=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const i=qh(this),s=[],o=[];for(let a=r;a<n;a++)s.push(this[a]),o.push(i[a]);return new eg(E3,s,o)}filter(r,n){const i=qh(this),s=[],o=[];for(let a=0;a<this.length;a++){const c=this[a];c instanceof Error&&Y1(`index ${a}`,c),r.call(n,c,a,this)&&(s.push(c),o.push(i[a]))}return new eg(E3,s,o)}map(r,n){const i=[];for(let s=0;s<this.length;s++){const o=this[s];o instanceof Error&&Y1(`index ${s}`,o),i.push(r.call(n,o,s,this))}return i}getValue(r){const n=qh(this).indexOf(r);if(n===-1)return;const i=this[n];return i instanceof Error&&Y1(`property ${JSON.stringify(r)}`,i.error),i}static fromItems(r,n){return new eg(E3,r,n)}};_g=new WeakMap;let Em=eg;function Hj(t){let e=bi(t);return Ae(e.length<=yi,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:yi,offset:e.length}),e.length!==yi&&(e=wi(en([eP.slice(e.length%yi),e]))),e}class Gu{constructor(e,r,n,i){ce(this,"name");ce(this,"type");ce(this,"localName");ce(this,"dynamic");ut(this,{name:e,type:r,localName:n,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,r){ee(!1,e,this.localName,r)}}var iu,df,Eg,rC;class rP{constructor(){me(this,Eg);me(this,iu);me(this,df);Z(this,iu,[]),Z(this,df,0)}get data(){return en(H(this,iu))}get length(){return H(this,df)}appendWriter(e){return Pe(this,Eg,rC).call(this,wi(e.data))}writeBytes(e){let r=wi(e);const n=r.length%yi;return n&&(r=wi(en([r,eP.slice(n)]))),Pe(this,Eg,rC).call(this,r)}writeValue(e){return Pe(this,Eg,rC).call(this,Hj(e))}writeUpdatableValue(){const e=H(this,iu).length;return H(this,iu).push(eP),Z(this,df,H(this,df)+yi),r=>{H(this,iu)[e]=Hj(r)}}}iu=new WeakMap,df=new WeakMap,Eg=new WeakSet,rC=function(e){return H(this,iu).push(e),Z(this,df,H(this,df)+e.length),e.length};var Hi,ms,hf,ff,ql,gp,iP,tY;const ER=class ER{constructor(e,r,n){me(this,gp);ce(this,"allowLoose");me(this,Hi);me(this,ms);me(this,hf);me(this,ff);me(this,ql);ut(this,{allowLoose:!!r}),Z(this,Hi,wi(e)),Z(this,hf,0),Z(this,ff,null),Z(this,ql,n??1024),Z(this,ms,0)}get data(){return Je(H(this,Hi))}get dataLength(){return H(this,Hi).length}get consumed(){return H(this,ms)}get bytes(){return new Uint8Array(H(this,Hi))}subReader(e){const r=new ER(H(this,Hi).slice(H(this,ms)+e),this.allowLoose,H(this,ql));return Z(r,ff,this),r}readBytes(e,r){let n=Pe(this,gp,tY).call(this,0,e,!!r);return Pe(this,gp,iP).call(this,e),Z(this,ms,H(this,ms)+n.length),n.slice(0,e)}readValue(){return hA(this.readBytes(yi))}readIndex(){return P_e(this.readBytes(yi))}};Hi=new WeakMap,ms=new WeakMap,hf=new WeakMap,ff=new WeakMap,ql=new WeakMap,gp=new WeakSet,iP=function(e){var r;if(H(this,ff))return Pe(r=H(this,ff),gp,iP).call(r,e);Z(this,hf,H(this,hf)+e),Ae(H(this,ql)<1||H(this,hf)<=H(this,ql)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${H(this,ql)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:wi(H(this,Hi)),offset:H(this,ms),length:e,info:{bytesRead:H(this,hf),dataLength:this.dataLength}})},tY=function(e,r,n){let i=Math.ceil(r/yi)*yi;return H(this,ms)+i>H(this,Hi).length&&(this.allowLoose&&n&&H(this,ms)+r<=H(this,Hi).length?i=r:Ae(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:wi(H(this,Hi)),length:H(this,Hi).length,offset:H(this,ms)+i})),H(this,Hi).slice(H(this,ms),H(this,ms)+i)};let nP=ER;function zC(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function f7(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function Q_e(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");zC(t.outputLen),zC(t.blockLen)}function Cm(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function rY(t,e){f7(t);const r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}const pS=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const nY=t=>t instanceof Uint8Array,X_e=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),gS=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),_a=(t,e)=>t<<32-e|t>>>e,eEe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!eEe)throw new Error("Non little-endian hardware is not supported");function tEe(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function pA(t){if(typeof t=="string"&&(t=tEe(t)),!nY(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function rEe(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!nY(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}let p7=class{clone(){return this._cloneInto()}};function g7(t){const e=n=>t().update(pA(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function nEe(t=32){if(pS&&typeof pS.getRandomValues=="function")return pS.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class iY extends p7{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,Q_e(e);const n=pA(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return Cm(this),this.iHash.update(e),this}digestInto(e){Cm(this),f7(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const sY=(t,e,r)=>new iY(t,e).update(r).digest();sY.create=(t,e)=>new iY(t,e);function iEe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+u,a,n)}class oY extends p7{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=gS(this.buffer)}update(e){Cm(this);const{view:r,buffer:n,blockLen:i}=this;e=pA(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=gS(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Cm(this),rY(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(n,0),o=0);for(let d=o;d<i;d++)r[d]=0;iEe(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=gS(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)a.setUint32(4*d,l[d],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%r&&e.buffer.set(n),e}}const sEe=(t,e,r)=>t&e^~t&r,oEe=(t,e,r)=>t&e^t&r^e&r,aEe=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]),vl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),_l=new Uint32Array(64);class cEe extends oY{constructor(){super(64,32,8,!1),this.A=vl[0]|0,this.B=vl[1]|0,this.C=vl[2]|0,this.D=vl[3]|0,this.E=vl[4]|0,this.F=vl[5]|0,this.G=vl[6]|0,this.H=vl[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let d=0;d<16;d++,r+=4)_l[d]=e.getUint32(r,!1);for(let d=16;d<64;d++){const h=_l[d-15],f=_l[d-2],g=_a(h,7)^_a(h,18)^h>>>3,p=_a(f,17)^_a(f,19)^f>>>10;_l[d]=p+_l[d-7]+g+_l[d-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:u,H:l}=this;for(let d=0;d<64;d++){const h=_a(a,6)^_a(a,11)^_a(a,25),f=l+h+sEe(a,c,u)+aEe[d]+_l[d]|0,p=(_a(n,2)^_a(n,13)^_a(n,22))+oEe(n,i,s)|0;l=u,u=c,c=a,a=o+f|0,o=s,s=i,i=n,n=f+p|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,i,s,o,a,c,u,l)}roundClean(){_l.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const aY=g7(()=>new cEe),C3=BigInt(2**32-1),sP=BigInt(32);function cY(t,e=!1){return e?{h:Number(t&C3),l:Number(t>>sP&C3)}:{h:Number(t>>sP&C3)|0,l:Number(t&C3)|0}}function uY(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=cY(t[i],e);[r[i],n[i]]=[s,o]}return[r,n]}const uEe=(t,e)=>BigInt(t>>>0)<<sP|BigInt(e>>>0),lEe=(t,e,r)=>t>>>r,dEe=(t,e,r)=>t<<32-r|e>>>r,hEe=(t,e,r)=>t>>>r|e<<32-r,fEe=(t,e,r)=>t<<32-r|e>>>r,pEe=(t,e,r)=>t<<64-r|e>>>r-32,gEe=(t,e,r)=>t>>>r-32|e<<64-r,mEe=(t,e)=>e,wEe=(t,e)=>t,lY=(t,e,r)=>t<<r|e>>>32-r,dY=(t,e,r)=>e<<r|t>>>32-r,hY=(t,e,r)=>e<<r-32|t>>>64-r,fY=(t,e,r)=>t<<r-32|e>>>64-r;function bEe(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const yEe=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),vEe=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,_Ee=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),EEe=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,CEe=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),AEe=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,xt={fromBig:cY,split:uY,toBig:uEe,shrSH:lEe,shrSL:dEe,rotrSH:hEe,rotrSL:fEe,rotrBH:pEe,rotrBL:gEe,rotr32H:mEe,rotr32L:wEe,rotlSH:lY,rotlSL:dY,rotlBH:hY,rotlBL:fY,add:bEe,add3L:yEe,add3H:vEe,add4L:_Ee,add4H:EEe,add5H:AEe,add5L:CEe},[xEe,SEe]=xt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),El=new Uint32Array(80),Cl=new Uint32Array(80);class TEe extends oY{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:u,El:l,Fh:d,Fl:h,Gh:f,Gl:g,Hh:p,Hl:m}=this;return[e,r,n,i,s,o,a,c,u,l,d,h,f,g,p,m]}set(e,r,n,i,s,o,a,c,u,l,d,h,f,g,p,m){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=d|0,this.Fl=h|0,this.Gh=f|0,this.Gl=g|0,this.Hh=p|0,this.Hl=m|0}process(e,r){for(let E=0;E<16;E++,r+=4)El[E]=e.getUint32(r),Cl[E]=e.getUint32(r+=4);for(let E=16;E<80;E++){const w=El[E-15]|0,C=Cl[E-15]|0,y=xt.rotrSH(w,C,1)^xt.rotrSH(w,C,8)^xt.shrSH(w,C,7),_=xt.rotrSL(w,C,1)^xt.rotrSL(w,C,8)^xt.shrSL(w,C,7),x=El[E-2]|0,A=Cl[E-2]|0,T=xt.rotrSH(x,A,19)^xt.rotrBH(x,A,61)^xt.shrSH(x,A,6),O=xt.rotrSL(x,A,19)^xt.rotrBL(x,A,61)^xt.shrSL(x,A,6),k=xt.add4L(_,O,Cl[E-7],Cl[E-16]),j=xt.add4H(k,y,T,El[E-7],El[E-16]);El[E]=j|0,Cl[E]=k|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:u,Dl:l,Eh:d,El:h,Fh:f,Fl:g,Gh:p,Gl:m,Hh:b,Hl:v}=this;for(let E=0;E<80;E++){const w=xt.rotrSH(d,h,14)^xt.rotrSH(d,h,18)^xt.rotrBH(d,h,41),C=xt.rotrSL(d,h,14)^xt.rotrSL(d,h,18)^xt.rotrBL(d,h,41),y=d&f^~d&p,_=h&g^~h&m,x=xt.add5L(v,C,_,SEe[E],Cl[E]),A=xt.add5H(x,b,w,y,xEe[E],El[E]),T=x|0,O=xt.rotrSH(n,i,28)^xt.rotrBH(n,i,34)^xt.rotrBH(n,i,39),k=xt.rotrSL(n,i,28)^xt.rotrBL(n,i,34)^xt.rotrBL(n,i,39),j=n&s^n&a^s&a,N=i&o^i&c^o&c;b=p|0,v=m|0,p=f|0,m=g|0,f=d|0,g=h|0,{h:d,l:h}=xt.add(u|0,l|0,A|0,T|0),u=a|0,l=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const S=xt.add3L(T,k,N);n=xt.add3H(S,A,O,j),i=S|0}({h:n,l:i}=xt.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=xt.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=xt.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=xt.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:d,l:h}=xt.add(this.Eh|0,this.El|0,d|0,h|0),{h:f,l:g}=xt.add(this.Fh|0,this.Fl|0,f|0,g|0),{h:p,l:m}=xt.add(this.Gh|0,this.Gl|0,p|0,m|0),{h:b,l:v}=xt.add(this.Hh|0,this.Hl|0,b|0,v|0),this.set(n,i,s,o,a,c,u,l,d,h,f,g,p,m,b,v)}roundClean(){El.fill(0),Cl.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const IEe=g7(()=>new TEe);function PEe(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const qj=PEe();qj.crypto||qj.msCrypto;function OEe(t){switch(t){case"sha256":return aY.create();case"sha512":return IEe.create()}ee(!1,"invalid hashing algorithm name","algorithm",t)}const[pY,gY,mY]=[[],[],[]],REe=BigInt(0),J1=BigInt(1),kEe=BigInt(2),NEe=BigInt(7),$Ee=BigInt(256),jEe=BigInt(113);for(let t=0,e=J1,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],pY.push(2*(5*n+r)),gY.push((t+1)*(t+2)/2%64);let i=REe;for(let s=0;s<7;s++)e=(e<<J1^(e>>NEe)*jEe)%$Ee,e&kEe&&(i^=J1<<(J1<<BigInt(s))-J1);mY.push(i)}const[BEe,DEe]=uY(mY,!0),zj=(t,e,r)=>r>32?hY(t,e,r):lY(t,e,r),Wj=(t,e,r)=>r>32?fY(t,e,r):dY(t,e,r);function MEe(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=r[c],l=r[c+1],d=zj(u,l,1)^r[a],h=Wj(u,l,1)^r[a+1];for(let f=0;f<50;f+=10)t[o+f]^=d,t[o+f+1]^=h}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=gY[o],c=zj(i,s,a),u=Wj(i,s,a),l=pY[o];i=t[l],s=t[l+1],t[l]=c,t[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=BEe[n],t[1]^=DEe[n]}r.fill(0)}class m7 extends p7{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,zC(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=X_e(this.state)}keccak(){MEe(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Cm(this);const{blockLen:r,state:n}=this;e=pA(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);for(let a=0;a<o;a++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Cm(this,!1),f7(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return zC(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(rY(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new m7(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const LEe=(t,e,r)=>g7(()=>new m7(e,t,r)),UEe=LEe(1,136,256/8);let wY=!1;const bY=function(t){return UEe(t)};let yY=bY;function un(t){const e=jt(t,"data");return Je(yY(e))}un._=bY;un.lock=function(){wY=!0};un.register=function(t){if(wY)throw new TypeError("keccak256 is locked");yY=t};Object.freeze(un);const vY=function(t){return OEe("sha256").update(t).digest()};let _Y=vY,EY=!1;function a1(t){const e=jt(t,"data");return Je(_Y(e))}a1._=vY;a1.lock=function(){EY=!0};a1.register=function(t){if(EY)throw new Error("sha256 is locked");_Y=t};Object.freeze(a1);Object.freeze(a1);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const CY=BigInt(0),gA=BigInt(1),FEe=BigInt(2),mA=t=>t instanceof Uint8Array,HEe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Am(t){if(!mA(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=HEe[t[r]];return e}function AY(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function w7(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function xm(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(e/2);for(let n=0;n<r.length;n++){const i=n*2,s=t.slice(i,i+2),o=Number.parseInt(s,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[n]=o}return r}function Rf(t){return w7(Am(t))}function b7(t){if(!mA(t))throw new Error("Uint8Array expected");return w7(Am(Uint8Array.from(t).reverse()))}function Sm(t,e){return xm(t.toString(16).padStart(e*2,"0"))}function y7(t,e){return Sm(t,e).reverse()}function qEe(t){return xm(AY(t))}function Ro(t,e,r){let n;if(typeof e=="string")try{n=xm(e)}catch(s){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${s}`)}else if(mA(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(`${t} expected ${r} bytes, got ${i}`);return n}function vy(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!mA(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function zEe(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function WEe(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function VEe(t){let e;for(e=0;t>CY;t>>=gA,e+=1);return e}function GEe(t,e){return t>>BigInt(e)&gA}const KEe=(t,e,r)=>t|(r?gA:CY)<<BigInt(e),v7=t=>(FEe<<BigInt(t-1))-gA,mS=t=>new Uint8Array(t),Vj=t=>Uint8Array.from(t);function xY(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=mS(t),i=mS(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...d)=>r(i,n,...d),c=(d=mS())=>{i=a(Vj([0]),d),n=a(),d.length!==0&&(i=a(Vj([1]),d),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const h=[];for(;d<e;){n=a();const f=n.slice();h.push(f),d+=n.length}return vy(...h)};return(d,h)=>{o(),c(d);let f;for(;!(f=h(u()));)c();return o(),f}}const ZEe={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Wv(t,e,r={}){const n=(i,s,o)=>{const a=ZEe[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const YEe=Object.freeze(Object.defineProperty({__proto__:null,bitGet:GEe,bitLen:VEe,bitMask:v7,bitSet:KEe,bytesToHex:Am,bytesToNumberBE:Rf,bytesToNumberLE:b7,concatBytes:vy,createHmacDrbg:xY,ensureBytes:Ro,equalBytes:zEe,hexToBytes:xm,hexToNumber:w7,numberToBytesBE:Sm,numberToBytesLE:y7,numberToHexUnpadded:AY,numberToVarBytesBE:qEe,utf8ToBytes:WEe,validateObject:Wv},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Pn=BigInt(0),Qr=BigInt(1),zh=BigInt(2),JEe=BigInt(3),oP=BigInt(4),Gj=BigInt(5),Kj=BigInt(8);BigInt(9);BigInt(16);function Vi(t,e){const r=t%e;return r>=Pn?r:e+r}function QEe(t,e,r){if(r<=Pn||e<Pn)throw new Error("Expected power/modulo > 0");if(r===Qr)return Pn;let n=Qr;for(;e>Pn;)e&Qr&&(n=n*t%r),t=t*t%r,e>>=Qr;return n}function zs(t,e,r){let n=t;for(;e-- >Pn;)n*=n,n%=r;return n}function aP(t,e){if(t===Pn||e<=Pn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Vi(t,e),n=e,i=Pn,s=Qr;for(;r!==Pn;){const a=n/r,c=n%r,u=i-s*a;n=r,r=c,i=s,s=u}if(n!==Qr)throw new Error("invert: does not exist");return Vi(i,e)}function XEe(t){const e=(t-Qr)/zh;let r,n,i;for(r=t-Qr,n=0;r%zh===Pn;r/=zh,n++);for(i=zh;i<t&&QEe(i,e,t)!==t-Qr;i++);if(n===1){const o=(t+Qr)/oP;return function(c,u){const l=c.pow(u,o);if(!c.eql(c.sqr(l),u))throw new Error("Cannot find square root");return l}}const s=(r+Qr)/zh;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=n,l=a.pow(a.mul(a.ONE,i),r),d=a.pow(c,s),h=a.pow(c,r);for(;!a.eql(h,a.ONE);){if(a.eql(h,a.ZERO))return a.ZERO;let f=1;for(let p=a.sqr(h);f<u&&!a.eql(p,a.ONE);f++)p=a.sqr(p);const g=a.pow(l,Qr<<BigInt(u-f-1));l=a.sqr(g),d=a.mul(d,g),h=a.mul(h,l),u=f}return d}}function e5e(t){if(t%oP===JEe){const e=(t+Qr)/oP;return function(n,i){const s=n.pow(i,e);if(!n.eql(n.sqr(s),i))throw new Error("Cannot find square root");return s}}if(t%Kj===Gj){const e=(t-Gj)/Kj;return function(n,i){const s=n.mul(i,zh),o=n.pow(s,e),a=n.mul(i,o),c=n.mul(n.mul(a,zh),o),u=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),i))throw new Error("Cannot find square root");return u}}return XEe(t)}const t5e=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function r5e(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=t5e.reduce((n,i)=>(n[i]="function",n),e);return Wv(t,r)}function n5e(t,e,r){if(r<Pn)throw new Error("Expected power > 0");if(r===Pn)return t.ONE;if(r===Qr)return e;let n=t.ONE,i=e;for(;r>Pn;)r&Qr&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Qr;return n}function i5e(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function SY(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function s5e(t,e,r=!1,n={}){if(t<=Pn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=SY(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=e5e(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:v7(i),ZERO:Pn,ONE:Qr,create:c=>Vi(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Pn<=c&&c<t},is0:c=>c===Pn,isOdd:c=>(c&Qr)===Qr,neg:c=>Vi(-c,t),eql:(c,u)=>c===u,sqr:c=>Vi(c*c,t),add:(c,u)=>Vi(c+u,t),sub:(c,u)=>Vi(c-u,t),mul:(c,u)=>Vi(c*u,t),pow:(c,u)=>n5e(a,c,u),div:(c,u)=>Vi(c*aP(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>aP(c,t),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>i5e(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>r?y7(c,s):Sm(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return r?b7(c):Rf(c)}});return Object.freeze(a)}function TY(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function IY(t){const e=TY(t);return e+Math.ceil(e/2)}function o5e(t,e,r=!1){const n=t.length,i=TY(e),s=IY(e);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?Rf(t):b7(t),a=Vi(o,e-Qr)+Qr;return r?y7(a,i):Sm(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const a5e=BigInt(0),wS=BigInt(1);function c5e(t,e){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>a5e;)s&wS&&(o=o.add(a)),a=a.double(),s>>=wS;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),c=[];let u=i,l=u;for(let d=0;d<o;d++){l=u,c.push(l);for(let h=1;h<a;h++)l=l.add(u),c.push(l);u=l.double()}return c},wNAF(i,s,o){const{windows:a,windowSize:c}=n(i);let u=t.ZERO,l=t.BASE;const d=BigInt(2**i-1),h=2**i,f=BigInt(i);for(let g=0;g<a;g++){const p=g*c;let m=Number(o&d);o>>=f,m>c&&(m-=h,o+=wS);const b=p,v=p+Math.abs(m)-1,E=g%2!==0,w=m<0;m===0?l=l.add(r(E,s[b])):u=u.add(r(w,s[v]))}return{p:u,f:l}},wNAFCached(i,s,o,a){const c=i._WINDOW_SIZE||1;let u=s.get(i);return u||(u=this.precomputeWindow(i,c),c!==1&&s.set(i,a(u))),this.wNAF(c,u,o)}}}function PY(t){return r5e(t.Fp),Wv(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...SY(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function u5e(t){const e=PY(t);Wv(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:l5e,hexToBytes:d5e}=YEe,tf={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=tf;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:l5e(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=tf,r=typeof t=="string"?d5e(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=tf._parseInt(r.subarray(2)),{d:o,l:a}=tf._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{const l=u.toString(16);return l.length&1?`0${l}`:l},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}},mu=BigInt(0),to=BigInt(1);BigInt(2);const Zj=BigInt(3);BigInt(4);function h5e(t){const e=u5e(t),{Fp:r}=e,n=e.toBytes||((g,p,m)=>{const b=p.toAffine();return vy(Uint8Array.from([4]),r.toBytes(b.x),r.toBytes(b.y))}),i=e.fromBytes||(g=>{const p=g.subarray(1),m=r.fromBytes(p.subarray(0,r.BYTES)),b=r.fromBytes(p.subarray(r.BYTES,2*r.BYTES));return{x:m,y:b}});function s(g){const{a:p,b:m}=e,b=r.sqr(g),v=r.mul(b,g);return r.add(r.add(v,r.mul(g,p)),m)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(g){return typeof g=="bigint"&&mu<g&&g<e.n}function a(g){if(!o(g))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(g){const{allowedPrivateKeyLengths:p,nByteLength:m,wrapPrivateKey:b,n:v}=e;if(p&&typeof g!="bigint"){if(g instanceof Uint8Array&&(g=Am(g)),typeof g!="string"||!p.includes(g.length))throw new Error("Invalid key");g=g.padStart(m*2,"0")}let E;try{E=typeof g=="bigint"?g:Rf(Ro("private key",g,m))}catch{throw new Error(`private key must be ${m} bytes, hex or bigint, not ${typeof g}`)}return b&&(E=Vi(E,v)),a(E),E}const u=new Map;function l(g){if(!(g instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(p,m,b){if(this.px=p,this.py=m,this.pz=b,p==null||!r.isValid(p))throw new Error("x required");if(m==null||!r.isValid(m))throw new Error("y required");if(b==null||!r.isValid(b))throw new Error("z required")}static fromAffine(p){const{x:m,y:b}=p||{};if(!p||!r.isValid(m)||!r.isValid(b))throw new Error("invalid affine point");if(p instanceof d)throw new Error("projective point not allowed");const v=E=>r.eql(E,r.ZERO);return v(m)&&v(b)?d.ZERO:new d(m,b,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){const m=r.invertBatch(p.map(b=>b.pz));return p.map((b,v)=>b.toAffine(m[v])).map(d.fromAffine)}static fromHex(p){const m=d.fromAffine(i(Ro("pointHex",p)));return m.assertValidity(),m}static fromPrivateKey(p){return d.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:p,y:m}=this.toAffine();if(!r.isValid(p)||!r.isValid(m))throw new Error("bad point: x or y not FE");const b=r.sqr(m),v=s(p);if(!r.eql(b,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:p}=this.toAffine();if(r.isOdd)return!r.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){l(p);const{px:m,py:b,pz:v}=this,{px:E,py:w,pz:C}=p,y=r.eql(r.mul(m,C),r.mul(E,v)),_=r.eql(r.mul(b,C),r.mul(w,v));return y&&_}negate(){return new d(this.px,r.neg(this.py),this.pz)}double(){const{a:p,b:m}=e,b=r.mul(m,Zj),{px:v,py:E,pz:w}=this;let C=r.ZERO,y=r.ZERO,_=r.ZERO,x=r.mul(v,v),A=r.mul(E,E),T=r.mul(w,w),O=r.mul(v,E);return O=r.add(O,O),_=r.mul(v,w),_=r.add(_,_),C=r.mul(p,_),y=r.mul(b,T),y=r.add(C,y),C=r.sub(A,y),y=r.add(A,y),y=r.mul(C,y),C=r.mul(O,C),_=r.mul(b,_),T=r.mul(p,T),O=r.sub(x,T),O=r.mul(p,O),O=r.add(O,_),_=r.add(x,x),x=r.add(_,x),x=r.add(x,T),x=r.mul(x,O),y=r.add(y,x),T=r.mul(E,w),T=r.add(T,T),x=r.mul(T,O),C=r.sub(C,x),_=r.mul(T,A),_=r.add(_,_),_=r.add(_,_),new d(C,y,_)}add(p){l(p);const{px:m,py:b,pz:v}=this,{px:E,py:w,pz:C}=p;let y=r.ZERO,_=r.ZERO,x=r.ZERO;const A=e.a,T=r.mul(e.b,Zj);let O=r.mul(m,E),k=r.mul(b,w),j=r.mul(v,C),N=r.add(m,b),S=r.add(E,w);N=r.mul(N,S),S=r.add(O,k),N=r.sub(N,S),S=r.add(m,v);let P=r.add(E,C);return S=r.mul(S,P),P=r.add(O,j),S=r.sub(S,P),P=r.add(b,v),y=r.add(w,C),P=r.mul(P,y),y=r.add(k,j),P=r.sub(P,y),x=r.mul(A,S),y=r.mul(T,j),x=r.add(y,x),y=r.sub(k,x),x=r.add(k,x),_=r.mul(y,x),k=r.add(O,O),k=r.add(k,O),j=r.mul(A,j),S=r.mul(T,S),k=r.add(k,j),j=r.sub(O,j),j=r.mul(A,j),S=r.add(S,j),O=r.mul(k,S),_=r.add(_,O),O=r.mul(P,S),y=r.mul(N,y),y=r.sub(y,O),O=r.mul(N,k),x=r.mul(P,x),x=r.add(x,O),new d(y,_,x)}subtract(p){return this.add(p.negate())}is0(){return this.equals(d.ZERO)}wNAF(p){return f.wNAFCached(this,u,p,m=>{const b=r.invertBatch(m.map(v=>v.pz));return m.map((v,E)=>v.toAffine(b[E])).map(d.fromAffine)})}multiplyUnsafe(p){const m=d.ZERO;if(p===mu)return m;if(a(p),p===to)return this;const{endo:b}=e;if(!b)return f.unsafeLadder(this,p);let{k1neg:v,k1:E,k2neg:w,k2:C}=b.splitScalar(p),y=m,_=m,x=this;for(;E>mu||C>mu;)E&to&&(y=y.add(x)),C&to&&(_=_.add(x)),x=x.double(),E>>=to,C>>=to;return v&&(y=y.negate()),w&&(_=_.negate()),_=new d(r.mul(_.px,b.beta),_.py,_.pz),y.add(_)}multiply(p){a(p);let m=p,b,v;const{endo:E}=e;if(E){const{k1neg:w,k1:C,k2neg:y,k2:_}=E.splitScalar(m);let{p:x,f:A}=this.wNAF(C),{p:T,f:O}=this.wNAF(_);x=f.constTimeNegate(w,x),T=f.constTimeNegate(y,T),T=new d(r.mul(T.px,E.beta),T.py,T.pz),b=x.add(T),v=A.add(O)}else{const{p:w,f:C}=this.wNAF(m);b=w,v=C}return d.normalizeZ([b,v])[0]}multiplyAndAddUnsafe(p,m,b){const v=d.BASE,E=(C,y)=>y===mu||y===to||!C.equals(v)?C.multiplyUnsafe(y):C.multiply(y),w=E(this,m).add(E(p,b));return w.is0()?void 0:w}toAffine(p){const{px:m,py:b,pz:v}=this,E=this.is0();p==null&&(p=E?r.ONE:r.inv(v));const w=r.mul(m,p),C=r.mul(b,p),y=r.mul(v,p);if(E)return{x:r.ZERO,y:r.ZERO};if(!r.eql(y,r.ONE))throw new Error("invZ was invalid");return{x:w,y:C}}isTorsionFree(){const{h:p,isTorsionFree:m}=e;if(p===to)return!0;if(m)return m(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:p,clearCofactor:m}=e;return p===to?this:m?m(d,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(d,this,p)}toHex(p=!0){return Am(this.toRawBytes(p))}}d.BASE=new d(e.Gx,e.Gy,r.ONE),d.ZERO=new d(r.ZERO,r.ONE,r.ZERO);const h=e.nBitLength,f=c5e(d,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:o}}function f5e(t){const e=PY(t);return Wv(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function p5e(t){const e=f5e(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(S){return mu<S&&S<r.ORDER}function a(S){return Vi(S,n)}function c(S){return aP(S,n)}const{ProjectivePoint:u,normPrivateKeyToScalar:l,weierstrassEquation:d,isWithinCurveOrder:h}=h5e({...e,toBytes(S,P,I){const B=P.toAffine(),$=r.toBytes(B.x),R=vy;return I?R(Uint8Array.from([P.hasEvenY()?2:3]),$):R(Uint8Array.from([4]),$,r.toBytes(B.y))},fromBytes(S){const P=S.length,I=S[0],B=S.subarray(1);if(P===i&&(I===2||I===3)){const $=Rf(B);if(!o($))throw new Error("Point is not on curve");const R=d($);let D=r.sqrt(R);const L=(D&to)===to;return(I&1)===1!==L&&(D=r.neg(D)),{x:$,y:D}}else if(P===s&&I===4){const $=r.fromBytes(B.subarray(0,r.BYTES)),R=r.fromBytes(B.subarray(r.BYTES,2*r.BYTES));return{x:$,y:R}}else throw new Error(`Point of length ${P} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),f=S=>Am(Sm(S,e.nByteLength));function g(S){const P=n>>to;return S>P}function p(S){return g(S)?a(-S):S}const m=(S,P,I)=>Rf(S.slice(P,I));class b{constructor(P,I,B){this.r=P,this.s=I,this.recovery=B,this.assertValidity()}static fromCompact(P){const I=e.nByteLength;return P=Ro("compactSignature",P,I*2),new b(m(P,0,I),m(P,I,2*I))}static fromDER(P){const{r:I,s:B}=tf.toSig(Ro("DER",P));return new b(I,B)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(P){return new b(this.r,this.s,P)}recoverPublicKey(P){const{r:I,s:B,recovery:$}=this,R=_(Ro("msgHash",P));if($==null||![0,1,2,3].includes($))throw new Error("recovery id invalid");const D=$===2||$===3?I+e.n:I;if(D>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const L=($&1)===0?"02":"03",U=u.fromHex(L+f(D)),z=c(D),W=a(-R*z),K=a(B*z),J=u.BASE.multiplyAndAddUnsafe(U,W,K);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return xm(this.toDERHex())}toDERHex(){return tf.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return xm(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}const v={isValidPrivateKey(S){try{return l(S),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const S=IY(e.n);return o5e(e.randomBytes(S),e.n)},precompute(S=8,P=u.BASE){return P._setWindowSize(S),P.multiply(BigInt(3)),P}};function E(S,P=!0){return u.fromPrivateKey(S).toRawBytes(P)}function w(S){const P=S instanceof Uint8Array,I=typeof S=="string",B=(P||I)&&S.length;return P?B===i||B===s:I?B===2*i||B===2*s:S instanceof u}function C(S,P,I=!0){if(w(S))throw new Error("first arg must be private key");if(!w(P))throw new Error("second arg must be public key");return u.fromHex(P).multiply(l(S)).toRawBytes(I)}const y=e.bits2int||function(S){const P=Rf(S),I=S.length*8-e.nBitLength;return I>0?P>>BigInt(I):P},_=e.bits2int_modN||function(S){return a(y(S))},x=v7(e.nBitLength);function A(S){if(typeof S!="bigint")throw new Error("bigint expected");if(!(mu<=S&&S<x))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Sm(S,e.nByteLength)}function T(S,P,I=O){if(["recovered","canonical"].some(ae=>ae in I))throw new Error("sign() legacy options not supported");const{hash:B,randomBytes:$}=e;let{lowS:R,prehash:D,extraEntropy:L}=I;R==null&&(R=!0),S=Ro("msgHash",S),D&&(S=Ro("prehashed msgHash",B(S)));const U=_(S),z=l(P),W=[A(z),A(U)];if(L!=null){const ae=L===!0?$(r.BYTES):L;W.push(Ro("extraEntropy",ae))}const K=vy(...W),J=U;function ne(ae){const he=y(ae);if(!h(he))return;const ie=c(he),Ee=u.BASE.multiply(he).toAffine(),pe=a(Ee.x);if(pe===mu)return;const ve=a(ie*a(J+pe*z));if(ve===mu)return;let je=(Ee.x===pe?0:2)|Number(Ee.y&to),rt=ve;return R&&g(ve)&&(rt=p(ve),je^=1),new b(pe,rt,je)}return{seed:K,k2sig:ne}}const O={lowS:e.lowS,prehash:!1},k={lowS:e.lowS,prehash:!1};function j(S,P,I=O){const{seed:B,k2sig:$}=T(S,P,I),R=e;return xY(R.hash.outputLen,R.nByteLength,R.hmac)(B,$)}u.BASE._setWindowSize(8);function N(S,P,I,B=k){var Ee;const $=S;if(P=Ro("msgHash",P),I=Ro("publicKey",I),"strict"in B)throw new Error("options.strict was renamed to lowS");const{lowS:R,prehash:D}=B;let L,U;try{if(typeof $=="string"||$ instanceof Uint8Array)try{L=b.fromDER($)}catch(pe){if(!(pe instanceof tf.Err))throw pe;L=b.fromCompact($)}else if(typeof $=="object"&&typeof $.r=="bigint"&&typeof $.s=="bigint"){const{r:pe,s:ve}=$;L=new b(pe,ve)}else throw new Error("PARSE");U=u.fromHex(I)}catch(pe){if(pe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(R&&L.hasHighS())return!1;D&&(P=e.hash(P));const{r:z,s:W}=L,K=_(P),J=c(W),ne=a(K*J),ae=a(z*J),he=(Ee=u.BASE.multiplyAndAddUnsafe(U,ne,ae))==null?void 0:Ee.toAffine();return he?a(he.x)===z:!1}return{CURVE:e,getPublicKey:E,getSharedSecret:C,sign:j,verify:N,ProjectivePoint:u,Signature:b,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function g5e(t){return{hash:t,hmac:(e,...r)=>sY(t,e,rEe(...r)),randomBytes:nEe}}function m5e(t,e){const r=n=>p5e({...t,...g5e(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const OY=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Yj=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),w5e=BigInt(1),cP=BigInt(2),Jj=(t,e)=>(t+e/cP)/e;function b5e(t){const e=OY,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=t*t*t%e,l=u*u*t%e,d=zs(l,r,e)*l%e,h=zs(d,r,e)*l%e,f=zs(h,cP,e)*u%e,g=zs(f,i,e)*f%e,p=zs(g,s,e)*g%e,m=zs(p,a,e)*p%e,b=zs(m,c,e)*m%e,v=zs(b,a,e)*p%e,E=zs(v,r,e)*l%e,w=zs(E,o,e)*g%e,C=zs(w,n,e)*u%e,y=zs(C,cP,e);if(!uP.eql(uP.sqr(y),t))throw new Error("Cannot find square root");return y}const uP=s5e(OY,void 0,void 0,{sqrt:b5e}),$l=m5e({a:BigInt(0),b:BigInt(7),Fp:uP,n:Yj,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=Yj,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-w5e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=Jj(s*t,e),c=Jj(-n*t,e);let u=Vi(t-a*r-c*i,e),l=Vi(-a*n-c*s,e);const d=u>o,h=l>o;if(d&&(u=e-u),h&&(l=e-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:d,k1:u,k2neg:h,k2:l}}}},aY);BigInt(0);$l.ProjectivePoint;const _y="0x0000000000000000000000000000000000000000",Qj="0x0000000000000000000000000000000000000000000000000000000000000000",Xj=BigInt(0),eB=BigInt(1),tB=BigInt(2),rB=BigInt(27),nB=BigInt(28),A3=BigInt(35),d0={};function iB(t){return Wf(bi(t),32)}var Cg,Ag,xg,pf;const Po=class Po{constructor(e,r,n,i){me(this,Cg);me(this,Ag);me(this,xg);me(this,pf);zv(e,d0,"Signature"),Z(this,Cg,r),Z(this,Ag,n),Z(this,xg,i),Z(this,pf,null)}get r(){return H(this,Cg)}set r(e){ee(ag(e)===32,"invalid r","value",e),Z(this,Cg,Je(e))}get s(){return H(this,Ag)}set s(e){ee(ag(e)===32,"invalid s","value",e);const r=Je(e);ee(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),Z(this,Ag,r)}get v(){return H(this,xg)}set v(e){const r=Et(e,"value");ee(r===27||r===28,"invalid v","v",e),Z(this,xg,r)}get networkV(){return H(this,pf)}get legacyChainId(){const e=this.networkV;return e==null?null:Po.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=jt(this.s);return this.yParity&&(e[0]|=128),Je(e)}get compactSerialized(){return en([this.r,this.yParityAndS])}get serialized(){return en([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Po(d0,this.r,this.s,this.v);return this.networkV&&Z(e,pf,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const r=et(e,"v");return r==rB||r==nB?Xj:(ee(r>=A3,"invalid EIP-155 v","v",e),(r-A3)/tB)}static getChainIdV(e,r){return et(e)*tB+BigInt(35+r-27)}static getNormalizedV(e){const r=et(e);return r===Xj||r===rB?27:r===eB||r===nB?28:(ee(r>=A3,"invalid v","v",e),r&eB?27:28)}static from(e){function r(u,l){ee(u,l,"signature",e)}if(e==null)return new Po(d0,Qj,Qj,27);if(typeof e=="string"){const u=jt(e,"signature");if(u.length===64){const l=Je(u.slice(0,32)),d=u.slice(32,64),h=d[0]&128?28:27;return d[0]&=127,new Po(d0,l,Je(d),h)}if(u.length===65){const l=Je(u.slice(0,32)),d=u.slice(32,64);r((d[0]&128)===0,"non-canonical s");const h=Po.getNormalizedV(u[64]);return new Po(d0,l,Je(d),h)}r(!1,"invalid raw signature length")}if(e instanceof Po)return e.clone();const n=e.r;r(n!=null,"missing r");const i=iB(n),s=function(u,l){if(u!=null)return iB(u);if(l!=null){r(vr(l,32),"invalid yParityAndS");const d=jt(l);return d[0]&=127,Je(d)}r(!1,"missing s")}(e.s,e.yParityAndS);r((jt(s)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=function(u,l,d){if(u!=null){const h=et(u);return{networkV:h>=A3?h:void 0,v:Po.getNormalizedV(h)}}if(l!=null)return r(vr(l,32),"invalid yParityAndS"),{v:jt(l)[0]&128?28:27};if(d!=null){switch(Et(d,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new Po(d0,i,s,a);return o&&Z(c,pf,o),r(e.yParity==null||Et(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};Cg=new WeakMap,Ag=new WeakMap,xg=new WeakMap,pf=new WeakMap;let Wo=Po;var su;const Gh=class Gh{constructor(e){me(this,su);ee(ag(e)===32,"invalid private key","privateKey","[REDACTED]"),Z(this,su,Je(e))}get privateKey(){return H(this,su)}get publicKey(){return Gh.computePublicKey(H(this,su))}get compressedPublicKey(){return Gh.computePublicKey(H(this,su),!0)}sign(e){ee(ag(e)===32,"invalid digest length","digest",e);const r=$l.sign(wi(e),wi(H(this,su)),{lowS:!0});return Wo.from({r:vd(r.r,32),s:vd(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Gh.computePublicKey(e);return Je($l.getSharedSecret(wi(H(this,su)),jt(r),!1))}static computePublicKey(e,r){let n=jt(e,"key");if(n.length===32){const s=$l.getPublicKey(n,!!r);return Je(s)}if(n.length===64){const s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}const i=$l.ProjectivePoint.fromHex(n);return Je(i.toRawBytes(r))}static recoverPublicKey(e,r){ee(ag(e)===32,"invalid digest length","digest",e);const n=Wo.from(r);let i=$l.Signature.fromCompact(wi(en([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const s=i.recoverPublicKey(wi(e));return ee(s!=null,"invalid signautre for digest","signature",r),"0x"+s.toHex(!1)}static addPoints(e,r,n){const i=$l.ProjectivePoint.fromHex(Gh.computePublicKey(e).substring(2)),s=$l.ProjectivePoint.fromHex(Gh.computePublicKey(r).substring(2));return"0x"+i.add(s).toHex(!!n)}};su=new WeakMap;let Ey=Gh;const y5e=BigInt(0),v5e=BigInt(36);function sB(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=jt(un(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const _7={};for(let t=0;t<10;t++)_7[String(t)]=String(t);for(let t=0;t<26;t++)_7[String.fromCharCode(65+t)]=String(10+t);const oB=15;function _5e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>_7[n]).join("");for(;e.length>=oB;){let n=e.substring(0,oB);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const E5e=function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t}();function C5e(t){t=t.toLowerCase();let e=y5e;for(let r=0;r<t.length;r++)e=e*v5e+E5e[t[r]];return e}function cr(t){if(ee(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=sB(t);return ee(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){ee(t.substring(2,4)===_5e(t),"bad icap checksum","address",t);let e=C5e(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return sB("0x"+e)}ee(!1,"invalid address","address",t)}function A5e(t){const e=cr(t.from);let n=et(t.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,cr(qr(un(Vf([e,n])),12))}function RY(t){return t&&typeof t.getAddress=="function"}async function bS(t,e){const r=await e;return(r==null||r==="0x0000000000000000000000000000000000000000")&&(Ae(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),ee(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),cr(r)}function vi(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?cr(t):(Ae(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),bS(t,e.resolveName(t)));if(RY(t))return bS(t,t.getAddress());if(t&&typeof t.then=="function")return bS(t,t);ee(!1,"unsupported addressable value","target",t)}const Kc={};function Ze(t,e){let r=!1;return e<0&&(r=!0,e*=-1),new ri(Kc,`${r?"":"u"}int${e}`,t,{signed:r,width:e})}function Ht(t,e){return new ri(Kc,`bytes${e||""}`,t,{size:e})}const aB=Symbol.for("_ethers_typed");var gf;const Zc=class Zc{constructor(e,r,n,i){ce(this,"type");ce(this,"value");me(this,gf);ce(this,"_typedSymbol");i==null&&(i=null),zv(Kc,e,"Typed"),ut(this,{_typedSymbol:aB,type:r,value:n}),Z(this,gf,i),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return H(this,gf)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return H(this,gf)===!0?-1:H(this,gf)===!1?this.value.length:null}static from(e,r){return new Zc(Kc,e,r)}static uint8(e){return Ze(e,8)}static uint16(e){return Ze(e,16)}static uint24(e){return Ze(e,24)}static uint32(e){return Ze(e,32)}static uint40(e){return Ze(e,40)}static uint48(e){return Ze(e,48)}static uint56(e){return Ze(e,56)}static uint64(e){return Ze(e,64)}static uint72(e){return Ze(e,72)}static uint80(e){return Ze(e,80)}static uint88(e){return Ze(e,88)}static uint96(e){return Ze(e,96)}static uint104(e){return Ze(e,104)}static uint112(e){return Ze(e,112)}static uint120(e){return Ze(e,120)}static uint128(e){return Ze(e,128)}static uint136(e){return Ze(e,136)}static uint144(e){return Ze(e,144)}static uint152(e){return Ze(e,152)}static uint160(e){return Ze(e,160)}static uint168(e){return Ze(e,168)}static uint176(e){return Ze(e,176)}static uint184(e){return Ze(e,184)}static uint192(e){return Ze(e,192)}static uint200(e){return Ze(e,200)}static uint208(e){return Ze(e,208)}static uint216(e){return Ze(e,216)}static uint224(e){return Ze(e,224)}static uint232(e){return Ze(e,232)}static uint240(e){return Ze(e,240)}static uint248(e){return Ze(e,248)}static uint256(e){return Ze(e,256)}static uint(e){return Ze(e,256)}static int8(e){return Ze(e,-8)}static int16(e){return Ze(e,-16)}static int24(e){return Ze(e,-24)}static int32(e){return Ze(e,-32)}static int40(e){return Ze(e,-40)}static int48(e){return Ze(e,-48)}static int56(e){return Ze(e,-56)}static int64(e){return Ze(e,-64)}static int72(e){return Ze(e,-72)}static int80(e){return Ze(e,-80)}static int88(e){return Ze(e,-88)}static int96(e){return Ze(e,-96)}static int104(e){return Ze(e,-104)}static int112(e){return Ze(e,-112)}static int120(e){return Ze(e,-120)}static int128(e){return Ze(e,-128)}static int136(e){return Ze(e,-136)}static int144(e){return Ze(e,-144)}static int152(e){return Ze(e,-152)}static int160(e){return Ze(e,-160)}static int168(e){return Ze(e,-168)}static int176(e){return Ze(e,-176)}static int184(e){return Ze(e,-184)}static int192(e){return Ze(e,-192)}static int200(e){return Ze(e,-200)}static int208(e){return Ze(e,-208)}static int216(e){return Ze(e,-216)}static int224(e){return Ze(e,-224)}static int232(e){return Ze(e,-232)}static int240(e){return Ze(e,-240)}static int248(e){return Ze(e,-248)}static int256(e){return Ze(e,-256)}static int(e){return Ze(e,-256)}static bytes1(e){return Ht(e,1)}static bytes2(e){return Ht(e,2)}static bytes3(e){return Ht(e,3)}static bytes4(e){return Ht(e,4)}static bytes5(e){return Ht(e,5)}static bytes6(e){return Ht(e,6)}static bytes7(e){return Ht(e,7)}static bytes8(e){return Ht(e,8)}static bytes9(e){return Ht(e,9)}static bytes10(e){return Ht(e,10)}static bytes11(e){return Ht(e,11)}static bytes12(e){return Ht(e,12)}static bytes13(e){return Ht(e,13)}static bytes14(e){return Ht(e,14)}static bytes15(e){return Ht(e,15)}static bytes16(e){return Ht(e,16)}static bytes17(e){return Ht(e,17)}static bytes18(e){return Ht(e,18)}static bytes19(e){return Ht(e,19)}static bytes20(e){return Ht(e,20)}static bytes21(e){return Ht(e,21)}static bytes22(e){return Ht(e,22)}static bytes23(e){return Ht(e,23)}static bytes24(e){return Ht(e,24)}static bytes25(e){return Ht(e,25)}static bytes26(e){return Ht(e,26)}static bytes27(e){return Ht(e,27)}static bytes28(e){return Ht(e,28)}static bytes29(e){return Ht(e,29)}static bytes30(e){return Ht(e,30)}static bytes31(e){return Ht(e,31)}static bytes32(e){return Ht(e,32)}static address(e){return new Zc(Kc,"address",e)}static bool(e){return new Zc(Kc,"bool",!!e)}static bytes(e){return new Zc(Kc,"bytes",e)}static string(e){return new Zc(Kc,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new Zc(Kc,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===aB}static dereference(e,r){if(Zc.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};gf=new WeakMap;let ri=Zc;class x5e extends Gu{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=ri.dereference(r,"string");try{n=cr(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return cr(vd(e.readValue(),20))}}class S5e extends Gu{constructor(r){super(r.name,r.type,"_",r.dynamic);ce(this,"coder");this.coder=r}defaultValue(){return this.coder.defaultValue()}encode(r,n){return this.coder.encode(r,n)}decode(r){return this.coder.decode(r)}}function kY(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(u=>{const l=u.localName;return Ae(l,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),Ae(!c[l],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),c[l]=!0,r[l]})}else ee(!1,"invalid tuple value","tuple",r);ee(e.length===n.length,"types/value length mismatch","tuple",r);let i=new rP,s=new rP,o=[];e.forEach((c,u)=>{let l=n[u];if(c.dynamic){let d=s.length;c.encode(s,l);let h=i.writeUpdatableValue();o.push(f=>{h(f+d)})}else c.encode(i,l)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function NY(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readIndex(),c=i.subReader(a);try{o=s.decode(c)}catch(u){if(ti(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(ti(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}if(o==null)throw new Error("investigate");r.push(o),n.push(s.localName||null)}),Em.fromItems(r,n)}class T5e extends Gu{constructor(r,n,i){const s=r.type+"["+(n>=0?n:"")+"]",o=n===-1||r.dynamic;super("array",s,i,o);ce(this,"coder");ce(this,"length");ut(this,{coder:r,length:n})}defaultValue(){const r=this.coder.defaultValue(),n=[];for(let i=0;i<this.length;i++)n.push(r);return n}encode(r,n){const i=ri.dereference(n,"array");Array.isArray(i)||this._throwError("expected array value",i);let s=this.length;s===-1&&(s=i.length,r.writeValue(i.length)),UZ(i.length,s,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let a=0;a<i.length;a++)o.push(this.coder);return kY(r,o,i)}decode(r){let n=this.length;n===-1&&(n=r.readIndex(),Ae(n*yi<=r.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:r.bytes,offset:n*yi,length:r.dataLength}));let i=[];for(let s=0;s<n;s++)i.push(new S5e(this.coder));return NY(r,i)}}class I5e extends Gu{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,r){const n=ri.dereference(r,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class $Y extends Gu{constructor(e,r){super(e,e,r,!0)}defaultValue(){return"0x"}encode(e,r){r=wi(r);let n=e.writeValue(r.length);return n+=e.writeBytes(r),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class P5e extends $Y{constructor(e){super("bytes",e)}decode(e){return Je(super.decode(e))}}class O5e extends Gu{constructor(r,n){let i="bytes"+String(r);super(i,i,n,!1);ce(this,"size");ut(this,{size:r},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(r,n){let i=wi(ri.dereference(n,this.type));return i.length!==this.size&&this._throwError("incorrect data length",n),r.writeBytes(i)}decode(r){return Je(r.readBytes(this.size))}}const R5e=new Uint8Array([]);class k5e extends Gu{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes(R5e)}decode(e){return e.readBytes(0),null}}const N5e=BigInt(0),$5e=BigInt(1),j5e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class B5e extends Gu{constructor(r,n,i){const s=(n?"int":"uint")+r*8;super(s,s,i,!1);ce(this,"size");ce(this,"signed");ut(this,{size:r,signed:n},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(r,n){let i=et(ri.dereference(n,this.type)),s=ef(j5e,yi*8);if(this.signed){let o=ef(s,this.size*8-1);(i>o||i<-(o+$5e))&&this._throwError("value out-of-bounds",n),i=qZ(i,8*yi)}else(i<N5e||i>ef(s,this.size*8))&&this._throwError("value out-of-bounds",n);return r.writeValue(i)}decode(r){let n=ef(r.readValue(),this.size*8);return this.signed&&(n=FC(n,this.size*8)),n}}class D5e extends $Y{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Za(ri.dereference(r,"string")))}decode(e){return HC(super.decode(e))}}class x3 extends Gu{constructor(r,n){let i=!1;const s=[];r.forEach(a=>{a.dynamic&&(i=!0),s.push(a.type)});const o="tuple("+s.join(",")+")";super("tuple",o,n,i);ce(this,"coders");ut(this,{coders:Object.freeze(r.slice())})}defaultValue(){const r=[];this.coders.forEach(i=>{r.push(i.defaultValue())});const n=this.coders.reduce((i,s)=>{const o=s.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,s)=>{let o=i.localName;!o||n[o]!==1||(o==="length"&&(o="_length"),r[o]==null&&(r[o]=r[s]))}),Object.freeze(r)}encode(r,n){const i=ri.dereference(n,"tuple");return kY(r,this.coders,i)}decode(r){return NY(r,this.coders)}}function Gf(t){return un(Za(t))}var M5e="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const cB=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),uB=4;function L5e(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let C=1;C<n;C++)s.push(i+=r());let o=r(),a=e;e+=o;let c=0,u=0;function l(){return c==0&&(u=u<<8|t[e++],c=8),u>>--c&1}const d=31,h=2**d,f=h>>>1,g=f>>1,p=h-1;let m=0;for(let C=0;C<d;C++)m=m<<1|l();let b=[],v=0,E=h;for(;;){let C=Math.floor(((m-v+1)*i-1)/E),y=0,_=n;for(;_-y>1;){let T=y+_>>>1;C<s[T]?_=T:y=T}if(y==0)break;b.push(y);let x=v+Math.floor(E*s[y]/i),A=v+Math.floor(E*s[y+1]/i)-1;for(;((x^A)&f)==0;)m=m<<1&p|l(),x=x<<1&p,A=A<<1&p|1;for(;x&~A&g;)m=m&f|m<<1&p>>>1|l(),x=x<<1^f,A=(A^f)<<1|f|1;v=x,E=1+A-x}let w=n-4;return b.map(C=>{switch(C-w){case 3:return w+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return w+256+(t[a++]<<8|t[a++]);case 1:return w+t[a++];default:return C-1}})}function U5e(t){let e=0;return()=>t[e++]}function jY(t){return U5e(L5e(F5e(t)))}function F5e(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i<r;i++)a=a<<6|e[t.charCodeAt(i)],o+=6,o>=8&&(n[s++]=a>>(o-=8));return n}function H5e(t){return t&1?~t>>1:t>>1}function q5e(t,e){let r=Array(t);for(let n=0,i=0;n<t;n++)r[n]=i+=H5e(e());return r}function Cy(t,e=0){let r=[];for(;;){let n=t(),i=t();if(!i)break;e+=n;for(let s=0;s<i;s++)r.push(e+s);e+=i+1}return r}function BY(t){return Ay(()=>{let e=Cy(t);if(e.length)return e})}function DY(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(z5e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(W5e(r,t))}return e.flat()}function Ay(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function MY(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;i<e;i++)q5e(t,r).forEach((s,o)=>n[o].push(s));return n}function z5e(t,e){let r=1+e(),n=e(),i=Ay(e);return MY(i.length,1+t,e).flatMap((o,a)=>{let[c,...u]=o;return Array(i[a]).fill().map((l,d)=>{let h=d*n;return[c+d*r,u.map(f=>f+h)]})})}function W5e(t,e){let r=1+e();return MY(r,1+t,e).map(i=>[i[0],i.slice(1)])}function V5e(t){let e=[],r=Cy(t);return i(n([]),[]),e;function n(s){let o=t(),a=Ay(()=>{let c=Cy(t).map(u=>r[u]);if(c.length)return n(c)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,c){if(!(s&4&&c===a[a.length-1])){s&2&&(c=a[a.length-1]),s&1&&e.push(a);for(let u of o)for(let l of u.Q)i(u,[...a,l],c)}}}function G5e(t){return t.toString(16).toUpperCase().padStart(2,"0")}function LY(t){return`{${G5e(t)}}`}function K5e(t){let e=[];for(let r=0,n=t.length;r<n;){let i=t.codePointAt(r);r+=i<65536?1:2,e.push(i)}return e}function Tm(t){let r=t.length;if(r<4096)return String.fromCodePoint(...t);let n=[];for(let i=0;i<r;)n.push(String.fromCodePoint(...t.slice(i,i+=4096)));return n.join("")}function Z5e(t,e){let r=t.length,n=r-e.length;for(let i=0;n==0&&i<r;i++)n=t[i]-e[i];return n}var Y5e="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const xy=44032,WC=4352,VC=4449,GC=4519,UY=19,FY=21,Im=28,KC=FY*Im,J5e=UY*KC,Q5e=xy+J5e,X5e=WC+UY,e4e=VC+FY,t4e=GC+Im;function sb(t){return t>>24&255}function HY(t){return t&16777215}let lP,lB,dP,nC;function r4e(){let t=jY(Y5e);lP=new Map(BY(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),lB=new Set(Cy(t)),dP=new Map,nC=new Map;for(let[e,r]of DY(t)){if(!lB.has(e)&&r.length==2){let[n,i]=r,s=nC.get(n);s||(s=new Map,nC.set(n,s)),s.set(i,e)}dP.set(e,r.reverse())}}function qY(t){return t>=xy&&t<Q5e}function n4e(t,e){if(t>=WC&&t<X5e&&e>=VC&&e<e4e)return xy+(t-WC)*KC+(e-VC)*Im;if(qY(t)&&e>GC&&e<t4e&&(t-xy)%Im==0)return t+(e-GC);{let r=nC.get(t);return r&&(r=r.get(e),r)?r:-1}}function zY(t){lP||r4e();let e=[],r=[],n=!1;function i(s){let o=lP.get(s);o&&(n=!0,s|=o),e.push(s)}for(let s of t)for(;;){if(s<128)e.push(s);else if(qY(s)){let o=s-xy,a=o/KC|0,c=o%KC/Im|0,u=o%Im;i(WC+a),i(VC+c),u>0&&i(GC+u)}else{let o=dP.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=sb(e[0]);for(let o=1;o<e.length;o++){let a=sb(e[o]);if(a==0||s<=a){s=a;continue}let c=o-1;for(;;){let u=e[c+1];if(e[c+1]=e[c],e[c]=u,!c||(s=sb(e[--c]),s<=a))break}s=sb(e[o])}}return e}function i4e(t){let e=[],r=[],n=-1,i=0;for(let s of t){let o=sb(s),a=HY(s);if(n==-1)o==0?n=a:e.push(a);else if(i>0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let c=n4e(n,a);c>=0?n=c:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function WY(t){return zY(t).map(HY)}function s4e(t){return i4e(zY(t))}const dB=45,VY=".",GY=65039,KY=1,ZC=t=>Array.from(t);function Sy(t,e){return t.P.has(e)||t.Q.has(e)}class o4e extends Array{get is_emoji(){return!0}}let hP,ZY,rf,fP,YY,ug,yS,F0,Dh,hB,pP;function E7(){if(hP)return;let t=jY(M5e);const e=()=>Cy(t),r=()=>new Set(e()),n=(l,d)=>d.forEach(h=>l.add(h));hP=new Map(DY(t)),ZY=r(),rf=e(),fP=new Set(e().map(l=>rf[l])),rf=new Set(rf),YY=r(),r();let i=BY(t),s=t();const o=()=>{let l=new Set;return e().forEach(d=>n(l,i[d])),n(l,e()),l};ug=Ay(l=>{let d=Ay(t).map(h=>h+96);if(d.length){let h=l>=s;d[0]-=32,d=Tm(d),h&&(d=`Restricted[${d}]`);let f=o(),g=o(),p=!t();return{N:d,P:f,Q:g,M:p,R:h}}}),yS=r(),F0=new Map;let a=e().concat(ZC(yS)).sort((l,d)=>l-d);a.forEach((l,d)=>{let h=t(),f=a[d]=h?a[d-h]:{V:[],M:new Map};f.V.push(l),yS.has(l)||F0.set(l,f)});for(let{V:l,M:d}of new Set(F0.values())){let h=[];for(let g of l){let p=ug.filter(b=>Sy(b,g)),m=h.find(({G:b})=>p.some(v=>b.has(v)));m||(m={G:new Set,V:[]},h.push(m)),m.V.push(g),n(m.G,p)}let f=h.flatMap(g=>ZC(g.G));for(let{G:g,V:p}of h){let m=new Set(f.filter(b=>!g.has(b)));for(let b of p)d.set(b,m)}}Dh=new Set;let c=new Set;const u=l=>Dh.has(l)?c.add(l):Dh.add(l);for(let l of ug){for(let d of l.P)u(d);for(let d of l.Q)u(d)}for(let l of Dh)!F0.has(l)&&!c.has(l)&&F0.set(l,KY);n(Dh,WY(Dh)),hB=V5e(t).map(l=>o4e.from(l)).sort(Z5e),pP=new Map;for(let l of hB){let d=[pP];for(let h of l){let f=d.map(g=>{let p=g.get(h);return p||(p=new Map,g.set(h,p)),p});h===GY?d.push(...f):d=f}for(let h of d)h.V=l}}function C7(t){return(JY(t)?"":`${A7(wA([t]))} `)+LY(t)}function A7(t){return`"${t}"`}function a4e(t){if(t.length>=4&&t[2]==dB&&t[3]==dB)throw new Error(`invalid label extension: "${Tm(t.slice(0,4))}"`)}function c4e(t){for(let r=t.lastIndexOf(95);r>0;)if(t[--r]!==95)throw new Error("underscore allowed only at start")}function u4e(t){let e=t[0],r=cB.get(e);if(r)throw vb(`leading ${r}`);let n=t.length,i=-1;for(let s=1;s<n;s++){e=t[s];let o=cB.get(e);if(o){if(i==s)throw vb(`${r} + ${o}`);i=s+1,r=o}}if(i==n)throw vb(`trailing ${r}`)}function wA(t,e=1/0,r=LY){let n=[];l4e(t[0])&&n.push("◌"),t.length>e&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,s=t.length;for(let o=0;o<s;o++){let a=t[o];JY(a)&&(n.push(Tm(t.slice(i,o))),n.push(r(a)),i=o+1)}return n.push(Tm(t.slice(i,s))),n.join("")}function l4e(t){return E7(),rf.has(t)}function JY(t){return E7(),YY.has(t)}function d4e(t){return g4e(h4e(t,s4e,b4e))}function h4e(t,e,r){if(!t)return[];E7();let n=0;return t.split(VY).map(i=>{let s=K5e(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=w4e(s,e,r),c=a.length,u;if(!c)throw new Error("empty label");let l=o.output=a.flat();if(c4e(l),!(o.emoji=c>1||a[0].is_emoji)&&l.every(h=>h<128))a4e(l),u="ASCII";else{let h=a.flatMap(f=>f.is_emoji?[]:f);if(!h.length)u="Emoji";else{if(rf.has(l[0]))throw vb("leading combining mark");for(let p=1;p<c;p++){let m=a[p];if(!m.is_emoji&&rf.has(m[0]))throw vb(`emoji + combining mark: "${Tm(a[p-1])} + ${wA([m[0]])}"`)}u4e(l);let f=ZC(new Set(h)),[g]=p4e(f);m4e(g,h),f4e(g,f),u=g.N}}o.type=u}catch(a){o.error=a}return o})}function f4e(t,e){let r,n=[];for(let i of e){let s=F0.get(i);if(s===KY)return;if(s){let o=s.M.get(i);if(r=r?r.filter(a=>o.has(a)):ZC(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>Sy(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function p4e(t){let e=ug;for(let r of t){let n=e.filter(i=>Sy(i,r));if(!n.length)throw ug.some(i=>Sy(i,r))?XY(e[0],r):QY(r);if(e=n,n.length==1)break}return e}function g4e(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${A7(wA(e,63))}: ${i}`)}return Tm(n)}).join(VY)}function QY(t){return new Error(`disallowed character: ${C7(t)}`)}function XY(t,e){let r=C7(e),n=ug.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function vb(t){return new Error(`illegal placement: ${t}`)}function m4e(t,e){for(let r of e)if(!Sy(t,r))throw XY(t,r);if(t.M){let r=WY(e);for(let n=1,i=r.length;n<i;n++)if(fP.has(r[n])){let s=n+1;for(let o;s<i&&fP.has(o=r[s]);s++)for(let a=n;a<s;a++)if(r[a]==o)throw new Error(`duplicate non-spacing marks: ${C7(o)}`);if(s-n>uB)throw new Error(`excessive non-spacing marks: ${A7(wA(r.slice(n-1,s)))} (${s-n}/${uB})`);n=s}}}function w4e(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=y4e(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(Dh.has(o))i.push(o);else{let a=hP.get(o);if(a)i.push(...a);else if(!ZY.has(o))throw QY(o)}}}return i.length&&n.push(e(i)),n}function b4e(t){return t.filter(e=>e!=GY)}function y4e(t,e){let r=pP,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,t.length=i)}return n}const eJ=new Uint8Array(32);eJ.fill(0);function fB(t){return ee(t.length!==0,"invalid ENS name; empty component","comp",t),t}function tJ(t){const e=Za(v4e(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(r.push(fB(e.slice(n,i))),n=i+1);return ee(n<e.length,"invalid ENS name; empty component","name",t),r.push(fB(e.slice(n))),r}function v4e(t){try{if(t.length===0)throw new Error("empty label");return d4e(t)}catch(e){ee(!1,`invalid ENS name (${e.message})`,"name",t)}}function gP(t){ee(typeof t=="string","invalid ENS name; not a string","name",t),ee(t.length,"invalid ENS name (empty label)","name",t);let e=eJ;const r=tJ(t);for(;r.length;)e=un(en([e,un(r.pop())]));return Je(e)}function _4e(t,e){const r=e;return ee(r<=255,"DNS encoded label cannot exceed 255","length",r),Je(en(tJ(t).map(n=>{ee(n.length<=r,`label ${JSON.stringify(t)} exceeds ${r} bytes`,"name",t);const i=new Uint8Array(n.length+1);return i.set(n,1),i[0]=i.length-1,i})))+"00"}function vS(t,e){return{address:cr(t),storageKeys:e.map((r,n)=>(ee(vr(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function Ap(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(ee(r.length===2,"invalid slot set",`value[${n}]`,r),vS(r[0],r[1])):(ee(r!=null&&typeof r=="object","invalid address-slot set","value",t),vS(r.address,r.storageKeys)));ee(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return vS(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function E4e(t){let e;return typeof t=="string"?e=Ey.computePublicKey(t,!1):e=t.publicKey,cr(un("0x"+e.substring(4)).substring(26))}function C4e(t,e){return E4e(Ey.recoverPublicKey(t,e))}const An=BigInt(0),A4e=BigInt(2),x4e=BigInt(27),S4e=BigInt(28),T4e=BigInt(35),I4e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),_S=4096*32;function pB(t,e){let r=t.toString(16);for(;r.length<2;)r="0"+r;return r+=a1(e).substring(4),"0x"+r}function bA(t){return t==="0x"?null:cr(t)}function x7(t,e){try{return Ap(t)}catch(r){ee(!1,r.message,e,t)}}function Vv(t,e){return t==="0x"?0:Et(t,e)}function Xr(t,e){if(t==="0x")return An;const r=et(t,e);return ee(r<=I4e,"value exceeds uint size",e,r),r}function Rr(t,e){const r=et(t,"value"),n=bi(r);return ee(n.length<=32,"value too large",`tx.${e}`,r),n}function S7(t){return Ap(t).map(e=>[e.address,e.storageKeys])}function P4e(t,e){ee(Array.isArray(t),`invalid ${e}`,"value",t);for(let r=0;r<t.length;r++)ee(vr(t[r],32),"invalid ${ param } hash",`value[${r}]`,t[r]);return t}function O4e(t){const e=fA(t);ee(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const r={type:0,nonce:Vv(e[0],"nonce"),gasPrice:Xr(e[1],"gasPrice"),gasLimit:Xr(e[2],"gasLimit"),to:bA(e[3]),value:Xr(e[4],"value"),data:Je(e[5]),chainId:An};if(e.length===6)return r;const n=Xr(e[6],"v"),i=Xr(e[7],"r"),s=Xr(e[8],"s");if(i===An&&s===An)r.chainId=n;else{let o=(n-T4e)/A4e;o<An&&(o=An),r.chainId=o,ee(o!==An||n===x4e||n===S4e,"non-canonical legacy v","v",e[6]),r.signature=Wo.from({r:Wf(e[7],32),s:Wf(e[8],32),v:n})}return r}function R4e(t,e){const r=[Rr(t.nonce,"nonce"),Rr(t.gasPrice||0,"gasPrice"),Rr(t.gasLimit,"gasLimit"),t.to||"0x",Rr(t.value,"value"),t.data];let n=An;if(t.chainId!=An)n=et(t.chainId,"tx.chainId"),ee(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const s=t.signature.legacyChainId;s!=null&&(n=s)}if(!e)return n!==An&&(r.push(bi(n)),r.push("0x"),r.push("0x")),Vf(r);let i=BigInt(27+e.yParity);return n!==An?i=Wo.getChainIdV(n,e.v):BigInt(e.v)!==i&&ee(!1,"tx.chainId/sig.v mismatch","sig",e),r.push(bi(i)),r.push(bi(e.r)),r.push(bi(e.s)),Vf(r)}function T7(t,e){let r;try{if(r=Vv(e[0],"yParity"),r!==0&&r!==1)throw new Error("bad yParity")}catch{ee(!1,"invalid yParity","yParity",e[0])}const n=Wf(e[1],32),i=Wf(e[2],32),s=Wo.from({r:n,s:i,yParity:r});t.signature=s}function k4e(t){const e=fA(jt(t).slice(1));ee(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",Je(t));const r={type:2,chainId:Xr(e[0],"chainId"),nonce:Vv(e[1],"nonce"),maxPriorityFeePerGas:Xr(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Xr(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Xr(e[4],"gasLimit"),to:bA(e[5]),value:Xr(e[6],"value"),data:Je(e[7]),accessList:x7(e[8],"accessList")};return e.length===9||T7(r,e.slice(9)),r}function N4e(t,e){const r=[Rr(t.chainId,"chainId"),Rr(t.nonce,"nonce"),Rr(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Rr(t.maxFeePerGas||0,"maxFeePerGas"),Rr(t.gasLimit,"gasLimit"),t.to||"0x",Rr(t.value,"value"),t.data,S7(t.accessList||[])];return e&&(r.push(Rr(e.yParity,"yParity")),r.push(bi(e.r)),r.push(bi(e.s))),en(["0x02",Vf(r)])}function $4e(t){const e=fA(jt(t).slice(1));ee(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",Je(t));const r={type:1,chainId:Xr(e[0],"chainId"),nonce:Vv(e[1],"nonce"),gasPrice:Xr(e[2],"gasPrice"),gasLimit:Xr(e[3],"gasLimit"),to:bA(e[4]),value:Xr(e[5],"value"),data:Je(e[6]),accessList:x7(e[7],"accessList")};return e.length===8||T7(r,e.slice(8)),r}function j4e(t,e){const r=[Rr(t.chainId,"chainId"),Rr(t.nonce,"nonce"),Rr(t.gasPrice||0,"gasPrice"),Rr(t.gasLimit,"gasLimit"),t.to||"0x",Rr(t.value,"value"),t.data,S7(t.accessList||[])];return e&&(r.push(Rr(e.yParity,"recoveryParam")),r.push(bi(e.r)),r.push(bi(e.s))),en(["0x01",Vf(r)])}function B4e(t){let e=fA(jt(t).slice(1)),r="3",n=null;if(e.length===4&&Array.isArray(e[0])){r="3 (network format)";const s=e[1],o=e[2],a=e[3];ee(Array.isArray(s),"invalid network format: blobs not an array","fields[1]",s),ee(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),ee(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),ee(s.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),ee(s.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",e),n=[];for(let c=0;c<e[1].length;c++)n.push({data:s[c],commitment:o[c],proof:a[c]});e=e[0]}ee(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${r}`,"data",Je(t));const i={type:3,chainId:Xr(e[0],"chainId"),nonce:Vv(e[1],"nonce"),maxPriorityFeePerGas:Xr(e[2],"maxPriorityFeePerGas"),maxFeePerGas:Xr(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:Xr(e[4],"gasLimit"),to:bA(e[5]),value:Xr(e[6],"value"),data:Je(e[7]),accessList:x7(e[8],"accessList"),maxFeePerBlobGas:Xr(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};n&&(i.blobs=n),ee(i.to!=null,`invalid address for transaction type: ${r}`,"data",t),ee(Array.isArray(i.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let s=0;s<i.blobVersionedHashes.length;s++)ee(vr(i.blobVersionedHashes[s],32),`invalid blobVersionedHash at index ${s}: must be length 32`,"data",t);return e.length===11||T7(i,e.slice(11)),i}function D4e(t,e,r){const n=[Rr(t.chainId,"chainId"),Rr(t.nonce,"nonce"),Rr(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Rr(t.maxFeePerGas||0,"maxFeePerGas"),Rr(t.gasLimit,"gasLimit"),t.to||_y,Rr(t.value,"value"),t.data,S7(t.accessList||[]),Rr(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),P4e(t.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(n.push(Rr(e.yParity,"yParity")),n.push(bi(e.r)),n.push(bi(e.s)),r)?en(["0x03",Vf([n,r.map(i=>i.data),r.map(i=>i.commitment),r.map(i=>i.proof)])]):en(["0x03",Vf(n)])}var Oa,Sg,Tg,Ig,Pg,Og,Rg,kg,Ng,$g,jg,Bg,mf,zl,ou,Wl,Dg,iC;const Yc=class Yc{constructor(){me(this,Dg);me(this,Oa);me(this,Sg);me(this,Tg);me(this,Ig);me(this,Pg);me(this,Og);me(this,Rg);me(this,kg);me(this,Ng);me(this,$g);me(this,jg);me(this,Bg);me(this,mf);me(this,zl);me(this,ou);me(this,Wl);Z(this,Oa,null),Z(this,Sg,null),Z(this,Ig,0),Z(this,Pg,An),Z(this,Og,null),Z(this,Rg,null),Z(this,kg,null),Z(this,Tg,"0x"),Z(this,Ng,An),Z(this,$g,An),Z(this,jg,null),Z(this,Bg,null),Z(this,mf,null),Z(this,zl,null),Z(this,Wl,null),Z(this,ou,null)}get type(){return H(this,Oa)}set type(e){switch(e){case null:Z(this,Oa,null);break;case 0:case"legacy":Z(this,Oa,0);break;case 1:case"berlin":case"eip-2930":Z(this,Oa,1);break;case 2:case"london":case"eip-1559":Z(this,Oa,2);break;case 3:case"cancun":case"eip-4844":Z(this,Oa,3);break;default:ee(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){const e=H(this,Sg);return e==null&&this.type===3?_y:e}set to(e){Z(this,Sg,e==null?null:cr(e))}get nonce(){return H(this,Ig)}set nonce(e){Z(this,Ig,Et(e,"value"))}get gasLimit(){return H(this,Pg)}set gasLimit(e){Z(this,Pg,et(e))}get gasPrice(){const e=H(this,Og);return e==null&&(this.type===0||this.type===1)?An:e}set gasPrice(e){Z(this,Og,e==null?null:et(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=H(this,Rg);return e??(this.type===2||this.type===3?An:null)}set maxPriorityFeePerGas(e){Z(this,Rg,e==null?null:et(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=H(this,kg);return e??(this.type===2||this.type===3?An:null)}set maxFeePerGas(e){Z(this,kg,e==null?null:et(e,"maxFeePerGas"))}get data(){return H(this,Tg)}set data(e){Z(this,Tg,Je(e))}get value(){return H(this,Ng)}set value(e){Z(this,Ng,et(e,"value"))}get chainId(){return H(this,$g)}set chainId(e){Z(this,$g,et(e))}get signature(){return H(this,jg)||null}set signature(e){Z(this,jg,e==null?null:Wo.from(e))}get accessList(){const e=H(this,Bg)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){Z(this,Bg,e==null?null:Ap(e))}get maxFeePerBlobGas(){const e=H(this,mf);return e==null&&this.type===3?An:e}set maxFeePerBlobGas(e){Z(this,mf,e==null?null:et(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=H(this,zl);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){ee(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let r=0;r<e.length;r++)ee(vr(e[r],32),"invalid blobVersionedHash",`value[${r}]`,e[r])}Z(this,zl,e)}get blobs(){return H(this,Wl)==null?null:H(this,Wl).map(e=>Object.assign({},e))}set blobs(e){if(e==null){Z(this,Wl,null);return}const r=[],n=[];for(let i=0;i<e.length;i++){const s=e[i];if(h7(s)){Ae(H(this,ou),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=jt(s);if(ee(o.length<=_S,"blob is too large",`blobs[${i}]`,s),o.length!==_S){const u=new Uint8Array(_S);u.set(o),o=u}const a=H(this,ou).blobToKzgCommitment(o),c=Je(H(this,ou).computeBlobKzgProof(o,a));r.push({data:Je(o),commitment:Je(a),proof:c}),n.push(pB(1,a))}else{const o=Je(s.commitment);r.push({data:Je(s.data),commitment:o,proof:Je(s.proof)}),n.push(pB(1,o))}}Z(this,Wl,r),Z(this,zl,n)}get kzg(){return H(this,ou)}set kzg(e){Z(this,ou,e)}get hash(){return this.signature==null?null:un(Pe(this,Dg,iC).call(this,!0,!1))}get unsignedHash(){return un(this.unsignedSerialized)}get from(){return this.signature==null?null:C4e(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:Ey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return Pe(this,Dg,iC).call(this,!0,!0)}get unsignedSerialized(){return Pe(this,Dg,iC).call(this,!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,i=H(this,mf)!=null||H(this,zl);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Ae(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Ae(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Ae(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const s=[];return this.type!=null?s.push(this.type):r?s.push(2):e?(s.push(1),n||s.push(0)):n?(s.push(1),s.push(2)):(i&&this.to||(s.push(0),s.push(1),s.push(2)),s.push(3)),s.sort(),s}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Yc.from(this)}toJSON(){const e=r=>r==null?null:r.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Yc;if(typeof e=="string"){const n=jt(e);if(n[0]>=127)return Yc.from(O4e(n));switch(n[0]){case 1:return Yc.from($4e(n));case 2:return Yc.from(k4e(n));case 3:return Yc.from(B4e(n))}Ae(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Yc;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(r.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=Wo.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.blobVersionedHashes!=null&&(r.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(r.kzg=e.kzg),e.blobs!=null&&(r.blobs=e.blobs),e.hash!=null&&(ee(r.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),ee(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(ee(r.isSigned(),"unsigned transaction cannot define '.from'","tx",e),ee(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}};Oa=new WeakMap,Sg=new WeakMap,Tg=new WeakMap,Ig=new WeakMap,Pg=new WeakMap,Og=new WeakMap,Rg=new WeakMap,kg=new WeakMap,Ng=new WeakMap,$g=new WeakMap,jg=new WeakMap,Bg=new WeakMap,mf=new WeakMap,zl=new WeakMap,ou=new WeakMap,Wl=new WeakMap,Dg=new WeakSet,iC=function(e,r){Ae(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=e?this.signature:null;switch(this.inferType()){case 0:return R4e(this,n);case 1:return j4e(this,n);case 2:return N4e(this,n);case 3:return D4e(this,n,r?this.blobs:null)}Ae(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let YC=Yc;const rJ=new Uint8Array(32);rJ.fill(0);const M4e=BigInt(-1),nJ=BigInt(0),iJ=BigInt(1),L4e=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function U4e(t){const e=jt(t),r=e.length%32;return r?en([e,rJ.slice(r)]):Je(e)}const F4e=vd(iJ,32),H4e=vd(nJ,32),gB={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},ES=["name","version","chainId","verifyingContract","salt"];function mB(t){return function(e){return ee(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const q4e={name:mB("name"),version:mB("version"),chainId:function(t){const e=et(t,"domain.chainId");return ee(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):J0(e)},verifyingContract:function(t){try{return cr(t).toLowerCase()}catch{}ee(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=jt(t,"domain.salt");return ee(e.length===32,'invalid domain value "salt"',"domain.salt",t),Je(e)}};function CS(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const r=e[1]==="",n=parseInt(e[2]);ee(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",t);const i=ef(L4e,r?n-1:n),s=r?(i+iJ)*M4e:nJ;return function(o){const a=et(o,"value");return ee(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),vd(r?qZ(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return ee(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=jt(n);return ee(i.length===r,`invalid length for ${t}`,"value",n),U4e(n)}}}switch(t){case"address":return function(e){return Wf(cr(e),32)};case"bool":return function(e){return e?F4e:H4e};case"bytes":return function(e){return un(e)};case"string":return function(e){return Gf(e)}}return null}function wB(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}function S3(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}var hv,au,Mg,j6,sJ;const Ks=class Ks{constructor(e){me(this,j6);ce(this,"primaryType");me(this,hv);me(this,au);me(this,Mg);Z(this,au,new Map),Z(this,Mg,new Map);const r=new Map,n=new Map,i=new Map,s={};Object.keys(e).forEach(c=>{s[c]=e[c].map(({name:u,type:l})=>{let{base:d,index:h}=S3(l);return d==="int"&&!e.int&&(d="int256"),d==="uint"&&!e.uint&&(d="uint256"),{name:u,type:d+(h||"")}}),r.set(c,new Set),n.set(c,[]),i.set(c,new Set)}),Z(this,hv,JSON.stringify(s));for(const c in s){const u=new Set;for(const l of s[c]){ee(!u.has(l.name),`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(c)}`,"types",e),u.add(l.name);const d=S3(l.type).base;ee(d!==c,`circular type reference to ${JSON.stringify(d)}`,"types",e),!CS(d)&&(ee(n.has(d),`unknown type ${JSON.stringify(d)}`,"types",e),n.get(d).push(c),r.get(c).add(d))}}const o=Array.from(n.keys()).filter(c=>n.get(c).length===0);ee(o.length!==0,"missing primary type","types",e),ee(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),ut(this,{primaryType:o[0]});function a(c,u){ee(!u.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),u.add(c);for(const l of r.get(c))if(n.has(l)){a(l,u);for(const d of u)i.get(d).add(l)}u.delete(c)}a(this.primaryType,new Set);for(const[c,u]of i){const l=Array.from(u);l.sort(),H(this,au).set(c,wB(c,s[c])+l.map(d=>wB(d,s[d])).join(""))}}get types(){return JSON.parse(H(this,hv))}getEncoder(e){let r=H(this,Mg).get(e);return r||(r=Pe(this,j6,sJ).call(this,e),H(this,Mg).set(e,r)),r}encodeType(e){const r=H(this,au).get(e);return ee(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return un(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(CS(e))return n(e,r);const i=S3(e).array;if(i)return ee(i.count===-1||i.count===r.length,`array length mismatch; expected length ${i.count}`,"value",r),r.map(o=>this._visit(i.prefix,o,n));const s=this.types[e];if(s)return s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{});ee(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Ks(e)}static getPrimaryType(e){return Ks.from(e).primaryType}static hashStruct(e,r,n){return Ks.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=gB[n];ee(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>ES.indexOf(n.name)-ES.indexOf(i.name)),Ks.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return en(["0x1901",Ks.hashDomain(e),Ks.from(r).hash(n)])}static hash(e,r,n){return un(Ks.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const s={};e.verifyingContract&&!vr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Ks.from(r);o.visit(n,(a,c)=>(a==="address"&&!vr(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=await i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}}static getPayload(e,r,n){Ks.hashDomain(e);const i={},s=[];ES.forEach(c=>{const u=e[c];u!=null&&(i[c]=q4e[c](u),s.push({name:c,type:gB[c]}))});const o=Ks.from(r);r=o.types;const a=Object.assign({},r);return ee(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,u)=>{if(c.match(/^bytes(\d*)/))return Je(jt(u));if(c.match(/^u?int/))return et(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return ee(typeof u=="string","invalid string","value",u),u}ee(!1,"unsupported type","type",c)})}}};hv=new WeakMap,au=new WeakMap,Mg=new WeakMap,j6=new WeakSet,sJ=function(e){{const i=CS(e);if(i)return i}const r=S3(e).array;if(r){const i=r.prefix,s=this.getEncoder(i);return o=>{ee(r.count===-1||r.count===o.length,`array length mismatch; expected length ${r.count}`,"value",o);let a=o.map(s);return H(this,au).has(i)&&(a=a.map(un)),un(en(a))}}const n=this.types[e];if(n){const i=Gf(H(this,au).get(e));return s=>{const o=n.map(({name:a,type:c})=>{const u=this.getEncoder(c)(s[a]);return H(this,au).has(c)?un(u):u});return o.unshift(i),en(o)}}ee(!1,`unknown type: ${e}`,"type",e)};let JC=Ks;function _i(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const z4e="external public payable override",W4e=_i(z4e.split(" ")),oJ="constant external internal payable private public pure view override",V4e=_i(oJ.split(" ")),aJ="constructor error event fallback function receive struct",cJ=_i(aJ.split(" ")),uJ="calldata memory storage payable indexed",G4e=_i(uJ.split(" ")),K4e="tuple returns",Z4e=[aJ,uJ,K4e,oJ].join(" "),Y4e=_i(Z4e.split(" ")),J4e={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Q4e=new RegExp("^(\\s*)"),X4e=new RegExp("^([0-9]+)"),eCe=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),lJ=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),dJ=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Dn,jo,fv,mP;const B6=class B6{constructor(e){me(this,fv);me(this,Dn);me(this,jo);Z(this,Dn,0),Z(this,jo,e.slice())}get offset(){return H(this,Dn)}get length(){return H(this,jo).length-H(this,Dn)}clone(){return new B6(H(this,jo))}reset(){Z(this,Dn,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const r=this.peek();throw new Error(`expected ${e}; got ${r.type} ${JSON.stringify(r.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=Pe(this,fv,mP).call(this,H(this,Dn)+1,e.match+1);return Z(this,Dn,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;H(this,Dn)<e.match-1;){const n=this.peek().linkNext;r.push(Pe(this,fv,mP).call(this,H(this,Dn)+1,n)),Z(this,Dn,n)}return Z(this,Dn,e.match+1),r}peek(){if(H(this,Dn)>=H(this,jo).length)throw new Error("out-of-bounds");return H(this,jo)[H(this,Dn)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return I1(this,Dn)._++,e}toString(){const e=[];for(let r=H(this,Dn);r<H(this,jo).length;r++){const n=H(this,jo)[r];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}};Dn=new WeakMap,jo=new WeakMap,fv=new WeakSet,mP=function(e=0,r=0){return new B6(H(this,jo).slice(e,r).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))};let Vo=B6;function Bd(t){const e=[],r=o=>{const a=s<t.length?JSON.stringify(t[s]):"$EOI";throw new Error(`invalid token ${a} at ${s}: ${o}`)};let n=[],i=[],s=0;for(;s<t.length;){let o=t.substring(s),a=o.match(Q4e);a&&(s+=a[1].length,o=t.substring(s));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:s,value:-1};e.push(c);let u=J4e[o[0]]||"";if(u){if(c.type=u,c.text=o[0],s++,u==="OPEN_PAREN")n.push(e.length-1),i.push(e.length-1);else if(u=="CLOSE_PAREN")n.length===0&&r("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1;else if(u==="COMMA")c.linkBack=i.pop(),e[c.linkBack].linkNext=e.length-1,i.push(e.length-1);else if(u==="OPEN_BRACKET")c.type="BRACKET";else if(u==="CLOSE_BRACKET"){let l=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const d=e.pop().text;l=d+l,e[e.length-1].value=Et(d)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=l}continue}if(a=o.match(eCe),a){if(c.text=a[1],s+=c.text.length,Y4e.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(dJ)){c.type="TYPE";continue}c.type="ID";continue}if(a=o.match(X4e),a){c.text=a[1],c.type="NUMBER",s+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${s}`)}return new Vo(e.map(o=>Object.freeze(o)))}function bB(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function yA(t,e){if(e.peekKeyword(cJ)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function Nu(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function hJ(t){let e=Nu(t,V4e);return bB(e,_i("constant payable nonpayable".split(" "))),bB(e,_i("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function Su(t,e){return t.popParams().map(r=>Hn.from(r,e))}function fJ(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return et(t.pop().text);throw new Error("invalid gas")}return null}function Kf(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const tCe=new RegExp(/^(.*)\[([0-9]*)\]$/);function yB(t){const e=t.match(dJ);if(ee(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);ee(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);ee(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const Lr={},Zi=Symbol.for("_ethers_internal"),vB="_ParamTypeInternal",_B="_ErrorInternal",EB="_EventInternal",CB="_ConstructorInternal",AB="_FallbackInternal",xB="_FunctionInternal",SB="_StructInternal";var Lg,sC;const Zs=class Zs{constructor(e,r,n,i,s,o,a,c){me(this,Lg);ce(this,"name");ce(this,"type");ce(this,"baseType");ce(this,"indexed");ce(this,"components");ce(this,"arrayLength");ce(this,"arrayChildren");if(zv(e,Lr,"ParamType"),Object.defineProperty(this,Zi,{value:vB}),o&&(o=Object.freeze(o.slice())),i==="array"){if(a==null||c==null)throw new Error("")}else if(a!=null||c!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");ut(this,{name:r,type:n,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,r))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,s)=>n.components[s].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return Pe(this,Lg,sC).call(this,n,e,r,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(Zs.isParamType(e))return e;if(typeof e=="string")try{return Zs.from(Bd(e),r)}catch{ee(!1,"invalid param type","obj",e)}else if(e instanceof Vo){let a="",c="",u=null;Nu(e,_i(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",u=e.popParams().map(p=>Zs.from(p)),a=`tuple(${u.map(p=>p.format()).join(",")})`):(a=yB(e.popType("TYPE")),c=a);let l=null,d=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();l=new Zs(Lr,"",a,c,null,u,d,l),d=p.value,a+=p.text,c="array",u=null}let h=null;if(Nu(e,G4e).has("indexed")){if(!r)throw new Error("");h=!0}const g=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Zs(Lr,g,a,c,h,u,d,l)}const n=e.name;ee(!n||typeof n=="string"&&n.match(lJ),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(ee(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let s=e.type,o=s.match(tCe);if(o){const a=parseInt(o[2]||"-1"),c=Zs.from({type:o[1],components:e.components});return new Zs(Lr,n||"",s,"array",i,null,a,c)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const a=e.components!=null?e.components.map(u=>Zs.from(u)):null;return new Zs(Lr,n||"",s,"tuple",i,a,null,null)}return s=yB(e.type),new Zs(Lr,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[Zi]===vB}};Lg=new WeakSet,sC=function(e,r,n,i){if(this.isArray()){if(!Array.isArray(r))throw new Error("invalid array value");if(this.arrayLength!==-1&&r.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,a=r.slice();a.forEach((c,u)=>{var l;Pe(l=o,Lg,sC).call(l,e,c,n,d=>{a[u]=d})}),i(a);return}if(this.isTuple()){const o=this.components;let a;if(Array.isArray(r))a=r.slice();else{if(r==null||typeof r!="object")throw new Error("invalid tuple value");a=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in r))throw new Error(`missing value for component ${c.name}`);return r[c.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((c,u)=>{var l;Pe(l=o[u],Lg,sC).call(l,e,c,n,d=>{a[u]=d})}),i(a);return}const s=n(this.type,r);s.then?e.push(async function(){i(await s)}()):i(s)};let Hn=Zs;class Zf{constructor(e,r,n){ce(this,"type");ce(this,"inputs");zv(e,Lr,"Fragment"),n=Object.freeze(n.slice()),ut(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{Zf.from(JSON.parse(e))}catch{}return Zf.from(Bd(e))}if(e instanceof Vo)switch(e.peekKeyword(cJ)){case"constructor":return bu.from(e);case"error":return Gi.from(e);case"event":return Fa.from(e);case"fallback":case"receive":return Xc.from(e);case"function":return Ha.from(e);case"struct":return kf.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return bu.from(e);case"error":return Gi.from(e);case"event":return Fa.from(e);case"fallback":case"receive":return Xc.from(e);case"function":return Ha.from(e);case"struct":return kf.from(e)}Ae(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}ee(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return bu.isFragment(e)}static isError(e){return Gi.isFragment(e)}static isEvent(e){return Fa.isFragment(e)}static isFunction(e){return Ha.isFragment(e)}static isStruct(e){return kf.isFragment(e)}}class vA extends Zf{constructor(r,n,i,s){super(r,n,s);ce(this,"name");ee(typeof i=="string"&&i.match(lJ),"invalid identifier","name",i),s=Object.freeze(s.slice()),ut(this,{name:i})}}function Ty(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class Gi extends vA{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,Zi,{value:_B})}get selector(){return Gf(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+Ty(e,this.inputs)),r.join(" ")}static from(e){if(Gi.isFragment(e))return e;if(typeof e=="string")return Gi.from(Bd(e));if(e instanceof Vo){const r=yA("error",e),n=Su(e);return Kf(e),new Gi(Lr,r,n)}return new Gi(Lr,e.name,e.inputs?e.inputs.map(Hn.from):[])}static isFragment(e){return e&&e[Zi]===_B}}class Fa extends vA{constructor(r,n,i,s){super(r,"event",n,i);ce(this,"anonymous");Object.defineProperty(this,Zi,{value:EB}),ut(this,{anonymous:s})}get topicHash(){return Gf(this.format("sighash"))}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("event"),n.push(this.name+Ty(r,this.inputs)),r!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(r,n){return n=(n||[]).map(s=>Hn.from(s)),new Fa(Lr,r,n,!1).topicHash}static from(r){if(Fa.isFragment(r))return r;if(typeof r=="string")try{return Fa.from(Bd(r))}catch{ee(!1,"invalid event fragment","obj",r)}else if(r instanceof Vo){const n=yA("event",r),i=Su(r,!0),s=!!Nu(r,_i(["anonymous"])).has("anonymous");return Kf(r),new Fa(Lr,n,i,s)}return new Fa(Lr,r.name,r.inputs?r.inputs.map(n=>Hn.from(n,!0)):[],!!r.anonymous)}static isFragment(r){return r&&r[Zi]===EB}}class bu extends Zf{constructor(r,n,i,s,o){super(r,n,i);ce(this,"payable");ce(this,"gas");Object.defineProperty(this,Zi,{value:CB}),ut(this,{payable:s,gas:o})}format(r){if(Ae(r!=null&&r!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),r==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r)))});const n=[`constructor${Ty(r,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(r){if(bu.isFragment(r))return r;if(typeof r=="string")try{return bu.from(Bd(r))}catch{ee(!1,"invalid constuctor fragment","obj",r)}else if(r instanceof Vo){Nu(r,_i(["constructor"]));const n=Su(r),i=!!Nu(r,W4e).has("payable"),s=fJ(r);return Kf(r),new bu(Lr,"constructor",n,i,s)}return new bu(Lr,"constructor",r.inputs?r.inputs.map(Hn.from):[],!!r.payable,r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[Zi]===CB}}class Xc extends Zf{constructor(r,n,i){super(r,"fallback",n);ce(this,"payable");Object.defineProperty(this,Zi,{value:AB}),ut(this,{payable:i})}format(r){const n=this.inputs.length===0?"receive":"fallback";if(r==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:i})}return`${n}()${this.payable?" payable":""}`}static from(r){if(Xc.isFragment(r))return r;if(typeof r=="string")try{return Xc.from(Bd(r))}catch{ee(!1,"invalid fallback fragment","obj",r)}else if(r instanceof Vo){const n=r.toString(),i=r.peekKeyword(_i(["fallback","receive"]));if(ee(i,"type must be fallback or receive","obj",n),r.popKeyword(_i(["fallback","receive"]))==="receive"){const c=Su(r);return ee(c.length===0,"receive cannot have arguments","obj.inputs",c),Nu(r,_i(["payable"])),Kf(r),new Xc(Lr,[],!0)}let o=Su(r);o.length?ee(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(c=>c.format("minimal")).join(", ")):o=[Hn.from("bytes")];const a=hJ(r);if(ee(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),Nu(r,_i(["returns"])).has("returns")){const c=Su(r);ee(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(u=>u.format("minimal")).join(", "))}return Kf(r),new Xc(Lr,o,a==="payable")}if(r.type==="receive")return new Xc(Lr,[],!0);if(r.type==="fallback"){const n=[Hn.from("bytes")],i=r.stateMutability==="payable";return new Xc(Lr,n,i)}ee(!1,"invalid fallback description","obj",r)}static isFragment(r){return r&&r[Zi]===AB}}class Ha extends vA{constructor(r,n,i,s,o,a){super(r,"function",n,s);ce(this,"constant");ce(this,"outputs");ce(this,"stateMutability");ce(this,"payable");ce(this,"gas");Object.defineProperty(this,Zi,{value:xB}),o=Object.freeze(o.slice()),ut(this,{constant:i==="view"||i==="pure",gas:a,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return Gf(this.format("sighash")).substring(0,10)}format(r){if(r==null&&(r="sighash"),r==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(r))),outputs:this.outputs.map(i=>JSON.parse(i.format(r)))});const n=[];return r!=="sighash"&&n.push("function"),n.push(this.name+Ty(r,this.inputs)),r!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(Ty(r,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(r,n){return n=(n||[]).map(s=>Hn.from(s)),new Ha(Lr,r,"view",n,[],null).selector}static from(r){if(Ha.isFragment(r))return r;if(typeof r=="string")try{return Ha.from(Bd(r))}catch{ee(!1,"invalid function fragment","obj",r)}else if(r instanceof Vo){const i=yA("function",r),s=Su(r),o=hJ(r);let a=[];Nu(r,_i(["returns"])).has("returns")&&(a=Su(r));const c=fJ(r);return Kf(r),new Ha(Lr,i,o,s,a,c)}let n=r.stateMutability;return n==null&&(n="payable",typeof r.constant=="boolean"?(n="view",r.constant||(n="payable",typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable"))):typeof r.payable=="boolean"&&!r.payable&&(n="nonpayable")),new Ha(Lr,r.name,n,r.inputs?r.inputs.map(Hn.from):[],r.outputs?r.outputs.map(Hn.from):[],r.gas!=null?r.gas:null)}static isFragment(r){return r&&r[Zi]===xB}}class kf extends vA{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,Zi,{value:SB})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return kf.from(Bd(e))}catch{ee(!1,"invalid struct fragment","obj",e)}else if(e instanceof Vo){const r=yA("struct",e),n=Su(e);return Kf(e),new kf(Lr,r,n)}return new kf(Lr,e.name,e.inputs?e.inputs.map(Hn.from):[])}static isFragment(e){return e&&e[Zi]===SB}}const ra=new Map;ra.set(0,"GENERIC_PANIC");ra.set(1,"ASSERT_FALSE");ra.set(17,"OVERFLOW");ra.set(18,"DIVIDE_BY_ZERO");ra.set(33,"ENUM_RANGE_ERROR");ra.set(34,"BAD_STORAGE_DATA");ra.set(49,"STACK_UNDERFLOW");ra.set(50,"ARRAY_RANGE_ERROR");ra.set(65,"OUT_OF_MEMORY");ra.set(81,"UNINITIALIZED_FUNCTION_CALL");const rCe=new RegExp(/^bytes([0-9]*)$/),nCe=new RegExp(/^(u?int)([0-9]*)$/);let AS=null,TB=1024;function iCe(t,e,r,n){let i="missing revert data",s=null;const o=null;let a=null;if(r){i="execution reverted";const u=jt(r);if(r=Je(r),u.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(u.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(Je(u.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(Je(u.slice(0,4))==="0x4e487b71")try{const l=Number(n.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[l]},s=`Panic due to ${ra.get(l)||"UNKNOWN"}(${l})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const c={to:e.to?cr(e.to):null,data:e.data||"0x"};return e.from&&(c.from=cr(e.from)),Hr(i,"CALL_EXCEPTION",{action:t,data:r,reason:s,transaction:c,invocation:o,revert:a})}var Vl,H0;const D6=class D6{constructor(){me(this,Vl)}getDefaultValue(e){const r=e.map(i=>Pe(this,Vl,H0).call(this,Hn.from(i)));return new x3(r,"_").defaultValue()}encode(e,r){UZ(r.length,e.length,"types/values length mismatch");const n=e.map(o=>Pe(this,Vl,H0).call(this,Hn.from(o))),i=new x3(n,"_"),s=new rP;return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>Pe(this,Vl,H0).call(this,Hn.from(o)));return new x3(i,"_").decode(new nP(r,n,TB))}static _setDefaultMaxInflation(e){ee(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),TB=e}static defaultAbiCoder(){return AS==null&&(AS=new D6),AS}static getBuiltinCallException(e,r,n){return iCe(e,r,n,D6.defaultAbiCoder())}};Vl=new WeakSet,H0=function(e){if(e.isArray())return new T5e(Pe(this,Vl,H0).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new x3(e.components.map(n=>Pe(this,Vl,H0).call(this,n)),e.name);switch(e.baseType){case"address":return new x5e(e.name);case"bool":return new I5e(e.name);case"string":return new D5e(e.name);case"bytes":return new P5e(e.name);case"":return new k5e(e.name)}let r=e.type.match(nCe);if(r){let n=parseInt(r[2]||"256");return ee(n!==0&&n<=256&&n%8===0,"invalid "+r[1]+" bit length","param",e),new B5e(n/8,r[1]==="int",e.name)}if(r=e.type.match(rCe),r){let n=parseInt(r[1]);return ee(n!==0&&n<=32,"invalid bytes length","param",e),new O5e(n,e.name)}ee(!1,"invalid type","type",e.type)};let Iy=D6;class sCe{constructor(e,r,n){ce(this,"fragment");ce(this,"name");ce(this,"signature");ce(this,"topic");ce(this,"args");const i=e.name,s=e.format();ut(this,{fragment:e,name:i,signature:s,topic:r,args:n})}}class oCe{constructor(e,r,n,i){ce(this,"fragment");ce(this,"name");ce(this,"args");ce(this,"signature");ce(this,"selector");ce(this,"value");const s=e.name,o=e.format();ut(this,{fragment:e,name:s,args:n,signature:o,selector:r,value:i})}}class aCe{constructor(e,r,n){ce(this,"fragment");ce(this,"name");ce(this,"args");ce(this,"signature");ce(this,"selector");const i=e.name,s=e.format();ut(this,{fragment:e,name:i,args:n,signature:s,selector:r})}}class IB{constructor(e){ce(this,"hash");ce(this,"_isIndexed");ut(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const PB={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},OB={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&PB[t.toString()]&&(e=PB[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Ra,ka,Na,Jn,Ya,oC,aC;const Kh=class Kh{constructor(e){me(this,Ya);ce(this,"fragments");ce(this,"deploy");ce(this,"fallback");ce(this,"receive");me(this,Ra);me(this,ka);me(this,Na);me(this,Jn);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,Z(this,Na,new Map),Z(this,Ra,new Map),Z(this,ka,new Map);const n=[];for(const o of r)try{n.push(Zf.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}ut(this,{fragments:Object.freeze(n)});let i=null,s=!1;Z(this,Jn,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}ut(this,{deploy:o});return;case"fallback":o.inputs.length===0?s=!0:(ee(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,o),i=o,s=i.payable);return;case"function":c=H(this,Na);break;case"event":c=H(this,ka);break;case"error":c=H(this,Ra);break;default:return}const u=o.format();c.has(u)||c.set(u,o)}),this.deploy||ut(this,{deploy:bu.from("constructor()")}),ut(this,{fallback:i,receive:s})}format(e){const r=e?"minimal":"full";return this.fragments.map(i=>i.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return Iy.defaultAbiCoder()}getFunctionName(e){const r=Pe(this,Ya,oC).call(this,e,null,!1);return ee(r,"no matching function","key",e),r.name}hasFunction(e){return!!Pe(this,Ya,oC).call(this,e,null,!1)}getFunction(e,r){return Pe(this,Ya,oC).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(H(this,Na).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(H(this,Na).get(i),n)}}getEventName(e){const r=Pe(this,Ya,aC).call(this,e,null,!1);return ee(r,"no matching event","key",e),r.name}hasEvent(e){return!!Pe(this,Ya,aC).call(this,e,null,!1)}getEvent(e,r){return Pe(this,Ya,aC).call(this,e,r||null,!0)}forEachEvent(e){const r=Array.from(H(this,ka).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(H(this,ka).get(i),n)}}getError(e,r){if(vr(e)){const i=e.toLowerCase();if(OB[i])return Gi.from(OB[i].signature);for(const s of H(this,Ra).values())if(i===s.selector)return s;return null}if(e.indexOf("(")===-1){const i=[];for(const[s,o]of H(this,Ra))s.split("(")[0]===e&&i.push(o);if(i.length===0)return e==="Error"?Gi.from("error Error(string)"):e==="Panic"?Gi.from("error Panic(uint256)"):null;if(i.length>1){const s=i.map(o=>JSON.stringify(o.format())).join(", ");ee(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}if(e=Gi.from(e).format(),e==="Error(string)")return Gi.from("error Error(string)");if(e==="Panic(uint256)")return Gi.from("error Panic(uint256)");const n=H(this,Ra).get(e);return n||null}forEachError(e){const r=Array.from(H(this,Ra).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(H(this,Ra).get(i),n)}}_decodeParams(e,r){return H(this,Jn).decode(e,r)}_encodeParams(e,r){return H(this,Jn).encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);ee(n,"unknown error","fragment",e),e=n}return ee(qr(r,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",r),this._decodeParams(e.inputs,qr(r,4))}encodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);ee(n,"unknown error","fragment",e),e=n}return en([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);ee(n,"unknown function","fragment",e),e=n}return ee(qr(r,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",r),this._decodeParams(e.inputs,qr(r,4))}encodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);ee(n,"unknown function","fragment",e),e=n}return en([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionResult(e,r){if(typeof e=="string"){const s=this.getFunction(e);ee(s,"unknown function","fragment",e),e=s}let n="invalid length for result data";const i=wi(r);if(i.length%32===0)try{return H(this,Jn).decode(e.outputs,i)}catch{n="could not decode result data"}Ae(!1,n,"BAD_DATA",{value:Je(i),info:{method:e.name,signature:e.format()}})}makeError(e,r){const n=jt(e,"data"),i=Iy.getBuiltinCallException("call",r,n);if(i.message.startsWith("execution reverted (unknown custom error)")){const a=Je(n.slice(0,4)),c=this.getError(a);if(c)try{const u=H(this,Jn).decode(c.inputs,n.slice(4));i.revert={name:c.name,signature:c.format(),args:u},i.reason=i.revert.signature,i.message=`execution reverted: ${i.reason}`}catch{i.message="execution reverted (coult not decode custom error)"}}const o=this.parseTransaction(r);return o&&(i.invocation={method:o.name,signature:o.signature,args:o.args}),i}encodeFunctionResult(e,r){if(typeof e=="string"){const n=this.getFunction(e);ee(n,"unknown function","fragment",e),e=n}return Je(H(this,Jn).encode(e.outputs,r||[]))}encodeFilterTopics(e,r){if(typeof e=="string"){const s=this.getEvent(e);ee(s,"unknown event","eventFragment",e),e=s}Ae(r.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:r.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const i=(s,o)=>s.type==="string"?Gf(o):s.type==="bytes"?un(Je(o)):(s.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":s.type.match(/^u?int/)?o=vd(o):s.type.match(/^bytes/)?o=I_e(o,32):s.type==="address"&&H(this,Jn).encode(["address"],[o]),Wf(Je(o),32));for(r.forEach((s,o)=>{const a=e.inputs[o];if(!a.indexed){ee(s==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?ee(!1,"filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const o=this.getEvent(e);ee(o,"unknown event","eventFragment",e),e=o}const n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),ee(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(Gf(c));else if(o.type==="bytes")n.push(un(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(H(this,Jn).encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:H(this,Jn).encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const f=this.getEvent(e);ee(f,"unknown event","eventFragment",e),e=f}if(n!=null&&!e.anonymous){const f=e.topicHash;ee(vr(n[0],32)&&n[0].toLowerCase()===f,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],s=[],o=[];e.inputs.forEach((f,g)=>{f.indexed?f.type==="string"||f.type==="bytes"||f.baseType==="tuple"||f.baseType==="array"?(i.push(Hn.from({type:"bytes32",name:f.name})),o.push(!0)):(i.push(f),o.push(!1)):(s.push(f),o.push(!1))});const a=n!=null?H(this,Jn).decode(i,en(n)):null,c=H(this,Jn).decode(s,r,!0),u=[],l=[];let d=0,h=0;return e.inputs.forEach((f,g)=>{let p=null;if(f.indexed)if(a==null)p=new IB(null);else if(o[g])p=new IB(a[h++]);else try{p=a[h++]}catch(m){p=m}else try{p=c[d++]}catch(m){p=m}u.push(p),l.push(f.name||null)}),Em.fromItems(u,l)}parseTransaction(e){const r=jt(e.data,"tx.data"),n=et(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(Je(r.slice(0,4)));if(!i)return null;const s=H(this,Jn).decode(i.inputs,r.slice(4));return new oCe(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new sCe(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=Je(e),n=this.getError(qr(r,0,4));if(!n)return null;const i=H(this,Jn).decode(n.inputs,qr(r,4));return new aCe(n,n.selector,i)}static from(e){return e instanceof Kh?e:typeof e=="string"?new Kh(JSON.parse(e)):typeof e.formatJson=="function"?new Kh(e.formatJson()):typeof e.format=="function"?new Kh(e.format("json")):new Kh(e)}};Ra=new WeakMap,ka=new WeakMap,Na=new WeakMap,Jn=new WeakMap,Ya=new WeakSet,oC=function(e,r,n){if(vr(e)){const s=e.toLowerCase();for(const o of H(this,Na).values())if(s===o.selector)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of H(this,Na))o.split("(")[0]===e&&s.push(a);if(r){const o=r.length>0?r[r.length-1]:null;let a=r.length,c=!0;ri.isTyped(o)&&o.type==="overrides"&&(c=!1,a--);for(let u=s.length-1;u>=0;u--){const l=s[u].inputs.length;l!==a&&(!c||l!==a-1)&&s.splice(u,1)}for(let u=s.length-1;u>=0;u--){const l=s[u].inputs;for(let d=0;d<r.length;d++)if(ri.isTyped(r[d])){if(d>=l.length){if(r[d].type==="overrides")continue;s.splice(u,1);break}if(r[d].type!==l[d].baseType){s.splice(u,1);break}}}}if(s.length===1&&r&&r.length!==s[0].inputs.length){const o=r[r.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&s.splice(0,1)}if(s.length===0)return null;if(s.length>1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");ee(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return s[0]}const i=H(this,Na).get(Ha.from(e).format());return i||null},aC=function(e,r,n){if(vr(e)){const s=e.toLowerCase();for(const o of H(this,ka).values())if(s===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const s=[];for(const[o,a]of H(this,ka))o.split("(")[0]===e&&s.push(a);if(r){for(let o=s.length-1;o>=0;o--)s[o].inputs.length<r.length&&s.splice(o,1);for(let o=s.length-1;o>=0;o--){const a=s[o].inputs;for(let c=0;c<r.length;c++)if(ri.isTyped(r[c])&&r[c].type!==a[c].baseType){s.splice(o,1);break}}}if(s.length===0)return null;if(s.length>1&&n){const o=s.map(a=>JSON.stringify(a.format())).join(", ");ee(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return s[0]}const i=H(this,ka).get(Fa.from(e).format());return i||null};let wP=Kh;const pJ=BigInt(0);function lg(t){return t??null}function Vr(t){return t==null?null:t.toString()}class RB{constructor(e,r,n){ce(this,"gasPrice");ce(this,"maxFeePerGas");ce(this,"maxPriorityFeePerGas");ut(this,{gasPrice:lg(e),maxFeePerGas:lg(r),maxPriorityFeePerGas:lg(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Vr(e),maxFeePerGas:Vr(r),maxPriorityFeePerGas:Vr(n)}}}function QC(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=Je(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=et(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=Et(t[i],`request.${i}`));return t.accessList&&(e.accessList=Ap(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(i=>h7(i)?Je(i):Object.assign({},i))),e}var cu;class cCe{constructor(e,r){ce(this,"provider");ce(this,"number");ce(this,"hash");ce(this,"timestamp");ce(this,"parentHash");ce(this,"parentBeaconBlockRoot");ce(this,"nonce");ce(this,"difficulty");ce(this,"gasLimit");ce(this,"gasUsed");ce(this,"stateRoot");ce(this,"receiptsRoot");ce(this,"blobGasUsed");ce(this,"excessBlobGas");ce(this,"miner");ce(this,"prevRandao");ce(this,"extraData");ce(this,"baseFeePerGas");me(this,cu);Z(this,cu,e.transactions.map(n=>typeof n!="string"?new Py(n,r):n)),ut(this,{provider:r,hash:lg(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:lg(e.prevRandao),extraData:e.extraData,baseFeePerGas:lg(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return H(this,cu).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=H(this,cu).slice();return e.length===0?[]:(Ae(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:s,hash:o,miner:a,prevRandao:c,nonce:u,number:l,parentHash:d,parentBeaconBlockRoot:h,stateRoot:f,receiptsRoot:g,timestamp:p,transactions:m}=this;return{_type:"Block",baseFeePerGas:Vr(e),difficulty:Vr(r),extraData:n,gasLimit:Vr(i),gasUsed:Vr(s),blobGasUsed:Vr(this.blobGasUsed),excessBlobGas:Vr(this.excessBlobGas),hash:o,miner:a,prevRandao:c,nonce:u,number:l,parentHash:d,timestamp:p,parentBeaconBlockRoot:h,stateRoot:f,receiptsRoot:g,transactions:m}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>e<this.length?{value:r[e++],done:!1}:{value:void 0,done:!0}}}get length(){return H(this,cu).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let r;if(typeof e=="number")r=H(this,cu)[e];else{const n=e.toLowerCase();for(const i of H(this,cu))if(typeof i=="string"){if(i!==n)continue;r=i;break}else{if(i.hash===n)continue;r=i;break}}if(r==null)throw new Error("no such tx");return typeof r=="string"?await this.provider.getTransaction(r):r}getPrefetchedTransaction(e){const r=this.prefetchedTransactions;if(typeof e=="number")return r[e];e=e.toLowerCase();for(const n of r)if(n.hash===e)return n;ee(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return uCe(this)}}cu=new WeakMap;class Gv{constructor(e,r){ce(this,"provider");ce(this,"transactionHash");ce(this,"blockHash");ce(this,"blockNumber");ce(this,"removed");ce(this,"address");ce(this,"data");ce(this,"topics");ce(this,"index");ce(this,"transactionIndex");this.provider=r;const n=Object.freeze(e.topics.slice());ut(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:r,blockNumber:n,data:i,index:s,removed:o,topics:a,transactionHash:c,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:r,blockNumber:n,data:i,index:s,removed:o,topics:a,transactionHash:c,transactionIndex:u}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return Ae(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return Ae(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return Ae(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return lCe(this)}}var pv;class gJ{constructor(e,r){ce(this,"provider");ce(this,"to");ce(this,"from");ce(this,"contractAddress");ce(this,"hash");ce(this,"index");ce(this,"blockHash");ce(this,"blockNumber");ce(this,"logsBloom");ce(this,"gasUsed");ce(this,"blobGasUsed");ce(this,"cumulativeGasUsed");ce(this,"gasPrice");ce(this,"blobGasPrice");ce(this,"type");ce(this,"status");ce(this,"root");me(this,pv);Z(this,pv,Object.freeze(e.logs.map(i=>new Gv(i,r))));let n=pJ;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),ut(this,{provider:r,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return H(this,pv)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:s,blockHash:o,blockNumber:a,logsBloom:c,logs:u,status:l,root:d}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:Vr(this.cumulativeGasUsed),from:r,gasPrice:Vr(this.gasPrice),blobGasUsed:Vr(this.blobGasUsed),blobGasPrice:Vr(this.blobGasPrice),gasUsed:Vr(this.gasUsed),hash:i,index:s,logs:u,logsBloom:c,root:d,status:l,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return wJ(this)}reorderedEvent(e){return Ae(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),mJ(this,e)}}pv=new WeakMap;var Gl;const CR=class CR{constructor(e,r){ce(this,"provider");ce(this,"blockNumber");ce(this,"blockHash");ce(this,"index");ce(this,"hash");ce(this,"type");ce(this,"to");ce(this,"from");ce(this,"nonce");ce(this,"gasLimit");ce(this,"gasPrice");ce(this,"maxPriorityFeePerGas");ce(this,"maxFeePerGas");ce(this,"maxFeePerBlobGas");ce(this,"data");ce(this,"value");ce(this,"chainId");ce(this,"signature");ce(this,"accessList");ce(this,"blobVersionedHashes");me(this,Gl);this.provider=r,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,Z(this,Gl,-1)}toJSON(){const{blockNumber:e,blockHash:r,index:n,hash:i,type:s,to:o,from:a,nonce:c,data:u,signature:l,accessList:d,blobVersionedHashes:h}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:e,blockHash:r,blobVersionedHashes:h,chainId:Vr(this.chainId),data:u,from:a,gasLimit:Vr(this.gasLimit),gasPrice:Vr(this.gasPrice),hash:i,maxFeePerGas:Vr(this.maxFeePerGas),maxPriorityFeePerGas:Vr(this.maxPriorityFeePerGas),maxFeePerBlobGas:Vr(this.maxFeePerBlobGas),nonce:c,signature:l,to:o,index:n,type:s,value:Vr(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;const r=this.provider.getBlock(e);if(r==null)throw new Error("TODO");return r}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:r,blockNumber:n}=await mi({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return r==null||r.blockNumber==null?0:n-r.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,r){const n=e??1,i=r??0;let s=H(this,Gl),o=-1,a=s===-1;const c=async()=>{if(a)return null;const{blockNumber:h,nonce:f}=await mi({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(f<this.nonce){s=h;return}if(a)return null;const g=await this.getTransaction();if(!(g&&g.blockNumber!=null))for(o===-1&&(o=s-3,o<H(this,Gl)&&(o=H(this,Gl)));o<=h;){if(a)return null;const p=await this.provider.getBlock(o,!0);if(p==null)return;for(const m of p)if(m===this.hash)return;for(let m=0;m<p.length;m++){const b=await p.getTransaction(m);if(b.from===this.from&&b.nonce===this.nonce){if(a)return null;const v=await this.provider.getTransactionReceipt(b.hash);if(v==null||h-v.blockNumber+1<n)return;let E="replaced";b.data===this.data&&b.to===this.to&&b.value===this.value?E="repriced":b.data==="0x"&&b.from===b.to&&b.value===pJ&&(E="cancelled"),Ae(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:E==="replaced"||E==="cancelled",reason:E,replacement:b.replaceableTransaction(s),hash:b.hash,receipt:v})}}o++}},u=h=>{if(h==null||h.status!==0)return h;Ae(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},l=await this.provider.getTransactionReceipt(this.hash);if(n===0)return u(l);if(l){if(await l.confirmations()>=n)return u(l)}else if(await c(),n===0)return null;return await new Promise((h,f)=>{const g=[],p=()=>{g.forEach(b=>b())};if(g.push(()=>{a=!0}),i>0){const b=setTimeout(()=>{p(),f(Hr("wait for transaction timeout","TIMEOUT"))},i);g.push(()=>{clearTimeout(b)})}const m=async b=>{if(await b.confirmations()>=n){p();try{h(u(b))}catch(v){f(v)}}};if(g.push(()=>{this.provider.off(this.hash,m)}),this.provider.on(this.hash,m),s>=0){const b=async()=>{try{await c()}catch(v){if(ti(v,"TRANSACTION_REPLACED")){p(),f(v);return}}a||this.provider.once("block",b)};g.push(()=>{this.provider.off("block",b)}),this.provider.once("block",b)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return Ae(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),wJ(this)}reorderedEvent(e){return Ae(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Ae(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),mJ(this,e)}replaceableTransaction(e){ee(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new CR(this,this.provider);return Z(r,Gl,e),r}};Gl=new WeakMap;let Py=CR;function uCe(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function mJ(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function wJ(t){return{orphan:"drop-transaction",tx:t}}function lCe(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class I7 extends Gv{constructor(r,n,i){super(r,r.provider);ce(this,"interface");ce(this,"fragment");ce(this,"args");const s=n.decodeEventLog(i,r.data,r.topics);ut(this,{args:s,fragment:i,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class bJ extends Gv{constructor(r,n){super(r,r.provider);ce(this,"error");ut(this,{error:n})}}var Ug;class dCe extends gJ{constructor(r,n,i){super(i,n);me(this,Ug);Z(this,Ug,r)}get logs(){return super.logs.map(r=>{const n=r.topics.length?H(this,Ug).getEvent(r.topics[0]):null;if(n)try{return new I7(r,H(this,Ug),n)}catch(i){return new bJ(r,i)}return r})}}Ug=new WeakMap;var gv;class P7 extends Py{constructor(r,n,i){super(i,n);me(this,gv);Z(this,gv,r)}async wait(r,n){const i=await super.wait(r,n);return i==null?null:new dCe(H(this,gv),this.provider,i)}}gv=new WeakMap;class yJ extends zZ{constructor(r,n,i,s){super(r,n,i);ce(this,"log");ut(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class hCe extends yJ{constructor(e,r,n,i,s){super(e,r,n,new I7(s,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);ut(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const kB=BigInt(0);function vJ(t){return t&&typeof t.call=="function"}function _J(t){return t&&typeof t.estimateGas=="function"}function _A(t){return t&&typeof t.resolveName=="function"}function EJ(t){return t&&typeof t.sendTransaction=="function"}function CJ(t){if(t!=null){if(_A(t))return t;if(t.provider)return t.provider}}var mv;class fCe{constructor(e,r,n){me(this,mv);ce(this,"fragment");if(ut(this,{fragment:r}),r.inputs.length<n.length)throw new Error("too many arguments");const i=Yf(e.runner,"resolveName"),s=_A(i)?i:null;Z(this,mv,async function(){const o=await Promise.all(r.inputs.map((a,c)=>n[c]==null?null:a.walkAsync(n[c],(l,d)=>l==="address"?Array.isArray(d)?Promise.all(d.map(h=>vi(h,s))):vi(d,s):d)));return e.interface.encodeFilterTopics(r,o)}())}getTopicFilter(){return H(this,mv)}}mv=new WeakMap;function Yf(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function nf(t){return t==null?null:t.provider||null}async function AJ(t,e){const r=ri.dereference(t,"overrides");ee(typeof r=="object","invalid overrides parameter","overrides",t);const n=QC(r);return ee(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),ee(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function pCe(t,e,r){const n=Yf(t,"resolveName"),i=_A(n)?n:null;return await Promise.all(e.map((s,o)=>s.walkAsync(r[o],(a,c)=>(c=ri.dereference(c,a),a==="address"?vi(c,i):c))))}function gCe(t){const e=async function(o){const a=await AJ(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await vi(a.from,CJ(t.runner)));const c=t.interface,u=et(a.value||kB,"overrides.value")===kB,l=(a.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!l&&!u&&ee(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),ee(c.fallback||l,"cannot send data to receive-only contract","overrides.data",a.data);const d=c.receive||c.fallback&&c.fallback.payable;return ee(d||u,"cannot send value to non-payable fallback","overrides.value",a.value),ee(c.fallback||l,"cannot send data to receive-only contract","overrides.data",a.data),a},r=async function(o){const a=Yf(t.runner,"call");Ae(vJ(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await e(o);try{return await a.call(c)}catch(u){throw d7(u)&&u.data?t.interface.makeError(u.data,c):u}},n=async function(o){const a=t.runner;Ae(EJ(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await a.sendTransaction(await e(o)),u=nf(t.runner);return new P7(t.interface,u,c)},i=async function(o){const a=Yf(t.runner,"estimateGas");return Ae(_J(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},s=async o=>await n(o);return ut(s,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),s}function mCe(t,e){const r=function(...u){const l=t.interface.getFunction(e,u);return Ae(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),l},n=async function(...u){const l=r(...u);let d={};if(l.inputs.length+1===u.length&&(d=await AJ(u.pop()),d.from&&(d.from=await vi(d.from,CJ(t.runner)))),l.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await pCe(t.runner,l.inputs,u);return Object.assign({},d,await mi({to:t.getAddress(),data:t.interface.encodeFunctionData(l,h)}))},i=async function(...u){const l=await a(...u);return l.length===1?l[0]:l},s=async function(...u){const l=t.runner;Ae(EJ(l),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const d=await l.sendTransaction(await n(...u)),h=nf(t.runner);return new P7(t.interface,h,d)},o=async function(...u){const l=Yf(t.runner,"estimateGas");return Ae(_J(l),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await l.estimateGas(await n(...u))},a=async function(...u){const l=Yf(t.runner,"call");Ae(vJ(l),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const d=await n(...u);let h="0x";try{h=await l.call(d)}catch(g){throw d7(g)&&g.data?t.interface.makeError(g.data,d):g}const f=r(...u);return t.interface.decodeFunctionResult(f,h)},c=async(...u)=>r(...u).constant?await i(...u):await s(...u);return ut(c,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:o,populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return Ae(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),c}function wCe(t,e){const r=function(...i){const s=t.interface.getEvent(e,i);return Ae(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new fCe(t,r(...i),i)};return ut(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return Ae(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const XC=Symbol.for("_ethersInternal_contract"),xJ=new WeakMap;function bCe(t,e){xJ.set(t[XC],e)}function fs(t){return xJ.get(t[XC])}function yCe(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function O7(t,e){let r,n=null;if(Array.isArray(e)){const s=function(o){if(vr(o,32))return o;const a=t.interface.getEvent(o);return ee(a,"unknown fragment","name",o),a.topicHash};r=e.map(o=>o==null?null:Array.isArray(o)?o.map(s):s(o))}else e==="*"?r=[null]:typeof e=="string"?vr(e,32)?r=[e]:(n=t.interface.getEvent(e),ee(n,"unknown fragment","event",e),r=[n.topicHash]):yCe(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):ee(!1,"unknown event name","event",e);r=r.map(s=>{if(s==null)return null;if(Array.isArray(s)){const o=Array.from(new Set(s.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return s.toLowerCase()});const i=r.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:r}}async function ob(t,e){const{subs:r}=fs(t);return r.get((await O7(t,e)).tag)||null}async function NB(t,e,r){const n=nf(t.runner);Ae(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:s,topics:o}=await O7(t,r),{addr:a,subs:c}=fs(t);let u=c.get(s);if(!u){const d={address:a||t,topics:o},h=m=>{let b=i;if(b==null)try{b=t.interface.getEvent(m.topics[0])}catch{}if(b){const v=b,E=i?t.interface.decodeEventLog(i,m.data,m.topics):[];yP(t,r,E,w=>new hCe(t,w,r,v,m))}else yP(t,r,[],v=>new yJ(t,v,r,m))};let f=[];u={tag:s,listeners:[],start:()=>{f.length||f.push(n.on(d,h))},stop:async()=>{if(f.length==0)return;let m=f;f=[],await Promise.all(m),n.off(d,h)}},c.set(s,u)}return u}let bP=Promise.resolve();async function vCe(t,e,r,n){await bP;const i=await ob(t,e);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:a})=>{const c=Array.from(r);n&&c.push(n(a?null:o));try{o.call(t,...c)}catch{}return!a}),i.listeners.length===0&&(i.stop(),fs(t).subs.delete(i.tag)),s>0}async function yP(t,e,r,n){try{await bP}catch{}const i=vCe(t,e,r,n);return bP=i,await i}const T3=["then"];var KW;KW=XC;const Sb=class Sb{constructor(e,r,n,i){ce(this,"target");ce(this,"interface");ce(this,"runner");ce(this,"filters");ce(this,KW);ce(this,"fallback");ee(typeof e=="string"||RY(e),"invalid value for Contract target","target",e),n==null&&(n=null);const s=wP.from(r);ut(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,XC,{value:{}});let o,a=null,c=null;if(i){const d=nf(n);c=new P7(this.interface,d,i)}let u=new Map;if(typeof e=="string")if(vr(e))a=e,o=Promise.resolve(e);else{const d=Yf(n,"resolveName");if(!_A(d))throw Hr("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=d.resolveName(e).then(h=>{if(h==null)throw Hr("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return fs(this).addr=h,h})}else o=e.getAddress().then(d=>{if(d==null)throw new Error("TODO");return fs(this).addr=d,d});bCe(this,{addrPromise:o,addr:a,deployTx:c,subs:u});const l=new Proxy({},{get:(d,h,f)=>{if(typeof h=="symbol"||T3.indexOf(h)>=0)return Reflect.get(d,h,f);try{return this.getEvent(h)}catch(g){if(!ti(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(d,h)=>T3.indexOf(h)>=0?Reflect.has(d,h):Reflect.has(d,h)||this.interface.hasEvent(String(h))});return ut(this,{filters:l}),ut(this,{fallback:s.receive||s.fallback?gCe(this):null}),new Proxy(this,{get:(d,h,f)=>{if(typeof h=="symbol"||h in d||T3.indexOf(h)>=0)return Reflect.get(d,h,f);try{return d.getFunction(h)}catch(g){if(!ti(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(d,h)=>typeof h=="symbol"||h in d||T3.indexOf(h)>=0?Reflect.has(d,h):d.interface.hasFunction(h)})}connect(e){return new Sb(this.target,this.interface,e)}attach(e){return new Sb(e,this.interface,this.runner)}async getAddress(){return await fs(this).addrPromise}async getDeployedCode(){const e=nf(this.runner);Ae(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=nf(this.runner);return Ae(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,s)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);n.once("block",o)}catch(a){s(a)}};o()})}deploymentTransaction(){return fs(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),mCe(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),wCe(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:s}=fs(this),o=i||await s,{fragment:a,topics:c}=await O7(this,e),u={address:o,topics:c,fromBlock:r,toBlock:n},l=nf(this.runner);return Ae(l,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await l.getLogs(u)).map(d=>{let h=a;if(h==null)try{h=this.interface.getEvent(d.topics[0])}catch{}if(h)try{return new I7(d,this.interface,h)}catch(f){return new bJ(d,f)}return new Gv(d,l)})}async on(e,r){const n=await NB(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await NB(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await yP(this,e,r,null)}async listenerCount(e){if(e){const i=await ob(this,e);return i?i.listeners.length:0}const{subs:r}=fs(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await ob(this,e);return i?i.listeners.map(({listener:s})=>s):[]}const{subs:r}=fs(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,r){const n=await ob(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),fs(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await ob(this,e);if(!r)return this;r.stop(),fs(this).subs.delete(r.tag)}else{const{subs:r}=fs(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends Sb{constructor(i,s=null){super(i,e,s)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};let vP=Sb;function _Ce(){return vP}class dg extends _Ce(){}function xS(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):ee(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class ECe{constructor(e){ce(this,"name");ut(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const SJ=new RegExp("^(ipfs)://(.*)$","i"),$B=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),SJ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Kl,wf,Zl,q0,M6,TJ;const tg=class tg{constructor(e,r,n){me(this,Zl);ce(this,"provider");ce(this,"address");ce(this,"name");me(this,Kl);me(this,wf);ut(this,{provider:e,address:r,name:n}),Z(this,Kl,null),Z(this,wf,new dg(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return H(this,Kl)==null&&Z(this,Kl,(async()=>{try{return await H(this,wf).supportsInterface("0x9061b923")}catch(e){if(ti(e,"CALL_EXCEPTION"))return!1;throw Z(this,Kl,null),e}})()),await H(this,Kl)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await Pe(this,Zl,q0).call(this,"addr(bytes32)");return s==null||s===_y?null:s}catch(s){if(ti(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const o=await Pe(this,Zl,q0).call(this,"addr(bytes32,uint)",[s]);if(vr(o,20))return cr(o)}let r=null;for(const s of this.provider.plugins)if(s instanceof ECe&&s.supportsCoinType(e)){r=s;break}if(r==null)return null;const n=await Pe(this,Zl,q0).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;Ae(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await Pe(this,Zl,q0).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await Pe(this,Zl,q0).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",s=parseInt(r[4],16);if(r[5].length===s*2)return`${i}://${O_e("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;Ae(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n<$B.length;n++){const i=r.match($B[n]);if(i==null)continue;const s=i[1].toLowerCase();switch(s){case"https":case"data":return e.push({type:"url",value:r}),{linkage:e,url:r};case"ipfs":{const o=xS(r);return e.push({type:"ipfs",value:r}),e.push({type:"url",value:o}),{linkage:e,url:o}}case"erc721":case"erc1155":{const o=s==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:s,value:r});const a=await this.getAddress();if(a==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const c=(i[2]||"").split("/");if(c.length!==2)return e.push({type:`!${s}caip`,value:i[2]||""}),{url:null,linkage:e};const u=c[1],l=new dg(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(s==="erc721"){const p=await l.ownerOf(u);if(a!==p)return e.push({type:"!owner",value:p}),{url:null,linkage:e};e.push({type:"owner",value:p})}else if(s==="erc1155"){const p=await l.balanceOf(a,u);if(!p)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:p.toString()})}let d=await l[o](u);if(d==null||d==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:d}),s==="erc1155"&&(d=d.replace("{id}",vd(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:d})),d.match(/^ipfs:/i)&&(d=xS(d)),e.push({type:"metadata-url",value:d});let h={};const f=await new ku(d).send();f.assertOk();try{h=f.bodyJson}catch{try{e.push({type:"!metadata",value:f.bodyText})}catch{const b=f.body;return b&&e.push({type:"!metadata",value:Je(b)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!h)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(h)});let g=h.image;if(typeof g!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!g.match(/^(https:\/\/|data:)/i)){if(g.match(SJ)==null)return e.push({type:"!imageUrl-ipfs",value:g}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:g}),g=xS(g)}return e.push({type:"url",value:g}),{linkage:e,url:g}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const r=await e.getNetwork(),n=r.getPlugin("org.ethers.plugins.network.Ens");return Ae(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:r}}),n.address}static async fromName(e,r){var i;let n=r;for(;;){if(n===""||n==="."||r!=="eth"&&n==="eth")return null;const s=await Pe(i=tg,M6,TJ).call(i,e,n);if(s!=null){const o=new tg(e,s,r);return n!==r&&!await o.supportsWildcard()?null:o}n=n.split(".").slice(1).join(".")}}};Kl=new WeakMap,wf=new WeakMap,Zl=new WeakSet,q0=async function(e,r){r=(r||[]).slice();const n=H(this,wf).interface;r.unshift(gP(this.name));let i=null;await this.supportsWildcard()&&(i=n.getFunction(e),Ae(i,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),r=[_4e(this.name,255),n.encodeFunctionData(i,r)],e="resolve(bytes,bytes)"),r.push({enableCcipRead:!0});try{const s=await H(this,wf)[e](...r);return i?n.decodeFunctionResult(i,s)[0]:s}catch(s){if(!ti(s,"CALL_EXCEPTION"))throw s}return null},M6=new WeakSet,TJ=async function(e,r){const n=await tg.getEnsAddress(e);try{const s=await new dg(n,["function resolver(bytes32) view returns (address)"],e).resolver(gP(r),{enableCcipRead:!0});return s===_y?null:s}catch(i){throw i}return null},me(tg,M6);let e6=tg;const jB=BigInt(0);function Nt(t,e){return function(r){return r==null?e:t(r)}}function EA(t,e){return r=>{if(e&&r==null)return null;if(!Array.isArray(r))throw new Error("not an array");return r.map(n=>t(n))}}function Kv(t,e){return r=>{const n={};for(const i in t){let s=i;if(e&&i in e&&!(s in r)){for(const o of e[i])if(o in r){s=o;break}}try{const o=t[i](r[s]);o!==void 0&&(n[i]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";Ae(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:r})}}return n}}function CCe(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}ee(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Pm(t){return ee(vr(t,!0),"invalid data","value",t),t}function Un(t){return ee(vr(t,32),"invalid hash","value",t),t}const ACe=Kv({address:cr,blockHash:Un,blockNumber:Et,data:Pm,index:Et,removed:Nt(CCe,!1),topics:EA(Un),transactionHash:Un,transactionIndex:Et},{index:["logIndex"]});function xCe(t){return ACe(t)}const SCe=Kv({hash:Nt(Un),parentHash:Un,parentBeaconBlockRoot:Nt(Un,null),number:Et,timestamp:Et,nonce:Nt(Pm),difficulty:et,gasLimit:et,gasUsed:et,stateRoot:Nt(Un,null),receiptsRoot:Nt(Un,null),blobGasUsed:Nt(et,null),excessBlobGas:Nt(et,null),miner:Nt(cr),prevRandao:Nt(Un,null),extraData:Pm,baseFeePerGas:Nt(et)},{prevRandao:["mixHash"]});function TCe(t){const e=SCe(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:IJ(r)),e}const ICe=Kv({transactionIndex:Et,blockNumber:Et,transactionHash:Un,address:cr,topics:EA(Un),data:Pm,index:Et,blockHash:Un},{index:["logIndex"]});function PCe(t){return ICe(t)}const OCe=Kv({to:Nt(cr,null),from:Nt(cr,null),contractAddress:Nt(cr,null),index:Et,root:Nt(Je),gasUsed:et,blobGasUsed:Nt(et,null),logsBloom:Nt(Pm),blockHash:Un,hash:Un,logs:EA(PCe),blockNumber:Et,cumulativeGasUsed:et,effectiveGasPrice:Nt(et),blobGasPrice:Nt(et,null),status:Nt(Et),type:Nt(Et,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function RCe(t){return OCe(t)}function IJ(t){t.to&&et(t.to)===jB&&(t.to="0x0000000000000000000000000000000000000000");const e=Kv({hash:Un,index:Nt(Et,void 0),type:r=>r==="0x"||r==null?0:Et(r),accessList:Nt(Ap,null),blobVersionedHashes:Nt(EA(Un,!0),null),blockHash:Nt(Un,null),blockNumber:Nt(Et,null),transactionIndex:Nt(Et,null),from:cr,gasPrice:Nt(et),maxPriorityFeePerGas:Nt(et),maxFeePerGas:Nt(et),maxFeePerBlobGas:Nt(et,null),gasLimit:et,to:Nt(cr,null),value:et,nonce:Et,data:Pm,creates:Nt(cr,null),chainId:Nt(et,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=A5e(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=Wo.from(t.signature):e.signature=Wo.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&et(e.blockHash)===jB&&(e.blockHash=null),e}const kCe="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Zv{constructor(e){ce(this,"name");ut(this,{name:e})}clone(){return new Zv(this.name)}}class CA extends Zv{constructor(r,n){r==null&&(r=0);super(`org.ethers.network.plugins.GasCost#${r||0}`);ce(this,"effectiveBlock");ce(this,"txBase");ce(this,"txCreate");ce(this,"txDataZero");ce(this,"txDataNonzero");ce(this,"txAccessListStorageKey");ce(this,"txAccessListAddress");const i={effectiveBlock:r};function s(o,a){let c=(n||{})[o];c==null&&(c=a),ee(typeof c=="number",`invalud value for ${o}`,"costs",n),i[o]=c}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),ut(this,i)}clone(){return new CA(this.effectiveBlock,this)}}class AA extends Zv{constructor(r,n){super("org.ethers.plugins.network.Ens");ce(this,"address");ce(this,"targetNetwork");ut(this,{address:r||kCe,targetNetwork:n??1})}clone(){return new AA(this.address,this.targetNetwork)}}var wv,bv;class NCe extends Zv{constructor(r,n){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");me(this,wv);me(this,bv);Z(this,wv,r),Z(this,bv,n)}get url(){return H(this,wv)}get processFunc(){return H(this,bv)}clone(){return this}}wv=new WeakMap,bv=new WeakMap;const SS=new Map;var Fg,Hg,Yl;const rg=class rg{constructor(e,r){me(this,Fg);me(this,Hg);me(this,Yl);Z(this,Fg,e),Z(this,Hg,et(r)),Z(this,Yl,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return H(this,Fg)}set name(e){Z(this,Fg,e)}get chainId(){return H(this,Hg)}set chainId(e){Z(this,Hg,et(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===et(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===et(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===et(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(H(this,Yl).values())}attachPlugin(e){if(H(this,Yl).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return H(this,Yl).set(e.name,e.clone()),this}getPlugin(e){return H(this,Yl).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new rg(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new CA;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i<e.data.length;i+=2)e.data.substring(i,i+2)==="00"?n+=r.txDataZero:n+=r.txDataNonzero;if(e.accessList){const i=Ap(e.accessList);for(const s in i)n+=r.txAccessListAddress+r.txAccessListStorageKey*i[s].storageKeys.length}return n}static from(e){if($Ce(),e==null)return rg.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const r=SS.get(e);if(r)return r();if(typeof e=="bigint")return new rg("unknown",e);ee(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){ee(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const r=new rg(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&r.attachPlugin(new AA(e.ensAddress,e.ensNetwork)),r}ee(!1,"invalid network","network",e)}static register(e,r){typeof e=="number"&&(e=BigInt(e));const n=SS.get(e);n&&ee(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),SS.set(e,r)}};Fg=new WeakMap,Hg=new WeakMap,Yl=new WeakMap;let Wa=rg;function BB(t,e){const r=String(t);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const n=r.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${t}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function DB(t){return new NCe(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[s,o]=await Promise.all([n.send(),e()]);i=s;const a=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:BB(a.maxFee,9),maxPriorityFeePerGas:BB(a.maxPriorityFee,9)}}catch(s){Ae(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}let MB=!1;function $Ce(){if(MB)return;MB=!0;function t(e,r,n){const i=function(){const s=new Wa(e,r);return n.ensNetwork!=null&&s.attachPlugin(new AA(null,n.ensNetwork)),s.attachPlugin(new CA),(n.plugins||[]).forEach(o=>{s.attachPlugin(o)}),s};Wa.register(e,i),Wa.register(r,i),n.altNames&&n.altNames.forEach(s=>{Wa.register(s,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[DB("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[DB("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function _P(t){return JSON.parse(JSON.stringify(t))}var uu,Ys,Jl,$a,qg,cC;class jCe{constructor(e){me(this,qg);me(this,uu);me(this,Ys);me(this,Jl);me(this,$a);Z(this,uu,e),Z(this,Ys,null),Z(this,Jl,4e3),Z(this,$a,-2)}get pollingInterval(){return H(this,Jl)}set pollingInterval(e){Z(this,Jl,e)}start(){H(this,Ys)||(Z(this,Ys,H(this,uu)._setTimeout(Pe(this,qg,cC).bind(this),H(this,Jl))),Pe(this,qg,cC).call(this))}stop(){H(this,Ys)&&(H(this,uu)._clearTimeout(H(this,Ys)),Z(this,Ys,null))}pause(e){this.stop(),e&&Z(this,$a,-2)}resume(){this.start()}}uu=new WeakMap,Ys=new WeakMap,Jl=new WeakMap,$a=new WeakMap,qg=new WeakSet,cC=async function(){try{const e=await H(this,uu).getBlockNumber();if(H(this,$a)===-2){Z(this,$a,e);return}if(e!==H(this,$a)){for(let r=H(this,$a)+1;r<=e;r++){if(H(this,Ys)==null)return;await H(this,uu).emit("block",r)}Z(this,$a,e)}}catch{}H(this,Ys)!=null&&Z(this,Ys,H(this,uu)._setTimeout(Pe(this,qg,cC).bind(this),H(this,Jl)))};var bf,yf,Ql;class R7{constructor(e){me(this,bf);me(this,yf);me(this,Ql);Z(this,bf,e),Z(this,Ql,!1),Z(this,yf,r=>{this._poll(r,H(this,bf))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){H(this,Ql)||(Z(this,Ql,!0),H(this,yf).call(this,-2),H(this,bf).on("block",H(this,yf)))}stop(){H(this,Ql)&&(Z(this,Ql,!1),H(this,bf).off("block",H(this,yf)))}pause(e){this.stop()}resume(){this.start()}}bf=new WeakMap,yf=new WeakMap,Ql=new WeakMap;var zg,lu;class BCe extends R7{constructor(r,n){super(r);me(this,zg);me(this,lu);Z(this,zg,n),Z(this,lu,-2)}pause(r){r&&Z(this,lu,-2),super.pause(r)}async _poll(r,n){const i=await n.getBlock(H(this,zg));i!=null&&(H(this,lu)===-2?Z(this,lu,i.number):i.number>H(this,lu)&&(n.emit(H(this,zg),i.number),Z(this,lu,i.number)))}}zg=new WeakMap,lu=new WeakMap;var L6;class DCe extends R7{constructor(r,n){super(r);me(this,L6);Z(this,L6,_P(n))}async _poll(r,n){throw new Error("@TODO")}}L6=new WeakMap;var Wg;class MCe extends R7{constructor(r,n){super(r);me(this,Wg);Z(this,Wg,n)}async _poll(r,n){const i=await n.getTransactionReceipt(H(this,Wg));i&&n.emit(H(this,Wg),i)}}Wg=new WeakMap;var du,Vg,Gg,Xl,Js,U6,PJ;class k7{constructor(e,r){me(this,U6);me(this,du);me(this,Vg);me(this,Gg);me(this,Xl);me(this,Js);Z(this,du,e),Z(this,Vg,_P(r)),Z(this,Gg,Pe(this,U6,PJ).bind(this)),Z(this,Xl,!1),Z(this,Js,-2)}start(){H(this,Xl)||(Z(this,Xl,!0),H(this,Js)===-2&&H(this,du).getBlockNumber().then(e=>{Z(this,Js,e)}),H(this,du).on("block",H(this,Gg)))}stop(){H(this,Xl)&&(Z(this,Xl,!1),H(this,du).off("block",H(this,Gg)))}pause(e){this.stop(),e&&Z(this,Js,-2)}resume(){this.start()}}du=new WeakMap,Vg=new WeakMap,Gg=new WeakMap,Xl=new WeakMap,Js=new WeakMap,U6=new WeakSet,PJ=async function(e){if(H(this,Js)===-2)return;const r=_P(H(this,Vg));r.fromBlock=H(this,Js)+1,r.toBlock=e;const n=await H(this,du).getLogs(r);if(n.length===0){H(this,Js)<e-60&&Z(this,Js,e-60);return}for(const i of n)H(this,du).emit(H(this,Vg),i),Z(this,Js,i.blockNumber)};const LCe=BigInt(2),UCe=10;function I3(t){return t&&typeof t.then=="function"}function uC(t,e){return t+":"+JSON.stringify(e,(r,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}class OJ{constructor(e){ce(this,"name");ut(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function FCe(t){return JSON.parse(JSON.stringify(t))}function EP(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function TS(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(vr(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:uC("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:uC("orphan",r),filter:FCe(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?EP(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],s=[],o=a=>{vr(a)?i.push(a):s.push((async()=>{i.push(await vi(a,e))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),s.length&&await Promise.all(s),n.address=EP(i.map(a=>a.toLowerCase()))}return{filter:n,tag:uC("event",n),type:"event"}}ee(!1,"unknown ProviderEvent","event",t)}function IS(){return new Date().getTime()}const HCe={cacheTimeout:250,pollingInterval:4e3};var Qn,ed,Xn,Kg,ws,vf,td,hu,yv,Qs,Zg,Yg,Tt,ds,CP,AP,ab,xP,cb,lC;class qCe{constructor(e,r){me(this,Tt);me(this,Qn);me(this,ed);me(this,Xn);me(this,Kg);me(this,ws);me(this,vf);me(this,td);me(this,hu);me(this,yv);me(this,Qs);me(this,Zg);me(this,Yg);if(Z(this,Yg,Object.assign({},HCe,r||{})),e==="any")Z(this,vf,!0),Z(this,ws,null);else if(e){const n=Wa.from(e);Z(this,vf,!1),Z(this,ws,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else Z(this,vf,!1),Z(this,ws,null);Z(this,hu,-1),Z(this,td,new Map),Z(this,Qn,new Map),Z(this,ed,new Map),Z(this,Xn,null),Z(this,Kg,!1),Z(this,yv,1),Z(this,Qs,new Map),Z(this,Zg,!1)}get pollingInterval(){return H(this,Yg).pollingInterval}get provider(){return this}get plugins(){return Array.from(H(this,ed).values())}attachPlugin(e){if(H(this,ed).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return H(this,ed).set(e.name,e.connect(this)),this}getPlugin(e){return H(this,ed).get(e)||null}get disableCcipRead(){return H(this,Zg)}set disableCcipRead(e){Z(this,Zg,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a<n.length;a++){const c=n[a],u=c.replace("{sender}",i).replace("{data}",s),l=new ku(u);c.indexOf("{data}")===-1&&(l.body={data:s,sender:i}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:l,index:a,urls:n});let d="unknown error";const h=await l.send();try{const f=h.bodyJson;if(f.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:l,result:f}),f.data;f.message&&(d=f.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:l,result:f})}catch{}Ae(h.statusCode<400||h.statusCode>=500,`response not found during CCIP fetch: ${d}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:d}}),o.push(d)}Ae(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,r){return new cCe(TCe(e),this)}_wrapLog(e,r){return new Gv(xCe(e),this)}_wrapTransactionReceipt(e,r){return new gJ(RCe(e),this)}_wrapTransactionResponse(e,r){return new Py(IJ(e),this)}_detectNetwork(){Ae(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Ae(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Et(await Pe(this,Tt,ds).call(this,{method:"getBlockNumber"}),"%response");return H(this,hu)>=0&&Z(this,hu,e),e}_getAddress(e){return vi(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(vr(e))return vr(e,32)?e:J0(e);if(typeof e=="bigint"&&(e=Et(e,"blockTag")),typeof e=="number")return e>=0?J0(e):H(this,hu)>=0?J0(H(this,hu)+e):this.getBlockNumber().then(r=>J0(r+e));ee(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?EP(c.map(u=>u.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(c,u,l)=>{let d;switch(c.length){case 0:break;case 1:d=c[0];break;default:c.sort(),d=c}if(n&&(u!=null||l!=null))throw new Error("invalid filter");const h={};return d&&(h.address=d),r.length&&(h.topics=r),u&&(h.fromBlock=u),l&&(h.toBlock=l),n&&(h.blockHash=n),h};let s=[];if(e.address)if(Array.isArray(e.address))for(const c of e.address)s.push(this._getAddress(c));else s.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),s.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(s),o,a]).then(c=>i(c[0],c[1],c[2])):i(s,o,a)}_getTransactionRequest(e){const r=QC(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const s=vi(r[i],this);I3(s)?n.push(async function(){r[i]=await s}()):r[i]=s}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);I3(i)?n.push(async function(){r.blockTag=await i}()):r.blockTag=i}return n.length?async function(){return await Promise.all(n),r}():r}async getNetwork(){if(H(this,ws)==null){const i=(async()=>{try{const s=await this._detectNetwork();return this.emit("network",s,null),s}catch(s){throw H(this,ws)===i&&Z(this,ws,null),s}})();return Z(this,ws,i),(await i).clone()}const e=H(this,ws),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(H(this,vf)?(this.emit("network",n,r),H(this,ws)===e&&Z(this,ws,Promise.resolve(n))):Ae(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:s,priorityFee:o}=await mi({_block:Pe(this,Tt,xP).call(this,"latest",!1),gasPrice:(async()=>{try{const l=await Pe(this,Tt,ds).call(this,{method:"getGasPrice"});return et(l,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const l=await Pe(this,Tt,ds).call(this,{method:"getPriorityFee"});return et(l,"%response")}catch{}return null})()});let a=null,c=null;const u=this._wrapBlock(i,e);return u&&u.baseFeePerGas&&(c=o??BigInt("1000000000"),a=u.baseFeePerGas*LCe+c),new RB(s,a,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new ku(n.url),s=await n.processFunc(r,this,i);return new RB(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return I3(r)&&(r=await r),et(await Pe(this,Tt,ds).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await mi({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await Pe(this,Tt,AP).call(this,Pe(this,Tt,CP).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return et(await Pe(this,Tt,ab).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return Et(await Pe(this,Tt,ab).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return Je(await Pe(this,Tt,ab).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=et(r,"position");return Je(await Pe(this,Tt,ab).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await mi({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=YC.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await mi({network:this.getNetwork(),params:Pe(this,Tt,xP).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await mi({network:this.getNetwork(),params:Pe(this,Tt,ds).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await mi({network:this.getNetwork(),params:Pe(this,Tt,ds).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await Pe(this,Tt,ds).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await mi({network:this.getNetwork(),result:Pe(this,Tt,ds).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:Je(r)}async getLogs(e){let r=this._getFilter(e);I3(r)&&(r=await r);const{network:n,params:i}=await mi({network:this.getNetwork(),params:Pe(this,Tt,ds).call(this,{method:"getLogs",filter:r})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){Ae(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await e6.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=cr(e);const r=gP(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await e6.getEnsAddress(this),s=await new dg(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(s==null||s===_y)return null;const a=await new dg(s,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(a)!==e?null:a}catch(n){if(ti(n,"BAD_DATA")&&n.value==="0x"||ti(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,o)=>{let a=null;const c=async u=>{try{const l=await this.getTransactionReceipt(e);if(l!=null&&u-l.blockNumber+1>=i){s(l),a&&(clearTimeout(a),a=null);return}}catch(l){console.log("EEE",l)}this.once("block",c)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",c),o(Hr("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){Ae(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=H(this,Qs).get(e);r&&(r.timer&&clearTimeout(r.timer),H(this,Qs).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=I1(this,yv)._++,i=()=>{H(this,Qs).delete(n),e()};if(this.paused)H(this,Qs).set(n,{timer:null,func:i,time:r});else{const s=setTimeout(i,r);H(this,Qs).set(n,{timer:s,func:i,time:IS()})}return n}_forEachSubscriber(e){for(const r of H(this,Qn).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new OJ(e.type);case"block":{const r=new jCe(this);return r.pollingInterval=this.pollingInterval,r}case"safe":case"finalized":return new BCe(this,e.type);case"event":return new k7(this,e.filter);case"transaction":return new MCe(this,e.hash);case"orphan":return new DCe(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of H(this,Qn).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),H(this,Xn)!=null&&r.pause(H(this,Xn));break}}async on(e,r){const n=await Pe(this,Tt,lC).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,H(this,Xn)!=null&&n.subscriber.pause(H(this,Xn))),this}async once(e,r){const n=await Pe(this,Tt,lC).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,H(this,Xn)!=null&&n.subscriber.pause(H(this,Xn))),this}async emit(e,...r){const n=await Pe(this,Tt,cb).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:o})=>{const a=new zZ(this,o?null:s,e);try{s.call(this,...r,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),H(this,Qn).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await Pe(this,Tt,cb).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of H(this,Qn).values())r+=n.length;return r}async listeners(e){if(e){const n=await Pe(this,Tt,cb).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of H(this,Qn).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await Pe(this,Tt,cb).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),H(this,Qn).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await Pe(this,Tt,lC).call(this,e);n&&i.stop(),H(this,Qn).delete(r)}else for(const[r,{started:n,subscriber:i}]of H(this,Qn))n&&i.stop(),H(this,Qn).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return H(this,Kg)}destroy(){this.removeAllListeners();for(const e of H(this,Qs).keys())this._clearTimeout(e);Z(this,Kg,!0)}get paused(){return H(this,Xn)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(Z(this,hu,-1),H(this,Xn)!=null){if(H(this,Xn)==!!e)return;Ae(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),Z(this,Xn,!!e);for(const r of H(this,Qs).values())r.timer&&clearTimeout(r.timer),r.time=IS()-r.time}resume(){if(H(this,Xn)!=null){this._forEachSubscriber(e=>e.resume()),Z(this,Xn,null);for(const e of H(this,Qs).values()){let r=e.time;r<0&&(r=0),e.time=IS(),setTimeout(e.func,r)}}}}Qn=new WeakMap,ed=new WeakMap,Xn=new WeakMap,Kg=new WeakMap,ws=new WeakMap,vf=new WeakMap,td=new WeakMap,hu=new WeakMap,yv=new WeakMap,Qs=new WeakMap,Zg=new WeakMap,Yg=new WeakMap,Tt=new WeakSet,ds=async function(e){const r=H(this,Yg).cacheTimeout;if(r<0)return await this._perform(e);const n=uC(e.method,e);let i=H(this,td).get(n);return i||(i=this._perform(e),H(this,td).set(n,i),setTimeout(()=>{H(this,td).get(n)===i&&H(this,td).delete(n)},r)),await i},CP=async function(e,r,n){Ae(n<UCe,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:r,enableCcipRead:!0})});const i=QC(e);try{return Je(await this._perform({method:"call",transaction:i,blockTag:r}))}catch(s){if(!this.disableCcipRead&&d7(s)&&s.data&&n>=0&&r==="latest"&&i.to!=null&&qr(s.data,0,4)==="0x556f1830"){const o=s.data,a=await vi(i.to,this);let c;try{c=KCe(qr(s.data,4))}catch(d){Ae(!1,d.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}Ae(c.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const u=await this.ccipReadFetch(i,c.calldata,c.urls);Ae(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:s.data,errorArgs:c.errorArgs}});const l={to:a,data:en([c.selector,GCe([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:l});try{const d=await Pe(this,Tt,CP).call(this,l,r,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},l),result:d}),d}catch(d){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},l),error:d}),d}}throw s}},AP=async function(e){const{value:r}=await mi({network:this.getNetwork(),value:e});return r},ab=async function(e,r,n){let i=this._getAddress(r),s=this._getBlockTag(n);return(typeof i!="string"||typeof s!="string")&&([i,s]=await Promise.all([i,s])),await Pe(this,Tt,AP).call(this,Pe(this,Tt,ds).call(this,Object.assign(e,{address:i,blockTag:s})))},xP=async function(e,r){if(vr(e,32))return await Pe(this,Tt,ds).call(this,{method:"getBlock",blockHash:e,includeTransactions:r});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await Pe(this,Tt,ds).call(this,{method:"getBlock",blockTag:n,includeTransactions:r})},cb=async function(e,r){let n=await TS(e,this);return n.type==="event"&&r&&r.length>0&&r[0].removed===!0&&(n=await TS({orphan:"drop-log",log:r[0]},this)),H(this,Qn).get(n.tag)||null},lC=async function(e){const r=await TS(e,this),n=r.tag;let i=H(this,Qn).get(n);return i||(i={subscriber:this._getSubscriber(r),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},H(this,Qn).set(n,i)),i};function zCe(t,e){try{const r=SP(t,e);if(r)return HC(r)}catch{}return null}function SP(t,e){if(t==="0x")return null;try{const r=Et(qr(t,e,e+32)),n=Et(qr(t,r,r+32));return qr(t,r+32,r+32+n)}catch{}return null}function LB(t){const e=bi(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function WCe(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const VCe=new Uint8Array([]);function GCe(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(VCe),r+=32;for(let n=0;n<t.length;n++){const i=jt(t[n]);e[n]=LB(r),e.push(LB(i.length)),e.push(WCe(i)),r+=32+Math.ceil(i.length/32)*32}return en(e)}const UB="0x0000000000000000000000000000000000000000000000000000000000000000";function KCe(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};Ae(ag(t)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=qr(t,0,32);Ae(qr(r,0,12)===qr(UB,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=qr(r,12);try{const n=[],i=Et(qr(t,32,64)),s=Et(qr(t,i,i+32)),o=qr(t,i+32);for(let a=0;a<s;a++){const c=zCe(o,a*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{Ae(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const n=SP(t,64);if(n==null)throw new Error("abort");e.calldata=n}catch{Ae(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}Ae(qr(t,100,128)===qr(UB,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=qr(t,96,100);try{const n=SP(t,128);if(n==null)throw new Error("abort");e.extraData=n}catch{Ae(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}function h0(t,e){if(t.provider)return t.provider;Ae(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function FB(t,e){let r=QC(e);if(r.to!=null&&(r.to=vi(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),vi(n,t)]).then(([i,s])=>(ee(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else r.from=t.getAddress();return await mi(r)}class ZCe{constructor(e){ce(this,"provider");ut(this,{provider:e||null})}async getNonce(e){return h0(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await FB(this,e)}async populateTransaction(e){const r=h0(this,"populateTransaction"),n=await FB(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const o=et(n.chainId);ee(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?ee(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&ee(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const o=await r.getFeeData();Ae(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{const o=await r.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(Ae(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):Ae(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await mi(n)}async estimateGas(e){return h0(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return h0(this,"call").call(await this.populateCall(e))}async resolveName(e){return await h0(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=h0(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=YC.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}function YCe(t){return JSON.parse(JSON.stringify(t))}var gi,ja,_f,rd,Ef,Jg,Nd,TP,IP;class RJ{constructor(e){me(this,Nd);me(this,gi);me(this,ja);me(this,_f);me(this,rd);me(this,Ef);me(this,Jg);Z(this,gi,e),Z(this,ja,null),Z(this,_f,Pe(this,Nd,TP).bind(this)),Z(this,rd,!1),Z(this,Ef,null),Z(this,Jg,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,r){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){H(this,rd)||(Z(this,rd,!0),Pe(this,Nd,TP).call(this,-2))}stop(){H(this,rd)&&(Z(this,rd,!1),Z(this,Jg,!0),Pe(this,Nd,IP).call(this),H(this,gi).off("block",H(this,_f)))}pause(e){e&&Pe(this,Nd,IP).call(this),H(this,gi).off("block",H(this,_f))}resume(){this.start()}}gi=new WeakMap,ja=new WeakMap,_f=new WeakMap,rd=new WeakMap,Ef=new WeakMap,Jg=new WeakMap,Nd=new WeakSet,TP=async function(e){try{H(this,ja)==null&&Z(this,ja,this._subscribe(H(this,gi)));let r=null;try{r=await H(this,ja)}catch(s){if(!ti(s,"UNSUPPORTED_OPERATION")||s.operation!=="eth_newFilter")throw s}if(r==null){Z(this,ja,null),H(this,gi)._recoverSubscriber(this,this._recover(H(this,gi)));return}const n=await H(this,gi).getNetwork();if(H(this,Ef)||Z(this,Ef,n),H(this,Ef).chainId!==n.chainId)throw new Error("chaid changed");if(H(this,Jg))return;const i=await H(this,gi).send("eth_getFilterChanges",[r]);await this._emitResults(H(this,gi),i)}catch(r){console.log("@TODO",r)}H(this,gi).once("block",H(this,_f))},IP=function(){const e=H(this,ja);e&&(Z(this,ja,null),e.then(r=>{H(this,gi).destroyed||H(this,gi).send("eth_uninstallFilter",[r])}))};var Cf;class JCe extends RJ{constructor(r,n){super(r);me(this,Cf);Z(this,Cf,YCe(n))}_recover(r){return new k7(r,H(this,Cf))}async _subscribe(r){return await r.send("eth_newFilter",[H(this,Cf)])}async _emitResults(r,n){for(const i of n)r.emit(H(this,Cf),r._wrapLog(i,r._network))}}Cf=new WeakMap;class QCe extends RJ{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,r){for(const n of r)e.emit("pending",n)}}const XCe="bigint,boolean,function,number,string,symbol".split(/,/g);function dC(t){if(t==null||XCe.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(dC);if(typeof t=="object")return Object.keys(t).reduce((e,r)=>(e[r]=t[r],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function e6e(t){return new Promise(e=>{setTimeout(e,t)})}function f0(t){return t&&t.toLowerCase()}function HB(t){return t&&typeof t.pollingInterval=="number"}const kJ={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class hg extends ZCe{constructor(r,n){super(r);ce(this,"address");n=cr(n),ut(this,{address:n})}connect(r){Ae(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(r){return await this.populateCall(r)}async sendUncheckedTransaction(r){const n=dC(r),i=[];if(n.from){const o=n.from;i.push((async()=>{const a=await vi(o,this.provider);ee(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=a})())}else n.from=this.address;if(n.gasLimit==null&&i.push((async()=>{n.gasLimit=await this.provider.estimateGas({...n,from:this.address})})()),n.to!=null){const o=n.to;i.push((async()=>{n.to=await vi(o,this.provider)})())}i.length&&await Promise.all(i);const s=this.provider.getRpcTransaction(n);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(r){const n=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(r);return await new Promise((s,o)=>{const a=[1e3,100];let c=0;const u=async()=>{try{const l=await this.provider.getTransaction(i);if(l!=null){s(l.replaceableTransaction(n));return}}catch(l){if(ti(l,"CANCELLED")||ti(l,"BAD_DATA")||ti(l,"NETWORK_ERROR")){l.info==null&&(l.info={}),l.info.sendTransactionHash=i,o(l);return}if(ti(l,"INVALID_ARGUMENT")&&(c++,l.info==null&&(l.info={}),l.info.sendTransactionHash=i,c>10)){o(l);return}this.provider.emit("error",Hr("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:l}))}this.provider._setTimeout(()=>{u()},a.pop()||4e3)};u()})}async signTransaction(r){const n=dC(r);if(n.from){const s=await vi(n.from,this.provider);ee(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",r),n.from=s}else n.from=this.address;const i=this.provider.getRpcTransaction(n);return await this.provider.send("eth_signTransaction",[i])}async signMessage(r){const n=typeof r=="string"?Za(r):r;return await this.provider.send("personal_sign",[Je(n),this.address.toLowerCase()])}async signTypedData(r,n,i){const s=dC(i),o=await JC.resolveNames(r,n,s,async a=>{const c=await vi(a);return ee(c!=null,"TypedData does not support null address","value",a),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(JC.getPayload(o.domain,n,o.value))])}async unlock(r){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),r,null])}async _legacySignMessage(r){const n=typeof r=="string"?Za(r):r;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Je(n)])}}var Af,Qg,fu,Ba,Bo,Xs,qi,vv,PP;class t6e extends qCe{constructor(r,n){super(r,n);me(this,vv);me(this,Af);me(this,Qg);me(this,fu);me(this,Ba);me(this,Bo);me(this,Xs);me(this,qi);Z(this,Qg,1),Z(this,Af,Object.assign({},kJ,n||{})),Z(this,fu,[]),Z(this,Ba,null),Z(this,Xs,null),Z(this,qi,null);{let s=null;const o=new Promise(a=>{s=a});Z(this,Bo,{promise:o,resolve:s})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(ee(!i||r!=="any","staticNetwork cannot be used on special network 'any'","options",n),i&&r!=null&&Z(this,Xs,Wa.from(r))):i&&(ee(r==null||i.matches(r),"staticNetwork MUST match network object","options",n),Z(this,Xs,i))}_getOption(r){return H(this,Af)[r]}get _network(){return Ae(H(this,Xs),"network is not available yet","NETWORK_ERROR"),H(this,Xs)}async _perform(r){if(r.method==="call"||r.method==="estimateGas"){let i=r.transaction;if(i&&i.type!=null&&et(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Object.assign({},r,{transaction:Object.assign({},i,{type:void 0})}))}}const n=this.getRpcRequest(r);return n!=null?await this.send(n.method,n.args):super._perform(r)}async _detectNetwork(){const r=this._getOption("staticNetwork");if(r)if(r===!0){if(H(this,Xs))return H(this,Xs)}else return r;return H(this,qi)?await H(this,qi):this.ready?(Z(this,qi,(async()=>{try{const n=Wa.from(et(await this.send("eth_chainId",[])));return Z(this,qi,null),n}catch(n){throw Z(this,qi,null),n}})()),await H(this,qi)):(Z(this,qi,(async()=>{const n={id:I1(this,Qg)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:n});let i;try{i=(await this._send(n))[0],Z(this,qi,null)}catch(s){throw Z(this,qi,null),this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return Wa.from(et(i.result));throw this.getRpcError(n,i)})()),await H(this,qi))}_start(){H(this,Bo)==null||H(this,Bo).resolve==null||(H(this,Bo).resolve(),Z(this,Bo,null),(async()=>{for(;H(this,Xs)==null&&!this.destroyed;)try{Z(this,Xs,await this._detectNetwork())}catch(r){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Hr("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:r}})),await e6e(1e3)}Pe(this,vv,PP).call(this)})())}async _waitUntilReady(){if(H(this,Bo)!=null)return await H(this,Bo).promise}_getSubscriber(r){return r.type==="pending"?new QCe(this):r.type==="event"?this._getOption("polling")?new k7(this,r.filter):new JCe(this,r.filter):r.type==="orphan"&&r.filter.orphan==="drop-log"?new OJ("orphan"):super._getSubscriber(r)}get ready(){return H(this,Bo)==null}getRpcTransaction(r){const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(r[i]==null)return;let s=i;i==="gasLimit"&&(s="gas"),n[s]=J0(et(r[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{r[i]!=null&&(n[i]=Je(r[i]))}),r.accessList&&(n.accessList=Ap(r.accessList)),r.blobVersionedHashes&&(n.blobVersionedHashes=r.blobVersionedHashes.map(i=>i.toLowerCase())),n}getRpcRequest(r){switch(r.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[f0(r.address),r.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[f0(r.address),r.blockTag]};case"getCode":return{method:"eth_getCode",args:[f0(r.address),r.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[f0(r.address),"0x"+r.position.toString(16),r.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[r.signedTransaction]};case"getBlock":if("blockTag"in r)return{method:"eth_getBlockByNumber",args:[r.blockTag,!!r.includeTransactions]};if("blockHash"in r)return{method:"eth_getBlockByHash",args:[r.blockHash,!!r.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[r.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[r.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(r.transaction),r.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(r.transaction)]};case"getLogs":return r.filter&&r.filter.address!=null&&(Array.isArray(r.filter.address)?r.filter.address=r.filter.address.map(f0):r.filter.address=f0(r.filter.address)),{method:"eth_getLogs",args:[r.filter]}}return null}getRpcError(r,n){const{method:i}=r,{error:s}=n;if(i==="eth_estimateGas"&&s.message){const c=s.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return Hr("insufficient funds","INSUFFICIENT_FUNDS",{transaction:r.params[0],info:{payload:r,error:s}})}if(i==="eth_call"||i==="eth_estimateGas"){const c=OP(s),u=Iy.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",r.params[0],c?c.data:null);return u.info={error:s,payload:r},u}const o=JSON.stringify(n6e(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i))return Hr("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:r,error:s}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const c=r.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return Hr("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:s}});if(o.match(/nonce/i)&&o.match(/too low/i))return Hr("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:s}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return Hr("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:s}});if(o.match(/only replay-protected/i))return Hr("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:c,info:{error:s}}})}let a=!!o.match(/the method .* does not exist/i);return a||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(a=!0),a?Hr("unsupported operation","UNSUPPORTED_OPERATION",{operation:r.method,info:{error:s,payload:r}}):Hr("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:r})}send(r,n){if(this.destroyed)return Promise.reject(Hr("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r}));const i=I1(this,Qg)._++,s=new Promise((o,a)=>{H(this,fu).push({resolve:o,reject:a,payload:{method:r,params:n,id:i,jsonrpc:"2.0"}})});return Pe(this,vv,PP).call(this),s}async getSigner(r){r==null&&(r=0);const n=this.send("eth_accounts",[]);if(typeof r=="number"){const s=await n;if(r>=s.length)throw new Error("no such account");return new hg(this,s[r])}const{accounts:i}=await mi({network:this.getNetwork(),accounts:n});r=cr(r);for(const s of i)if(cr(s)===r)return new hg(this,r);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(n=>new hg(this,n))}destroy(){H(this,Ba)&&(clearTimeout(H(this,Ba)),Z(this,Ba,null));for(const{payload:r,reject:n}of H(this,fu))n(Hr("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:r.method}));Z(this,fu,[]),super.destroy()}}Af=new WeakMap,Qg=new WeakMap,fu=new WeakMap,Ba=new WeakMap,Bo=new WeakMap,Xs=new WeakMap,qi=new WeakMap,vv=new WeakSet,PP=function(){if(H(this,Ba))return;const r=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");Z(this,Ba,setTimeout(()=>{Z(this,Ba,null);const n=H(this,fu);for(Z(this,fu,[]);n.length;){const i=[n.shift()];for(;n.length&&i.length!==H(this,Af).batchMaxCount;)if(i.push(n.shift()),JSON.stringify(i.map(o=>o.payload)).length>H(this,Af).batchMaxSize){n.unshift(i.pop());break}(async()=>{const s=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{const o=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:a,reject:c,payload:u}of i){if(this.destroyed){c(Hr("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}const l=o.filter(d=>d.id===u.id)[0];if(l==null){const d=Hr("missing response for request","BAD_DATA",{value:o,info:{payload:u}});this.emit("error",d),c(d);continue}if("error"in l){c(this.getRpcError(u,l));continue}a(l.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:a}of i)a(o)}})()}},r))};var nd;class NJ extends t6e{constructor(r,n){super(r,n);me(this,nd);let i=this._getOption("pollingInterval");i==null&&(i=kJ.pollingInterval),Z(this,nd,i)}_getSubscriber(r){const n=super._getSubscriber(r);return HB(n)&&(n.pollingInterval=H(this,nd)),n}get pollingInterval(){return H(this,nd)}set pollingInterval(r){if(!Number.isInteger(r)||r<0)throw new Error("invalid interval");Z(this,nd,r),this._forEachSubscriber(n=>{HB(n)&&(n.pollingInterval=H(this,nd))})}}nd=new WeakMap;var Xg;class r6e extends NJ{constructor(r,n,i){r==null&&(r="http://localhost:8545");super(n,i);me(this,Xg);typeof r=="string"?Z(this,Xg,new ku(r)):Z(this,Xg,r.clone())}_getConnection(){return H(this,Xg).clone()}async send(r,n){return await this._start(),await super.send(r,n)}async _send(r){const n=this._getConnection();n.body=JSON.stringify(r),n.setHeader("content-type","application/json");const i=await n.send();i.assertOk();let s=i.bodyJson;return Array.isArray(s)||(s=[s]),s}}Xg=new WeakMap;function OP(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&vr(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const r=OP(t[e]);if(r)return r}return null}if(typeof t=="string")try{return OP(JSON.parse(t))}catch{}return null}function RP(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const r in t)RP(t[r],e);if(typeof t=="string")try{return RP(JSON.parse(t),e)}catch{}}}function n6e(t){const e=[];return RP(t,e),e}var em;class PS extends NJ{constructor(r,n,i){const s=Object.assign({},i??{},{batchMaxCount:1});ee(r&&r.request,"invalid EIP-1193 provider","ethereum",r);super(n,s);me(this,em);Z(this,em,async(o,a)=>{const c={method:o,params:a};this.emit("debug",{action:"sendEip1193Request",payload:c});try{const u=await r.request(c);return this.emit("debug",{action:"receiveEip1193Result",result:u}),u}catch(u){const l=new Error(u.message);throw l.code=u.code,l.data=u.data,l.payload=c,this.emit("debug",{action:"receiveEip1193Error",error:l}),l}})}async send(r,n){return await this._start(),await super.send(r,n)}async _send(r){ee(!Array.isArray(r),"EIP-1193 does not support batch request","payload",r);try{const n=await H(this,em).call(this,r.method,r.params||[]);return[{id:r.id,result:n}]}catch(n){return[{id:r.id,error:{code:n.code,data:n.data,message:n.message}}]}}getRpcError(r,n){switch(n=JSON.parse(JSON.stringify(n)),n.error.code||-1){case 4001:n.error.message=`ethers-user-denied: ${n.error.message}`;break;case 4200:n.error.message=`ethers-unsupported: ${n.error.message}`;break}return super.getRpcError(r,n)}async hasSigner(r){r==null&&(r=0);const n=await this.send("eth_accounts",[]);return typeof r=="number"?n.length>r:(r=r.toLowerCase(),n.filter(i=>i.toLowerCase()===r).length!==0)}async getSigner(r){if(r==null&&(r=0),!await this.hasSigner(r))try{await H(this,em).call(this,"eth_requestAccounts",[])}catch(n){const i=n.payload;throw this.getRpcError(i,{id:i.id,error:n})}return await super.getSigner(r)}}em=new WeakMap;const fg={hexStringToNumber(t){const e=t.startsWith("0x")?t.slice(2):t;return parseInt(e,16)},numberToHexString(t){return`0x${t.toString(16)}`},async getUserInfo(t){const[e,r]=await Promise.all([fg.getAddresses(t),fg.getChainId(t)]);return{chainId:r,addresses:e}},async getChainId(t){const e=await t.request({method:"eth_chainId"});return Number(e)},async getAddress(t){const[e]=await t.request({method:"eth_accounts"});return e},async getAddresses(t){return await t.request({method:"eth_accounts"})},async addEthereumChain(t,e){var n,i;const r=((n=e.rpcUrls.chainDefault)==null?void 0:n.http)||[];await t.request({method:"wallet_addEthereumChain",params:[{chainId:fg.numberToHexString(e.id),rpcUrls:[...r],chainName:e.name,nativeCurrency:{name:e.nativeCurrency.name,decimals:e.nativeCurrency.decimals,symbol:e.nativeCurrency.symbol},blockExplorerUrls:[(i=e.blockExplorers)==null?void 0:i.default.url],iconUrls:[Ua.NetworkImageIds[e.id]]}]})}},ph={signMessage:async(t,e,r)=>{if(!e)throw new Error("signMessage - provider is undefined");const n=vr(t)?t:Je(Za(t));return await e.request({method:"personal_sign",params:[n,r]})},estimateGas:async(t,e,r,n)=>{if(!e)throw new Error("estimateGas - provider is undefined");if(!r)throw new Error("estimateGas - address is undefined");if(t.chainNamespace&&t.chainNamespace!=="eip155")throw new Error("estimateGas - chainNamespace is not eip155");const i={from:t.address,to:t.to,data:t.data,type:0},s=new PS(e,n);return await new hg(s,r).estimateGas(i)},sendTransaction:async(t,e,r,n)=>{if(!e)throw new Error("sendTransaction - provider is undefined");if(!r)throw new Error("sendTransaction - address is undefined");if(t.chainNamespace&&t.chainNamespace!=="eip155")throw new Error("sendTransaction - chainNamespace is not eip155");const i={to:t.to,value:t.value,gasLimit:t.gas,gasPrice:t.gasPrice,data:t.data,type:0},s=new PS(e,n),c=await(await new hg(s,r).sendTransaction(i)).wait();return(c==null?void 0:c.hash)||null},writeContract:async(t,e,r,n)=>{if(!e)throw new Error("writeContract - provider is undefined");if(!r)throw new Error("writeContract - address is undefined");const i=new PS(e,n),s=new hg(i,r),o=new dg(t.tokenAddress,t.abi,s);if(!o||!t.method)throw new Error("Contract method is undefined");const a=o[t.method];if(a)return await a(...t.args);throw new Error("Contract method is undefined")},parseWalletCapabilities:t=>{try{return JSON.parse(t)}catch{throw new Error("Error parsing wallet capabilities")}},parseUnits:Z_e,formatUnits:XZ};class i6e extends LZ{constructor(){super({adapterType:_e.ADAPTER_TYPES.ETHERS,namespace:_e.CHAIN.EVM}),this.balancePromises={},this.providerHandlers=null}async createEthersConfig(e){if(!e.metadata)return;let r;function n(){if(r)return r;if(!(typeof window>"u")&&window.ethereum)return r=window.ethereum,r}async function i(){const{SafeProvider:a}=await ke(async()=>{const{SafeProvider:h}=await Promise.resolve().then(()=>O9e);return{SafeProvider:h}},void 0),{default:c}=await ke(async()=>{const{default:h}=await Promise.resolve().then(()=>H9e);return{default:h}},void 0),u=new c,l=await u.safe.getInfo(),d=new a(l,u);return await d.connect().catch(h=>{console.info("Failed to auto-connect to Safe:",h)}),d}async function s(){var a,c,u;try{const{createCoinbaseWalletSDK:l}=await ke(async()=>{const{createCoinbaseWalletSDK:h}=await Promise.resolve().then(()=>bOe);return{createCoinbaseWalletSDK:h}},void 0);return typeof window>"u"?void 0:l({appName:(a=e==null?void 0:e.metadata)==null?void 0:a.name,appLogoUrl:(c=e==null?void 0:e.metadata)==null?void 0:c.icons[0],appChainIds:((u=e.networks)==null?void 0:u.map(h=>h.id))||[1,84532],preference:{options:e.coinbasePreference??"all"}}).getProvider()}catch(l){console.error("Failed to import Coinbase Wallet SDK:",l);return}}const o={metadata:e.metadata};if(e.enableInjected!==!1&&(o.injected=n()),e.enableCoinbase!==!1){const a=await s();a&&(o.coinbase=a)}if(ue.isSafeApp()){const a=await i();a&&(o.safe=a)}return o.EIP6963=e.enableEIP6963!==!1,o}async signMessage(e){const{message:r,address:n,provider:i}=e;if(!i)throw new Error("Provider is undefined");try{return{signature:await ph.signMessage(r,i,n)}}catch{throw new Error("EthersAdapter:signMessage - Sign message failed")}}async sendTransaction(e){var n;if(!e.provider)throw new Error("Provider is undefined");return{hash:await ph.sendTransaction({value:Number.isNaN(Number(e.value))?BigInt(0):BigInt(e.value),to:e.to,data:e.data?e.data:"0x",gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,address:re.state.address},e.provider,re.state.address,Number((n=e.caipNetwork)==null?void 0:n.id))}}async writeContract(e){var i;if(!e.provider)throw new Error("Provider is undefined");const{address:r}=bs.parseCaipAddress(e.caipAddress);return{hash:await ph.writeContract(e,e.provider,r,Number((i=e.caipNetwork)==null?void 0:i.id))}}async estimateGas(e){const{provider:r,caipNetwork:n,address:i}=e;if(!r)throw new Error("Provider is undefined");try{return{gas:await ph.estimateGas({data:e.data,to:e.to,address:i},r,i,Number(n==null?void 0:n.id))}}catch{throw new Error("EthersAdapter:estimateGas - Estimate gas failed")}}parseUnits(e){return ph.parseUnits(e.value,e.decimals)}formatUnits(e){return ph.formatUnits(e.value,e.decimals)}async syncConnection(e){const{id:r,chainId:n}=e,i=this.connectors.find(c=>c.id===r),s=i==null?void 0:i.provider;if(!s)throw new Error("Provider not found");const o=await s.request({method:"eth_requestAccounts"}),a=await s.request({method:"eth_chainId"});if(this.listenProviderEvents(s),!o[0])throw new Error("No accounts found");if(!(i!=null&&i.type))throw new Error("Connector type not found");return{address:o[0],chainId:Number(a)||Number(n),provider:s,type:i.type,id:r}}async syncConnectors(e){var n;this.ethersConfig=await this.createEthersConfig(e),(n=this.ethersConfig)!=null&&n.EIP6963&&this.listenInjectedConnector(!0),Object.keys(this.ethersConfig||{}).filter(i=>i!=="metadata"&&i!=="EIP6963").forEach(i=>{var a,c;const s=i==="coinbase"?"coinbaseWalletSDK":i,o=i===_e.CONNECTOR_ID.INJECTED;this.namespace&&this.addConnector({id:s,explorerId:Ua.ConnectorExplorerIds[s],imageUrl:(a=e==null?void 0:e.connectorImages)==null?void 0:a[s],name:Ua.ConnectorNamesMap[s]||"Unknown",imageId:Ua.ConnectorImageIds[s],type:Ua.ConnectorTypesMap[s]??"EXTERNAL",info:o?void 0:{rdns:s},chain:this.namespace,chains:[],provider:(c=this.ethersConfig)==null?void 0:c[i]})})}setUniversalProvider(e){this.addConnector(new l7({provider:e,caipNetworks:this.getCaipNetworks(),namespace:"eip155"}))}eip6963EventHandler(e){var r;if(e.detail){const{info:n,provider:i}=e.detail;if(!((r=this.connectors)==null?void 0:r.find(o=>o.name===(n==null?void 0:n.name)))){const o=Ua.ConnectorTypesMap[_e.CONNECTOR_ID.EIP6963],a=(n==null?void 0:n.rdns)||(n==null?void 0:n.name)||(n==null?void 0:n.uuid);this.namespace&&a&&this.addConnector({id:a,type:o,imageUrl:n==null?void 0:n.icon,name:(n==null?void 0:n.name)||"Unknown",provider:i,info:n,chain:this.namespace,chains:[]})}}}listenInjectedConnector(e){if(typeof window<"u"&&e){const r=this.eip6963EventHandler.bind(this);window.addEventListener(Xt.EIP6963_ANNOUNCE_EVENT,r),window.dispatchEvent(new Event(Xt.EIP6963_REQUEST_EVENT))}}async connect({id:e,type:r,chainId:n,socialUri:i}){var u;const s=this.connectors.find(l=>l.id===e),o=s==null?void 0:s.provider;if(!o)throw new Error("Provider not found");let a=[],c;if(r==="AUTH"){const{address:l}=await o.connect({chainId:n,socialUri:i,preferredAccountType:(u=re.state.preferredAccountTypes)==null?void 0:u.eip155});a=[l],this.emit("accountChanged",{address:a[0],chainId:Number(n)})}else{if(a=await o.request({method:"eth_requestAccounts"}),c=await o.request({method:"eth_chainId"}),c!==n){const l=this.getCaipNetworks().find(d=>d.id===n);if(!l)throw new Error("EthersAdapter:connect - could not find the caipNetwork to switch");try{await this.switchNetwork({caipNetwork:l,provider:o,providerType:r})}catch{throw new Error("EthersAdapter:connect - Switch network failed")}}this.emit("accountChanged",{address:a[0],chainId:Number(n)}),this.listenProviderEvents(o)}return{address:a[0],chainId:Number(n),provider:o,type:r,id:e}}async reconnect(e){var s;const{id:r,chainId:n}=e,i=this.connectors.find(o=>o.id===r);i&&i.type==="AUTH"&&n&&await i.provider.connect({chainId:n,preferredAccountType:(s=re.state.preferredAccountTypes)==null?void 0:s.eip155})}async getAccounts(e){const r=this.connectors.find(s=>s.id===e.id),n=r==null?void 0:r.provider;if(!n||!r)throw new Error("Provider not found");if(e.id===_e.CONNECTOR_ID.AUTH){const s=r.provider;if(!s.user)return{accounts:[]};const{accounts:o,address:a}=s.user;return Promise.resolve({accounts:(o||[{address:a,type:"eoa"}]).map(c=>ue.createAccount("eip155",c.address,c.type))})}return{accounts:(await n.request({method:"eth_requestAccounts"})).map(s=>ue.createAccount("eip155",s,"eoa"))}}async disconnect(e){if(!e.provider||!e.providerType)throw new Error("Provider or providerType not provided");switch(e.providerType){case"WALLET_CONNECT":e.provider.session&&e.provider.disconnect();break;case"AUTH":await e.provider.disconnect();break;case"ANNOUNCED":case"EXTERNAL":await this.revokeProviderPermissions(e.provider);break;default:throw new Error("Unsupported provider type")}}async getBalance(e){const r=e.address,n=this.getCaipNetworks().find(i=>i.id===e.chainId);if(!r)return Promise.resolve({balance:"0.00",symbol:"ETH"});if(n&&n.chainNamespace==="eip155"){const i=`${n.caipNetworkId}:${r}`,s=this.balancePromises[i];if(s)return s;const o=Le.getNativeBalanceCacheForCaipAddress(i);if(o)return{balance:o.balance,symbol:o.symbol};const a=new r6e(n.rpcUrls.default.http[0],{chainId:n.id,name:n.name});if(a)try{return this.balancePromises[i]=new Promise(async c=>{const u=await a.getBalance(r),l=Y_e(u);Le.updateNativeBalanceCache({caipAddress:i,balance:l,symbol:n.nativeCurrency.symbol,timestamp:Date.now()}),c({balance:l,symbol:n.nativeCurrency.symbol})}).finally(()=>{delete this.balancePromises[i]}),this.balancePromises[i]||{balance:"0.00",symbol:"ETH"}}catch{return{balance:"0.00",symbol:"ETH"}}}return{balance:"0.00",symbol:"ETH"}}listenProviderEvents(e){const r=()=>{this.removeProviderListeners(e),this.emit("disconnect")},n=s=>{s.length>0?this.emit("accountChanged",{address:s[0]}):r()},i=s=>{const o=typeof s=="string"?fg.hexStringToNumber(s):Number(s);this.emit("switchNetwork",{chainId:o})};e.on("disconnect",r),e.on("accountsChanged",n),e.on("chainChanged",i),this.providerHandlers={disconnect:r,accountsChanged:n,chainChanged:i}}removeProviderListeners(e){this.providerHandlers&&(e.removeListener("disconnect",this.providerHandlers.disconnect),e.removeListener("accountsChanged",this.providerHandlers.accountsChanged),e.removeListener("chainChanged",this.providerHandlers.chainChanged),this.providerHandlers=null)}async switchNetwork(e){var s,o;const{caipNetwork:r,provider:n,providerType:i}=e;if(i==="AUTH"){await super.switchNetwork(e);return}try{await n.request({method:"wallet_switchEthereumChain",params:[{chainId:fg.numberToHexString(r.id)}]})}catch(a){if(a.code===wu.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||a.code===wu.ERROR_INVALID_CHAIN_ID||a.code===wu.ERROR_CODE_DEFAULT||((o=(s=a==null?void 0:a.data)==null?void 0:s.originalError)==null?void 0:o.code)===wu.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)await fg.addEthereumChain(n,r);else if(i==="ANNOUNCED"||i==="EXTERNAL"||i==="INJECTED")throw new Error("Chain is not supported")}}getWalletConnectProvider(){var e;return(e=this.connectors.find(r=>r.type==="WALLET_CONNECT"))==null?void 0:e.provider}async revokeProviderPermissions(e){try{(await e.request({method:"wallet_getPermissions"})).find(i=>i.parentCapability==="eth_accounts")&&await e.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]})}catch(r){console.info("Could not revoke permissions from wallet. Disconnecting...",r)}}async getCapabilities(e){var i,s;const r=kt.getProvider(_e.CHAIN.EVM);if(!r)throw new Error("Provider is undefined");const n=(s=(i=r.session)==null?void 0:i.sessionProperties)==null?void 0:s.capabilities;if(n){const a=ph.parseWalletCapabilities(n)[e];if(a)return a}return await r.request({method:"wallet_getCapabilities",params:[e]})}async grantPermissions(e){const r=kt.getProvider(_e.CHAIN.EVM);if(!r)throw new Error("Provider is undefined");return await r.request({method:"wallet_grantPermissions",params:e})}async revokePermissions(e){const r=kt.getProvider(_e.CHAIN.EVM);if(!r)throw new Error("Provider is undefined");return await r.request({method:"wallet_revokePermissions",params:[e]})}async walletGetAssets(e){const r=kt.getProvider(_e.CHAIN.EVM);if(!r)throw new Error("Provider is undefined");return await r.request({method:"wallet_getAssets",params:[e]})}}class N7{constructor(){ce(this,"appKit");ce(this,"config");ce(this,"_lastCallTime",0)}LOG(e){var r;(r=this.config)!=null&&r.logOpen&&console.log(e)}static create(e){const r=new N7;return e.projectId=e.projectId||"b56e18d47c72ab683b10814fe9495694",r.init(e),r}init(e){this.config=e;let r=[Gre];if(e.customNetworks)for(let i of e.customNetworks)r.push(Qm(i));let n=x_e({adapters:[new i6e],networks:r,projectId:e.projectId,themeMode:e.themeMode,themeVariables:{"--w3m-accent":"#000000"},features:e.features,allowUnsupportedChain:!0,defaultNetwork:e.defaultNetwork,metadata:e.metadata});this.initEvents(n,e),this.appKit=n}onAccountChange(e,r){this.config.onAccountChange(e,r)}onNetworkChange(e){this.config.onNetworkChange(e)}onProvidersChange(e){this.config.onProvidersChange(e)}initEvents(e){this.appKit=e;let r=this;e.subscribeAccount(r.onAccountChange.bind(r)),e.subscribeNetwork(r.onNetworkChange.bind(r)),e.subscribeProviders(r.onProvidersChange.bind(r))}async open(){await this.appKit.open()}async disconnect(){await this.appKit.disconnect()}async switchNetwork(e){await this.appKit.switchNetwork(e)}}window.PogAdapter=N7;function s6e(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const o6e=s6e(),a6e=Object.freeze(Object.defineProperty({__proto__:null,WebSocket:o6e},Symbol.toStringTag,{value:"Module"}));/**
- * @license
- * Copyright 2017 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */const c6e={attribute:!0,type:String,converter:LC,reflect:!1,hasChanged:c7},u6e=(t=c6e,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(s===void 0&&globalThis.litPropertyMetadata.set(i,s=new Map),n==="setter"&&((t=Object.create(t)).wrapped=!0),s.set(r.name,t),n==="accessor"){const{name:o}=r;return{set(a){const c=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,c,t)},init(a){return a!==void 0&&this.C(o,void 0,t,a),a}}}if(n==="setter"){const{name:o}=r;return function(a){const c=this[o];e.call(this,a),this.requestUpdate(o,c,t)}}throw Error("Unsupported decorator location: "+n)};function q(t){return(e,r)=>typeof r=="object"?u6e(t,e,r):((n,i,s)=>{const o=i.hasOwnProperty(s);return i.constructor.createProperty(s,n),o?Object.getOwnPropertyDescriptor(i,s):void 0})(t,e,r)}/**
- * @license
- * Copyright 2017 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */function G(t){return q({...t,state:!0,attribute:!1})}const l6e=de`
- div {
- width: 100%;
- }
- [data-ready='false'] {
- transform: scale(1.05);
- }
- @media (max-width: 430px) {
- [data-ready='false'] {
- transform: translateY(-50px);
- }
- }
- `;var $J=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const OS=600,qB=360,d6e=64;let Oy=class extends se{constructor(){super(),this.bodyObserver=void 0,this.unsubscribe=[],this.iframe=document.getElementById("w3m-iframe"),this.ready=!1,this.unsubscribe.push(We.subscribeKey("open",e=>{e||this.onHideIframe()}),We.subscribeKey("shake",e=>{e?this.iframe.style.animation="w3m-shake 500ms var(--wui-ease-out-power-2)":this.iframe.style.animation="none"}))}disconnectedCallback(){var e;this.onHideIframe(),this.unsubscribe.forEach(r=>r()),(e=this.bodyObserver)==null||e.unobserve(window.document.body)}async firstUpdated(){var r;await this.syncTheme(),this.iframe.style.display="block";const e=(r=this==null?void 0:this.renderRoot)==null?void 0:r.querySelector("div");this.bodyObserver=new ResizeObserver(n=>{var o,a;const i=(o=n==null?void 0:n[0])==null?void 0:o.contentBoxSize,s=(a=i==null?void 0:i[0])==null?void 0:a.inlineSize;this.iframe.style.height=`${OS}px`,e.style.height=`${OS}px`,s&&s<=430?(this.iframe.style.width="100%",this.iframe.style.left="0px",this.iframe.style.bottom="0px",this.iframe.style.top="unset"):(this.iframe.style.width=`${qB}px`,this.iframe.style.left=`calc(50% - ${qB/2}px)`,this.iframe.style.top=`calc(50% - ${OS/2}px + ${d6e/2}px)`,this.iframe.style.bottom="unset"),this.ready=!0,this.onShowIframe()}),this.bodyObserver.observe(window.document.body)}render(){return M`<div data-ready=${this.ready} id="w3m-frame-container"></div>`}onShowIframe(){const e=window.innerWidth<=430;this.iframe.style.animation=e?"w3m-iframe-zoom-in-mobile 200ms var(--wui-ease-out-power-2)":"w3m-iframe-zoom-in 200ms var(--wui-ease-out-power-2)"}onHideIframe(){this.iframe.style.display="none",this.iframe.style.animation="w3m-iframe-fade-out 200ms var(--wui-ease-out-power-2)"}async syncTheme(){const e=ge.getAuthConnector();if(e){const r=ar.getSnapshot().themeMode,n=ar.getSnapshot().themeVariables;await e.provider.syncTheme({themeVariables:n,w3mThemeVariables:za(n,r)})}}};Oy.styles=l6e;$J([G()],Oy.prototype,"ready",void 0);Oy=$J([te("w3m-approve-transaction-view")],Oy);/**
- * @license
- * Copyright 2020 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */const h6e=t=>t===null||typeof t!="object"&&typeof t!="function",f6e=t=>t.strings===void 0;/**
- * @license
- * Copyright 2017 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */const jJ={ATTRIBUTE:1,CHILD:2},$7=t=>(...e)=>({_$litDirective$:t,values:e});let BJ=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};/**
- * @license
- * Copyright 2017 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */const _b=(t,e)=>{var n;const r=t._$AN;if(r===void 0)return!1;for(const i of r)(n=i._$AO)==null||n.call(i,e,!1),_b(i,e);return!0},t6=t=>{let e,r;do{if((e=t._$AM)===void 0)break;r=e._$AN,r.delete(t),t=e}while((r==null?void 0:r.size)===0)},DJ=t=>{for(let e;e=t._$AM;t=e){let r=e._$AN;if(r===void 0)e._$AN=r=new Set;else if(r.has(t))break;r.add(t),m6e(e)}};function p6e(t){this._$AN!==void 0?(t6(this),this._$AM=t,DJ(this)):this._$AM=t}function g6e(t,e=!1,r=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let s=r;s<n.length;s++)_b(n[s],!1),t6(n[s]);else n!=null&&(_b(n,!1),t6(n));else _b(this,t)}const m6e=t=>{t.type==jJ.CHILD&&(t._$AP??(t._$AP=g6e),t._$AQ??(t._$AQ=p6e))};let MJ=class extends BJ{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,r,n){super._$AT(e,r,n),DJ(this),this.isConnected=e._$AU}_$AO(e,r=!0){var n,i;e!==this.isConnected&&(this.isConnected=e,e?(n=this.reconnected)==null||n.call(this):(i=this.disconnected)==null||i.call(this)),r&&(_b(this,e),t6(this))}setValue(e){if(f6e(this._$Ct))this._$Ct._$AI(e,this);else{const r=[...this._$Ct._$AH];r[this._$Ci]=e,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}};/**
- * @license
- * Copyright 2021 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */let w6e=class{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}},b6e=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??(this.Y=new Promise(e=>this.Z=e))}resume(){var e;(e=this.Z)==null||e.call(this),this.Y=this.Z=void 0}};/**
- * @license
- * Copyright 2017 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */const zB=t=>!h6e(t)&&typeof t.then=="function",WB=1073741823;let y6e=class extends MJ{constructor(){super(...arguments),this._$Cwt=WB,this._$Cbt=[],this._$CK=new w6e(this),this._$CX=new b6e}render(...e){return e.find(r=>!zB(r))??Ru}update(e,r){const n=this._$Cbt;let i=n.length;this._$Cbt=r;const s=this._$CK,o=this._$CX;this.isConnected||this.disconnected();for(let a=0;a<r.length&&!(a>this._$Cwt);a++){const c=r[a];if(!zB(c))return this._$Cwt=a,c;a<i&&c===n[a]||(this._$Cwt=WB,i=0,Promise.resolve(c).then(async u=>{for(;o.get();)await o.get();const l=s.deref();if(l!==void 0){const d=l._$Cbt.indexOf(c);d>-1&&d<l._$Cwt&&(l._$Cwt=d,l.setValue(u))}}))}return Ru}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}};const v6e=$7(y6e);class _6e{constructor(){this.cache=new Map}set(e,r){this.cache.set(e,r)}get(e){return this.cache.get(e)}has(e){return this.cache.has(e)}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}}const RS=new _6e,E6e=de`
- :host {
- display: flex;
- aspect-ratio: var(--local-aspect-ratio);
- color: var(--local-color);
- width: var(--local-width);
- }
- svg {
- width: inherit;
- height: inherit;
- object-fit: contain;
- object-position: center;
- }
- .fallback {
- width: var(--local-width);
- height: var(--local-height);
- }
- `;var Yv=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const VB={add:async()=>(await ke(async()=>{const{addSvg:t}=await Promise.resolve().then(()=>vOe);return{addSvg:t}},void 0)).addSvg,allWallets:async()=>(await ke(async()=>{const{allWalletsSvg:t}=await Promise.resolve().then(()=>EOe);return{allWalletsSvg:t}},void 0)).allWalletsSvg,arrowBottomCircle:async()=>(await ke(async()=>{const{arrowBottomCircleSvg:t}=await Promise.resolve().then(()=>AOe);return{arrowBottomCircleSvg:t}},void 0)).arrowBottomCircleSvg,appStore:async()=>(await ke(async()=>{const{appStoreSvg:t}=await Promise.resolve().then(()=>SOe);return{appStoreSvg:t}},void 0)).appStoreSvg,apple:async()=>(await ke(async()=>{const{appleSvg:t}=await Promise.resolve().then(()=>IOe);return{appleSvg:t}},void 0)).appleSvg,arrowBottom:async()=>(await ke(async()=>{const{arrowBottomSvg:t}=await Promise.resolve().then(()=>OOe);return{arrowBottomSvg:t}},void 0)).arrowBottomSvg,arrowLeft:async()=>(await ke(async()=>{const{arrowLeftSvg:t}=await Promise.resolve().then(()=>kOe);return{arrowLeftSvg:t}},void 0)).arrowLeftSvg,arrowRight:async()=>(await ke(async()=>{const{arrowRightSvg:t}=await Promise.resolve().then(()=>$Oe);return{arrowRightSvg:t}},void 0)).arrowRightSvg,arrowTop:async()=>(await ke(async()=>{const{arrowTopSvg:t}=await Promise.resolve().then(()=>BOe);return{arrowTopSvg:t}},void 0)).arrowTopSvg,bank:async()=>(await ke(async()=>{const{bankSvg:t}=await Promise.resolve().then(()=>MOe);return{bankSvg:t}},void 0)).bankSvg,browser:async()=>(await ke(async()=>{const{browserSvg:t}=await Promise.resolve().then(()=>UOe);return{browserSvg:t}},void 0)).browserSvg,card:async()=>(await ke(async()=>{const{cardSvg:t}=await Promise.resolve().then(()=>HOe);return{cardSvg:t}},void 0)).cardSvg,checkmark:async()=>(await ke(async()=>{const{checkmarkSvg:t}=await Promise.resolve().then(()=>zOe);return{checkmarkSvg:t}},void 0)).checkmarkSvg,checkmarkBold:async()=>(await ke(async()=>{const{checkmarkBoldSvg:t}=await Promise.resolve().then(()=>VOe);return{checkmarkBoldSvg:t}},void 0)).checkmarkBoldSvg,chevronBottom:async()=>(await ke(async()=>{const{chevronBottomSvg:t}=await Promise.resolve().then(()=>KOe);return{chevronBottomSvg:t}},void 0)).chevronBottomSvg,chevronLeft:async()=>(await ke(async()=>{const{chevronLeftSvg:t}=await Promise.resolve().then(()=>YOe);return{chevronLeftSvg:t}},void 0)).chevronLeftSvg,chevronRight:async()=>(await ke(async()=>{const{chevronRightSvg:t}=await Promise.resolve().then(()=>QOe);return{chevronRightSvg:t}},void 0)).chevronRightSvg,chevronTop:async()=>(await ke(async()=>{const{chevronTopSvg:t}=await Promise.resolve().then(()=>eRe);return{chevronTopSvg:t}},void 0)).chevronTopSvg,chromeStore:async()=>(await ke(async()=>{const{chromeStoreSvg:t}=await Promise.resolve().then(()=>rRe);return{chromeStoreSvg:t}},void 0)).chromeStoreSvg,clock:async()=>(await ke(async()=>{const{clockSvg:t}=await Promise.resolve().then(()=>iRe);return{clockSvg:t}},void 0)).clockSvg,close:async()=>(await ke(async()=>{const{closeSvg:t}=await Promise.resolve().then(()=>oRe);return{closeSvg:t}},void 0)).closeSvg,compass:async()=>(await ke(async()=>{const{compassSvg:t}=await Promise.resolve().then(()=>cRe);return{compassSvg:t}},void 0)).compassSvg,coinPlaceholder:async()=>(await ke(async()=>{const{coinPlaceholderSvg:t}=await Promise.resolve().then(()=>lRe);return{coinPlaceholderSvg:t}},void 0)).coinPlaceholderSvg,copy:async()=>(await ke(async()=>{const{copySvg:t}=await Promise.resolve().then(()=>hRe);return{copySvg:t}},void 0)).copySvg,cursor:async()=>(await ke(async()=>{const{cursorSvg:t}=await Promise.resolve().then(()=>pRe);return{cursorSvg:t}},void 0)).cursorSvg,cursorTransparent:async()=>(await ke(async()=>{const{cursorTransparentSvg:t}=await Promise.resolve().then(()=>mRe);return{cursorTransparentSvg:t}},void 0)).cursorTransparentSvg,desktop:async()=>(await ke(async()=>{const{desktopSvg:t}=await Promise.resolve().then(()=>bRe);return{desktopSvg:t}},void 0)).desktopSvg,disconnect:async()=>(await ke(async()=>{const{disconnectSvg:t}=await Promise.resolve().then(()=>vRe);return{disconnectSvg:t}},void 0)).disconnectSvg,discord:async()=>(await ke(async()=>{const{discordSvg:t}=await Promise.resolve().then(()=>ERe);return{discordSvg:t}},void 0)).discordSvg,etherscan:async()=>(await ke(async()=>{const{etherscanSvg:t}=await Promise.resolve().then(()=>ARe);return{etherscanSvg:t}},void 0)).etherscanSvg,extension:async()=>(await ke(async()=>{const{extensionSvg:t}=await Promise.resolve().then(()=>SRe);return{extensionSvg:t}},void 0)).extensionSvg,externalLink:async()=>(await ke(async()=>{const{externalLinkSvg:t}=await Promise.resolve().then(()=>IRe);return{externalLinkSvg:t}},void 0)).externalLinkSvg,facebook:async()=>(await ke(async()=>{const{facebookSvg:t}=await Promise.resolve().then(()=>ORe);return{facebookSvg:t}},void 0)).facebookSvg,farcaster:async()=>(await ke(async()=>{const{farcasterSvg:t}=await Promise.resolve().then(()=>kRe);return{farcasterSvg:t}},void 0)).farcasterSvg,filters:async()=>(await ke(async()=>{const{filtersSvg:t}=await Promise.resolve().then(()=>$Re);return{filtersSvg:t}},void 0)).filtersSvg,github:async()=>(await ke(async()=>{const{githubSvg:t}=await Promise.resolve().then(()=>BRe);return{githubSvg:t}},void 0)).githubSvg,google:async()=>(await ke(async()=>{const{googleSvg:t}=await Promise.resolve().then(()=>MRe);return{googleSvg:t}},void 0)).googleSvg,helpCircle:async()=>(await ke(async()=>{const{helpCircleSvg:t}=await Promise.resolve().then(()=>URe);return{helpCircleSvg:t}},void 0)).helpCircleSvg,image:async()=>(await ke(async()=>{const{imageSvg:t}=await Promise.resolve().then(()=>HRe);return{imageSvg:t}},void 0)).imageSvg,id:async()=>(await ke(async()=>{const{idSvg:t}=await Promise.resolve().then(()=>zRe);return{idSvg:t}},void 0)).idSvg,infoCircle:async()=>(await ke(async()=>{const{infoCircleSvg:t}=await Promise.resolve().then(()=>VRe);return{infoCircleSvg:t}},void 0)).infoCircleSvg,lightbulb:async()=>(await ke(async()=>{const{lightbulbSvg:t}=await Promise.resolve().then(()=>KRe);return{lightbulbSvg:t}},void 0)).lightbulbSvg,mail:async()=>(await ke(async()=>{const{mailSvg:t}=await Promise.resolve().then(()=>YRe);return{mailSvg:t}},void 0)).mailSvg,mobile:async()=>(await ke(async()=>{const{mobileSvg:t}=await Promise.resolve().then(()=>QRe);return{mobileSvg:t}},void 0)).mobileSvg,more:async()=>(await ke(async()=>{const{moreSvg:t}=await Promise.resolve().then(()=>eke);return{moreSvg:t}},void 0)).moreSvg,networkPlaceholder:async()=>(await ke(async()=>{const{networkPlaceholderSvg:t}=await Promise.resolve().then(()=>rke);return{networkPlaceholderSvg:t}},void 0)).networkPlaceholderSvg,nftPlaceholder:async()=>(await ke(async()=>{const{nftPlaceholderSvg:t}=await Promise.resolve().then(()=>ike);return{nftPlaceholderSvg:t}},void 0)).nftPlaceholderSvg,off:async()=>(await ke(async()=>{const{offSvg:t}=await Promise.resolve().then(()=>oke);return{offSvg:t}},void 0)).offSvg,playStore:async()=>(await ke(async()=>{const{playStoreSvg:t}=await Promise.resolve().then(()=>cke);return{playStoreSvg:t}},void 0)).playStoreSvg,plus:async()=>(await ke(async()=>{const{plusSvg:t}=await Promise.resolve().then(()=>lke);return{plusSvg:t}},void 0)).plusSvg,qrCode:async()=>(await ke(async()=>{const{qrCodeIcon:t}=await Promise.resolve().then(()=>hke);return{qrCodeIcon:t}},void 0)).qrCodeIcon,recycleHorizontal:async()=>(await ke(async()=>{const{recycleHorizontalSvg:t}=await Promise.resolve().then(()=>pke);return{recycleHorizontalSvg:t}},void 0)).recycleHorizontalSvg,refresh:async()=>(await ke(async()=>{const{refreshSvg:t}=await Promise.resolve().then(()=>mke);return{refreshSvg:t}},void 0)).refreshSvg,search:async()=>(await ke(async()=>{const{searchSvg:t}=await Promise.resolve().then(()=>bke);return{searchSvg:t}},void 0)).searchSvg,send:async()=>(await ke(async()=>{const{sendSvg:t}=await Promise.resolve().then(()=>vke);return{sendSvg:t}},void 0)).sendSvg,swapHorizontal:async()=>(await ke(async()=>{const{swapHorizontalSvg:t}=await Promise.resolve().then(()=>Eke);return{swapHorizontalSvg:t}},void 0)).swapHorizontalSvg,swapHorizontalMedium:async()=>(await ke(async()=>{const{swapHorizontalMediumSvg:t}=await Promise.resolve().then(()=>Ake);return{swapHorizontalMediumSvg:t}},void 0)).swapHorizontalMediumSvg,swapHorizontalBold:async()=>(await ke(async()=>{const{swapHorizontalBoldSvg:t}=await Promise.resolve().then(()=>Ske);return{swapHorizontalBoldSvg:t}},void 0)).swapHorizontalBoldSvg,swapHorizontalRoundedBold:async()=>(await ke(async()=>{const{swapHorizontalRoundedBoldSvg:t}=await Promise.resolve().then(()=>Ike);return{swapHorizontalRoundedBoldSvg:t}},void 0)).swapHorizontalRoundedBoldSvg,swapVertical:async()=>(await ke(async()=>{const{swapVerticalSvg:t}=await Promise.resolve().then(()=>Oke);return{swapVerticalSvg:t}},void 0)).swapVerticalSvg,telegram:async()=>(await ke(async()=>{const{telegramSvg:t}=await Promise.resolve().then(()=>kke);return{telegramSvg:t}},void 0)).telegramSvg,threeDots:async()=>(await ke(async()=>{const{threeDotsSvg:t}=await Promise.resolve().then(()=>$ke);return{threeDotsSvg:t}},void 0)).threeDotsSvg,twitch:async()=>(await ke(async()=>{const{twitchSvg:t}=await Promise.resolve().then(()=>Bke);return{twitchSvg:t}},void 0)).twitchSvg,twitter:async()=>(await ke(async()=>{const{xSvg:t}=await Promise.resolve().then(()=>VW);return{xSvg:t}},void 0)).xSvg,twitterIcon:async()=>(await ke(async()=>{const{twitterIconSvg:t}=await Promise.resolve().then(()=>Lke);return{twitterIconSvg:t}},void 0)).twitterIconSvg,verify:async()=>(await ke(async()=>{const{verifySvg:t}=await Promise.resolve().then(()=>Fke);return{verifySvg:t}},void 0)).verifySvg,verifyFilled:async()=>(await ke(async()=>{const{verifyFilledSvg:t}=await Promise.resolve().then(()=>qke);return{verifyFilledSvg:t}},void 0)).verifyFilledSvg,wallet:async()=>(await ke(async()=>{const{walletSvg:t}=await Promise.resolve().then(()=>Wke);return{walletSvg:t}},void 0)).walletSvg,walletConnect:async()=>(await ke(async()=>{const{walletConnectSvg:t}=await Promise.resolve().then(()=>VT);return{walletConnectSvg:t}},void 0)).walletConnectSvg,walletConnectLightBrown:async()=>(await ke(async()=>{const{walletConnectLightBrownSvg:t}=await Promise.resolve().then(()=>VT);return{walletConnectLightBrownSvg:t}},void 0)).walletConnectLightBrownSvg,walletConnectBrown:async()=>(await ke(async()=>{const{walletConnectBrownSvg:t}=await Promise.resolve().then(()=>VT);return{walletConnectBrownSvg:t}},void 0)).walletConnectBrownSvg,walletPlaceholder:async()=>(await ke(async()=>{const{walletPlaceholderSvg:t}=await Promise.resolve().then(()=>Yke);return{walletPlaceholderSvg:t}},void 0)).walletPlaceholderSvg,warningCircle:async()=>(await ke(async()=>{const{warningCircleSvg:t}=await Promise.resolve().then(()=>Qke);return{warningCircleSvg:t}},void 0)).warningCircleSvg,x:async()=>(await ke(async()=>{const{xSvg:t}=await Promise.resolve().then(()=>VW);return{xSvg:t}},void 0)).xSvg,info:async()=>(await ke(async()=>{const{infoSvg:t}=await Promise.resolve().then(()=>eNe);return{infoSvg:t}},void 0)).infoSvg,exclamationTriangle:async()=>(await ke(async()=>{const{exclamationTriangleSvg:t}=await Promise.resolve().then(()=>rNe);return{exclamationTriangleSvg:t}},void 0)).exclamationTriangleSvg,reown:async()=>(await ke(async()=>{const{reownSvg:t}=await Promise.resolve().then(()=>iNe);return{reownSvg:t}},void 0)).reownSvg};async function C6e(t){if(RS.has(t))return RS.get(t);const r=(VB[t]??VB.copy)();return RS.set(t,r),r}let Jf=class extends se{constructor(){super(...arguments),this.size="md",this.name="copy",this.color="fg-300",this.aspectRatio="1 / 1"}render(){return this.style.cssText=`
- --local-color: ${`var(--wui-color-${this.color});`}
- --local-width: ${`var(--wui-icon-size-${this.size});`}
- --local-aspect-ratio: ${this.aspectRatio}
- `,M`${v6e(C6e(this.name),M`<div class="fallback"></div>`)}`}};Jf.styles=[He,qv,E6e];Yv([q()],Jf.prototype,"size",void 0);Yv([q()],Jf.prototype,"name",void 0);Yv([q()],Jf.prototype,"color",void 0);Yv([q()],Jf.prototype,"aspectRatio",void 0);Jf=Yv([te("wui-icon")],Jf);const A6e=de`
- :host {
- display: block;
- width: var(--local-width);
- height: var(--local-height);
- }
- img {
- display: block;
- width: 100%;
- height: 100%;
- object-fit: cover;
- object-position: center center;
- border-radius: inherit;
- }
- `;var xA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Om=class extends se{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0}render(){return this.style.cssText=`
- --local-width: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"};
- --local-height: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"};
- `,M`<img src=${this.src} alt=${this.alt} @error=${this.handleImageError} />`}handleImageError(){this.dispatchEvent(new CustomEvent("onLoadError",{bubbles:!0,composed:!0}))}};Om.styles=[He,qv,A6e];xA([q()],Om.prototype,"src",void 0);xA([q()],Om.prototype,"alt",void 0);xA([q()],Om.prototype,"size",void 0);Om=xA([te("wui-image")],Om);/**
- * @license
- * Copyright 2018 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */const r6=$7(class extends BJ{constructor(t){var e;if(super(t),t.type!==jJ.ATTRIBUTE||t.name!=="class"||((e=t.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var n,i;if(this.st===void 0){this.st=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!((n=this.nt)!=null&&n.has(s))&&this.st.add(s);return this.render(e)}const r=t.element.classList;for(const s of this.st)s in e||(r.remove(s),this.st.delete(s));for(const s in e){const o=!!e[s];o===this.st.has(s)||(i=this.nt)!=null&&i.has(s)||(o?(r.add(s),this.st.add(s)):(r.remove(s),this.st.delete(s)))}return Ru}}),x6e=de`
- :host {
- display: inline-flex !important;
- }
- slot {
- width: 100%;
- display: inline-block;
- font-style: normal;
- font-family: var(--wui-font-family);
- font-feature-settings:
- 'tnum' on,
- 'lnum' on,
- 'case' on;
- line-height: 130%;
- font-weight: var(--wui-font-weight-regular);
- overflow: inherit;
- text-overflow: inherit;
- text-align: var(--local-align);
- color: var(--local-color);
- }
- .wui-line-clamp-1 {
- overflow: hidden;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 1;
- }
- .wui-line-clamp-2 {
- overflow: hidden;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- }
- .wui-font-medium-400 {
- font-size: var(--wui-font-size-medium);
- font-weight: var(--wui-font-weight-light);
- letter-spacing: var(--wui-letter-spacing-medium);
- }
- .wui-font-medium-600 {
- font-size: var(--wui-font-size-medium);
- letter-spacing: var(--wui-letter-spacing-medium);
- }
- .wui-font-title-600 {
- font-size: var(--wui-font-size-title);
- letter-spacing: var(--wui-letter-spacing-title);
- }
- .wui-font-title-6-600 {
- font-size: var(--wui-font-size-title-6);
- letter-spacing: var(--wui-letter-spacing-title-6);
- }
- .wui-font-mini-700 {
- font-size: var(--wui-font-size-mini);
- letter-spacing: var(--wui-letter-spacing-mini);
- text-transform: uppercase;
- }
- .wui-font-large-500,
- .wui-font-large-600,
- .wui-font-large-700 {
- font-size: var(--wui-font-size-large);
- letter-spacing: var(--wui-letter-spacing-large);
- }
- .wui-font-2xl-500,
- .wui-font-2xl-600,
- .wui-font-2xl-700 {
- font-size: var(--wui-font-size-2xl);
- letter-spacing: var(--wui-letter-spacing-2xl);
- }
- .wui-font-paragraph-400,
- .wui-font-paragraph-500,
- .wui-font-paragraph-600,
- .wui-font-paragraph-700 {
- font-size: var(--wui-font-size-paragraph);
- letter-spacing: var(--wui-letter-spacing-paragraph);
- }
- .wui-font-small-400,
- .wui-font-small-500,
- .wui-font-small-600 {
- font-size: var(--wui-font-size-small);
- letter-spacing: var(--wui-letter-spacing-small);
- }
- .wui-font-tiny-400,
- .wui-font-tiny-500,
- .wui-font-tiny-600 {
- font-size: var(--wui-font-size-tiny);
- letter-spacing: var(--wui-letter-spacing-tiny);
- }
- .wui-font-micro-700,
- .wui-font-micro-600 {
- font-size: var(--wui-font-size-micro);
- letter-spacing: var(--wui-letter-spacing-micro);
- text-transform: uppercase;
- }
- .wui-font-tiny-400,
- .wui-font-small-400,
- .wui-font-medium-400,
- .wui-font-paragraph-400 {
- font-weight: var(--wui-font-weight-light);
- }
- .wui-font-large-700,
- .wui-font-paragraph-700,
- .wui-font-micro-700,
- .wui-font-mini-700 {
- font-weight: var(--wui-font-weight-bold);
- }
- .wui-font-medium-600,
- .wui-font-medium-title-600,
- .wui-font-title-6-600,
- .wui-font-large-600,
- .wui-font-paragraph-600,
- .wui-font-small-600,
- .wui-font-tiny-600,
- .wui-font-micro-600 {
- font-weight: var(--wui-font-weight-medium);
- }
- :host([disabled]) {
- opacity: 0.4;
- }
- `;var Jv=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Qf=class extends se{constructor(){super(...arguments),this.variant="paragraph-500",this.color="fg-300",this.align="left",this.lineClamp=void 0}render(){const e={[`wui-font-${this.variant}`]:!0,[`wui-color-${this.color}`]:!0,[`wui-line-clamp-${this.lineClamp}`]:!!this.lineClamp};return this.style.cssText=`
- --local-align: ${this.align};
- --local-color: var(--wui-color-${this.color});
- `,M`<slot class=${r6(e)}></slot>`}};Qf.styles=[He,x6e];Jv([q()],Qf.prototype,"variant",void 0);Jv([q()],Qf.prototype,"color",void 0);Jv([q()],Qf.prototype,"align",void 0);Jv([q()],Qf.prototype,"lineClamp",void 0);Qf=Jv([te("wui-text")],Qf);const S6e=de`
- a {
- border: 1px solid var(--wui-color-gray-glass-010);
- border-radius: var(--wui-border-radius-3xl);
- }
- wui-image {
- border-radius: var(--wui-border-radius-3xl);
- overflow: hidden;
- }
- a.disabled > wui-icon:not(.image-icon),
- a.disabled > wui-image {
- filter: grayscale(1);
- }
- a[data-variant='fill'] {
- color: var(--wui-color-inverse-100);
- background-color: var(--wui-color-accent-100);
- }
- a[data-variant='shade'],
- a[data-variant='shadeSmall'] {
- background-color: transparent;
- background-color: var(--wui-color-gray-glass-010);
- color: var(--wui-color-fg-200);
- }
- a[data-variant='success'] {
- column-gap: var(--wui-spacing-xxs);
- border: 1px solid var(--wui-color-success-glass-010);
- background-color: var(--wui-color-success-glass-010);
- color: var(--wui-color-success-100);
- }
- a[data-variant='error'] {
- column-gap: var(--wui-spacing-xxs);
- border: 1px solid var(--wui-color-error-glass-010);
- background-color: var(--wui-color-error-glass-010);
- color: var(--wui-color-error-100);
- }
- a[data-variant='transparent'] {
- column-gap: var(--wui-spacing-xxs);
- background-color: transparent;
- color: var(--wui-color-fg-150);
- }
- a[data-variant='transparent'],
- a[data-variant='success'],
- a[data-variant='shadeSmall'],
- a[data-variant='error'] {
- padding: 7px var(--wui-spacing-s) 7px 10px;
- }
- a[data-variant='transparent']:has(wui-text:first-child),
- a[data-variant='success']:has(wui-text:first-child),
- a[data-variant='shadeSmall']:has(wui-text:first-child),
- a[data-variant='error']:has(wui-text:first-child) {
- padding: 7px var(--wui-spacing-s);
- }
- a[data-variant='fill'],
- a[data-variant='shade'] {
- column-gap: var(--wui-spacing-xs);
- padding: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-xxs)
- var(--wui-spacing-xs);
- }
- a[data-variant='fill']:has(wui-text:first-child),
- a[data-variant='shade']:has(wui-text:first-child) {
- padding: 9px var(--wui-spacing-m) 9px var(--wui-spacing-m);
- }
- a[data-variant='fill'] > wui-image,
- a[data-variant='shade'] > wui-image {
- width: 24px;
- height: 24px;
- }
- a[data-variant='fill'] > wui-image {
- box-shadow: inset 0 0 0 1px var(--wui-color-accent-090);
- }
- a[data-variant='shade'] > wui-image,
- a[data-variant='shadeSmall'] > wui-image {
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
- }
- a[data-variant='fill'] > wui-icon:not(.image-icon),
- a[data-variant='shade'] > wui-icon:not(.image-icon) {
- width: 14px;
- height: 14px;
- }
- a[data-variant='transparent'] > wui-image,
- a[data-variant='success'] > wui-image,
- a[data-variant='shadeSmall'] > wui-image,
- a[data-variant='error'] > wui-image {
- width: 14px;
- height: 14px;
- }
- a[data-variant='transparent'] > wui-icon:not(.image-icon),
- a[data-variant='success'] > wui-icon:not(.image-icon),
- a[data-variant='shadeSmall'] > wui-icon:not(.image-icon),
- a[data-variant='error'] > wui-icon:not(.image-icon) {
- width: 12px;
- height: 12px;
- }
- a[data-variant='fill']:focus-visible {
- background-color: var(--wui-color-accent-090);
- }
- a[data-variant='shade']:focus-visible,
- a[data-variant='shadeSmall']:focus-visible {
- background-color: var(--wui-color-gray-glass-015);
- }
- a[data-variant='transparent']:focus-visible {
- background-color: var(--wui-color-gray-glass-005);
- }
- a[data-variant='success']:focus-visible {
- background-color: var(--wui-color-success-glass-015);
- }
- a[data-variant='error']:focus-visible {
- background-color: var(--wui-color-error-glass-015);
- }
- a.disabled {
- color: var(--wui-color-gray-glass-015);
- background-color: var(--wui-color-gray-glass-015);
- pointer-events: none;
- }
- @media (hover: hover) and (pointer: fine) {
- a[data-variant='fill']:hover {
- background-color: var(--wui-color-accent-090);
- }
- a[data-variant='shade']:hover,
- a[data-variant='shadeSmall']:hover {
- background-color: var(--wui-color-gray-glass-015);
- }
- a[data-variant='transparent']:hover {
- background-color: var(--wui-color-gray-glass-005);
- }
- a[data-variant='success']:hover {
- background-color: var(--wui-color-success-glass-015);
- }
- a[data-variant='error']:hover {
- background-color: var(--wui-color-error-glass-015);
- }
- }
- a[data-variant='fill']:active {
- background-color: var(--wui-color-accent-080);
- }
- a[data-variant='shade']:active,
- a[data-variant='shadeSmall']:active {
- background-color: var(--wui-color-gray-glass-020);
- }
- a[data-variant='transparent']:active {
- background-color: var(--wui-color-gray-glass-010);
- }
- a[data-variant='success']:active {
- background-color: var(--wui-color-success-glass-020);
- }
- a[data-variant='error']:active {
- background-color: var(--wui-color-error-glass-020);
- }
- `;var Ku=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Go=class extends se{constructor(){super(...arguments),this.variant="fill",this.imageSrc=void 0,this.imageIcon=void 0,this.imageIconSize="md",this.disabled=!1,this.icon="externalLink",this.href="",this.text=void 0}render(){const r=this.variant==="success"||this.variant==="transparent"||this.variant==="shadeSmall"?"small-600":"paragraph-600";return M`
- <a
- rel="noreferrer"
- target="_blank"
- href=${this.href}
- class=${this.disabled?"disabled":""}
- data-variant=${this.variant}
- >
- ${this.imageTemplate()}
- <wui-text variant=${r} color="inherit">
- ${this.title?this.title:nt.getHostName(this.href)}
- </wui-text>
- <wui-icon name=${this.icon} color="inherit" size="inherit"></wui-icon>
- </a>
- `}imageTemplate(){return this.imageSrc?M`<wui-image src=${this.imageSrc}></wui-image>`:this.imageIcon?M`<wui-icon
- name=${this.imageIcon}
- color="inherit"
- size=${this.imageIconSize}
- class="image-icon"
- ></wui-icon>`:null}};Go.styles=[He,vt,S6e];Ku([q()],Go.prototype,"variant",void 0);Ku([q()],Go.prototype,"imageSrc",void 0);Ku([q()],Go.prototype,"imageIcon",void 0);Ku([q()],Go.prototype,"imageIconSize",void 0);Ku([q({type:Boolean})],Go.prototype,"disabled",void 0);Ku([q()],Go.prototype,"icon",void 0);Ku([q()],Go.prototype,"href",void 0);Ku([q()],Go.prototype,"text",void 0);Go=Ku([te("wui-chip")],Go);const T6e=de`
- :host {
- display: flex;
- width: inherit;
- height: inherit;
- }
- `;var ks=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let xi=class extends se{render(){return this.style.cssText=`
- flex-direction: ${this.flexDirection};
- flex-wrap: ${this.flexWrap};
- flex-basis: ${this.flexBasis};
- flex-grow: ${this.flexGrow};
- flex-shrink: ${this.flexShrink};
- align-items: ${this.alignItems};
- justify-content: ${this.justifyContent};
- column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`};
- row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`};
- gap: ${this.gap&&`var(--wui-spacing-${this.gap})`};
- padding-top: ${this.padding&&nt.getSpacingStyles(this.padding,0)};
- padding-right: ${this.padding&&nt.getSpacingStyles(this.padding,1)};
- padding-bottom: ${this.padding&&nt.getSpacingStyles(this.padding,2)};
- padding-left: ${this.padding&&nt.getSpacingStyles(this.padding,3)};
- margin-top: ${this.margin&&nt.getSpacingStyles(this.margin,0)};
- margin-right: ${this.margin&&nt.getSpacingStyles(this.margin,1)};
- margin-bottom: ${this.margin&&nt.getSpacingStyles(this.margin,2)};
- margin-left: ${this.margin&&nt.getSpacingStyles(this.margin,3)};
- `,M`<slot></slot>`}};xi.styles=[He,T6e];ks([q()],xi.prototype,"flexDirection",void 0);ks([q()],xi.prototype,"flexWrap",void 0);ks([q()],xi.prototype,"flexBasis",void 0);ks([q()],xi.prototype,"flexGrow",void 0);ks([q()],xi.prototype,"flexShrink",void 0);ks([q()],xi.prototype,"alignItems",void 0);ks([q()],xi.prototype,"justifyContent",void 0);ks([q()],xi.prototype,"columnGap",void 0);ks([q()],xi.prototype,"rowGap",void 0);ks([q()],xi.prototype,"gap",void 0);ks([q()],xi.prototype,"padding",void 0);ks([q()],xi.prototype,"margin",void 0);xi=ks([te("wui-flex")],xi);var I6e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let kP=class extends se{render(){return M`
- <wui-flex flexDirection="column" alignItems="center" gap="xl" padding="xl">
- <wui-text variant="paragraph-400" color="fg-100">Follow the instructions on</wui-text>
- <wui-chip
- icon="externalLink"
- variant="fill"
- href=${ct.SECURE_SITE_DASHBOARD}
- imageSrc=${ct.SECURE_SITE_FAVICON}
- data-testid="w3m-secure-website-button"
- >
- </wui-chip>
- <wui-text variant="small-400" color="fg-200">
- You will have to reconnect for security reasons
- </wui-text>
- </wui-flex>
- `}};kP=I6e([te("w3m-upgrade-wallet-view")],kP);/**
- * @license
- * Copyright 2020 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */const ec=()=>new P6e;let P6e=class{};const kS=new WeakMap,tc=$7(class extends MJ{render(t){return Jr}update(t,[e]){var n;const r=e!==this.G;return r&&this.G!==void 0&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.G=e,this.ht=(n=t.options)==null?void 0:n.host,this.rt(this.ct=t.element)),Jr}rt(t){if(this.isConnected||(t=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let r=kS.get(e);r===void 0&&(r=new WeakMap,kS.set(e,r)),r.get(this.G)!==void 0&&this.G.call(this.ht,void 0),r.set(this.G,t),t!==void 0&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){var t,e;return typeof this.G=="function"?(t=kS.get(this.ht??globalThis))==null?void 0:t.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/**
- * @license
- * Copyright 2018 Google LLC
- * SPDX-License-Identifier: BSD-3-Clause
- */const we=t=>t??Jr,O6e=de`
- :host {
- display: flex;
- }
- :host([data-size='sm']) > svg {
- width: 12px;
- height: 12px;
- }
- :host([data-size='md']) > svg {
- width: 16px;
- height: 16px;
- }
- :host([data-size='lg']) > svg {
- width: 24px;
- height: 24px;
- }
- :host([data-size='xl']) > svg {
- width: 32px;
- height: 32px;
- }
- svg {
- animation: rotate 2s linear infinite;
- }
- circle {
- fill: none;
- stroke: var(--local-color);
- stroke-width: 4px;
- stroke-dasharray: 1, 124;
- stroke-dashoffset: 0;
- stroke-linecap: round;
- animation: dash 1.5s ease-in-out infinite;
- }
- :host([data-size='md']) > svg > circle {
- stroke-width: 6px;
- }
- :host([data-size='sm']) > svg > circle {
- stroke-width: 8px;
- }
- @keyframes rotate {
- 100% {
- transform: rotate(360deg);
- }
- }
- @keyframes dash {
- 0% {
- stroke-dasharray: 1, 124;
- stroke-dashoffset: 0;
- }
- 50% {
- stroke-dasharray: 90, 124;
- stroke-dashoffset: -35;
- }
- 100% {
- stroke-dashoffset: -125;
- }
- }
- `;var j7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Ry=class extends se{constructor(){super(...arguments),this.color="accent-100",this.size="lg"}render(){return this.style.cssText=`--local-color: ${this.color==="inherit"?"inherit":`var(--wui-color-${this.color})`}`,this.dataset.size=this.size,M`<svg viewBox="25 25 50 50">
- <circle r="20" cy="50" cx="50"></circle>
- </svg>`}};Ry.styles=[He,O6e];j7([q()],Ry.prototype,"color",void 0);j7([q()],Ry.prototype,"size",void 0);Ry=j7([te("wui-loading-spinner")],Ry);const R6e=de`
- :host {
- position: relative;
- width: 100%;
- display: inline-block;
- color: var(--wui-color-fg-275);
- }
- input {
- width: 100%;
- border-radius: var(--wui-border-radius-xs);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
- background: var(--wui-color-gray-glass-002);
- font-size: var(--wui-font-size-paragraph);
- letter-spacing: var(--wui-letter-spacing-paragraph);
- color: var(--wui-color-fg-100);
- transition:
- background-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
- border-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
- box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md);
- will-change: background-color, border-color, box-shadow;
- caret-color: var(--wui-color-accent-100);
- }
- input:disabled {
- cursor: not-allowed;
- border: 1px solid var(--wui-color-gray-glass-010);
- }
- input:disabled::placeholder,
- input:disabled + wui-icon {
- color: var(--wui-color-fg-300);
- }
- input::placeholder {
- color: var(--wui-color-fg-275);
- }
- input:focus:enabled {
- background-color: var(--wui-color-gray-glass-005);
- -webkit-box-shadow:
- inset 0 0 0 1px var(--wui-color-accent-100),
- 0px 0px 0px 4px var(--wui-box-shadow-blue);
- -moz-box-shadow:
- inset 0 0 0 1px var(--wui-color-accent-100),
- 0px 0px 0px 4px var(--wui-box-shadow-blue);
- box-shadow:
- inset 0 0 0 1px var(--wui-color-accent-100),
- 0px 0px 0px 4px var(--wui-box-shadow-blue);
- }
- input:hover:enabled {
- background-color: var(--wui-color-gray-glass-005);
- }
- wui-icon {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- pointer-events: none;
- }
- .wui-size-sm {
- padding: 9px var(--wui-spacing-m) 10px var(--wui-spacing-s);
- }
- wui-icon + .wui-size-sm {
- padding: 9px var(--wui-spacing-m) 10px 36px;
- }
- wui-icon[data-input='sm'] {
- left: var(--wui-spacing-s);
- }
- .wui-size-md {
- padding: 15px var(--wui-spacing-m) var(--wui-spacing-l) var(--wui-spacing-m);
- }
- wui-icon + .wui-size-md,
- wui-loading-spinner + .wui-size-md {
- padding: 10.5px var(--wui-spacing-3xl) 10.5px var(--wui-spacing-3xl);
- }
- wui-icon[data-input='md'] {
- left: var(--wui-spacing-l);
- }
- .wui-size-lg {
- padding: var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-l);
- letter-spacing: var(--wui-letter-spacing-medium-title);
- font-size: var(--wui-font-size-medium-title);
- font-weight: var(--wui-font-weight-light);
- line-height: 130%;
- color: var(--wui-color-fg-100);
- height: 64px;
- }
- .wui-padding-right-xs {
- padding-right: var(--wui-spacing-xs);
- }
- .wui-padding-right-s {
- padding-right: var(--wui-spacing-s);
- }
- .wui-padding-right-m {
- padding-right: var(--wui-spacing-m);
- }
- .wui-padding-right-l {
- padding-right: var(--wui-spacing-l);
- }
- .wui-padding-right-xl {
- padding-right: var(--wui-spacing-xl);
- }
- .wui-padding-right-2xl {
- padding-right: var(--wui-spacing-2xl);
- }
- .wui-padding-right-3xl {
- padding-right: var(--wui-spacing-3xl);
- }
- .wui-padding-right-4xl {
- padding-right: var(--wui-spacing-4xl);
- }
- .wui-padding-right-5xl {
- padding-right: var(--wui-spacing-5xl);
- }
- wui-icon + .wui-size-lg,
- wui-loading-spinner + .wui-size-lg {
- padding-left: 50px;
- }
- wui-icon[data-input='lg'] {
- left: var(--wui-spacing-l);
- }
- .wui-size-mdl {
- padding: 17.25px var(--wui-spacing-m) 17.25px var(--wui-spacing-m);
- }
- wui-icon + .wui-size-mdl,
- wui-loading-spinner + .wui-size-mdl {
- padding: 17.25px var(--wui-spacing-3xl) 17.25px 40px;
- }
- wui-icon[data-input='mdl'] {
- left: var(--wui-spacing-m);
- }
- input:placeholder-shown ~ ::slotted(wui-input-element),
- input:placeholder-shown ~ ::slotted(wui-icon) {
- opacity: 0;
- pointer-events: none;
- }
- input::-webkit-outer-spin-button,
- input::-webkit-inner-spin-button {
- -webkit-appearance: none;
- margin: 0;
- }
- input[type='number'] {
- -moz-appearance: textfield;
- }
- ::slotted(wui-input-element),
- ::slotted(wui-icon) {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- }
- ::slotted(wui-input-element) {
- right: var(--wui-spacing-m);
- }
- ::slotted(wui-icon) {
- right: 0px;
- }
- `;var uc=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let no=class extends se{constructor(){super(...arguments),this.inputElementRef=ec(),this.size="md",this.disabled=!1,this.placeholder="",this.type="text",this.value=""}render(){const e=`wui-padding-right-${this.inputRightPadding}`,n={[`wui-size-${this.size}`]:!0,[e]:!!this.inputRightPadding};return M`${this.templateIcon()}
- <input
- data-testid="wui-input-text"
- ${tc(this.inputElementRef)}
- class=${r6(n)}
- type=${this.type}
- enterkeyhint=${we(this.enterKeyHint)}
- ?disabled=${this.disabled}
- placeholder=${this.placeholder}
- @input=${this.dispatchInputChangeEvent.bind(this)}
- .value=${this.value||""}
- tabindex=${we(this.tabIdx)}
- />
- <slot></slot>`}templateIcon(){return this.icon?M`<wui-icon
- data-input=${this.size}
- size=${this.size}
- color="inherit"
- name=${this.icon}
- ></wui-icon>`:null}dispatchInputChangeEvent(){var e;this.dispatchEvent(new CustomEvent("inputChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.value,bubbles:!0,composed:!0}))}};no.styles=[He,vt,R6e];uc([q()],no.prototype,"size",void 0);uc([q()],no.prototype,"icon",void 0);uc([q({type:Boolean})],no.prototype,"disabled",void 0);uc([q()],no.prototype,"placeholder",void 0);uc([q()],no.prototype,"type",void 0);uc([q()],no.prototype,"keyHint",void 0);uc([q()],no.prototype,"value",void 0);uc([q()],no.prototype,"inputRightPadding",void 0);uc([q()],no.prototype,"tabIdx",void 0);no=uc([te("wui-input-text")],no);const k6e=de`
- :host {
- position: relative;
- width: 100%;
- display: inline-block;
- color: var(--wui-color-fg-275);
- }
- .error {
- margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m);
- }
- .base-name {
- position: absolute;
- right: 45px;
- top: 15px;
- text-align: right;
- }
- `;var Qv=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Xf=class extends se{constructor(){super(...arguments),this.disabled=!1,this.loading=!1}render(){return M`
- <wui-input-text
- value=${we(this.value)}
- ?disabled=${this.disabled}
- .value=${this.value||""}
- data-testid="wui-ens-input"
- inputRightPadding="5xl"
- >
- ${this.baseNameTemplate()} ${this.errorTemplate()}${this.loadingTemplate()}
- </wui-input-text>
- `}baseNameTemplate(){return M`<wui-text variant="paragraph-400" color="fg-200" class="base-name">
- ${_e.WC_NAME_SUFFIX}
- </wui-text>`}loadingTemplate(){return this.loading?M`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>`:null}errorTemplate(){return this.errorMessage?M`<wui-text variant="tiny-500" color="error-100" class="error"
- >${this.errorMessage}</wui-text
- >`:null}};Xf.styles=[He,k6e];Qv([q()],Xf.prototype,"errorMessage",void 0);Qv([q({type:Boolean})],Xf.prototype,"disabled",void 0);Qv([q()],Xf.prototype,"value",void 0);Qv([q({type:Boolean})],Xf.prototype,"loading",void 0);Xf=Qv([te("wui-ens-input")],Xf);const N6e=de`
- button {
- border-radius: var(--local-border-radius);
- color: var(--wui-color-fg-100);
- padding: var(--local-padding);
- }
- @media (max-width: 700px) {
- button {
- padding: var(--wui-spacing-s);
- }
- }
- button > wui-icon {
- pointer-events: none;
- }
- button:disabled > wui-icon {
- color: var(--wui-color-bg-300) !important;
- }
- button:disabled {
- background-color: transparent;
- }
- `;var Xv=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let ep=class extends se{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="inherit"}render(){const e=this.size==="lg"?"--wui-border-radius-xs":"--wui-border-radius-xxs",r=this.size==="lg"?"--wui-spacing-1xs":"--wui-spacing-2xs";return this.style.cssText=`
- --local-border-radius: var(${e});
- --local-padding: var(${r});
- `,M`
- <button ?disabled=${this.disabled}>
- <wui-icon color=${this.iconColor} size=${this.size} name=${this.icon}></wui-icon>
- </button>
- `}};ep.styles=[He,vt,qv,N6e];Xv([q()],ep.prototype,"size",void 0);Xv([q({type:Boolean})],ep.prototype,"disabled",void 0);Xv([q()],ep.prototype,"icon",void 0);Xv([q()],ep.prototype,"iconColor",void 0);ep=Xv([te("wui-icon-link")],ep);const $6e=de`
- :host {
- display: flex;
- justify-content: center;
- align-items: center;
- height: var(--wui-spacing-m);
- padding: 0 var(--wui-spacing-3xs) !important;
- border-radius: var(--wui-border-radius-5xs);
- transition:
- border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1),
- background-color var(--wui-duration-lg) var(--wui-ease-out-power-1);
- will-change: border-radius, background-color;
- }
- :host > wui-text {
- transform: translateY(5%);
- }
- :host([data-variant='main']) {
- background-color: var(--wui-color-accent-glass-015);
- color: var(--wui-color-accent-100);
- }
- :host([data-variant='shade']) {
- background-color: var(--wui-color-gray-glass-010);
- color: var(--wui-color-fg-200);
- }
- :host([data-variant='success']) {
- background-color: var(--wui-icon-box-bg-success-100);
- color: var(--wui-color-success-100);
- }
- :host([data-variant='error']) {
- background-color: var(--wui-icon-box-bg-error-100);
- color: var(--wui-color-error-100);
- }
- :host([data-size='lg']) {
- padding: 11px 5px !important;
- }
- :host([data-size='lg']) > wui-text {
- transform: translateY(2%);
- }
- `;var B7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let ky=class extends se{constructor(){super(...arguments),this.variant="main",this.size="lg"}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;const e=this.size==="md"?"mini-700":"micro-700";return M`
- <wui-text data-variant=${this.variant} variant=${e} color="inherit">
- <slot></slot>
- </wui-text>
- `}};ky.styles=[He,$6e];B7([q()],ky.prototype,"variant",void 0);B7([q()],ky.prototype,"size",void 0);ky=B7([te("wui-tag")],ky);const j6e=de`
- wui-flex {
- width: 100%;
- }
- .suggestion {
- background: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xs);
- }
- .suggestion:hover {
- background-color: var(--wui-color-gray-glass-005);
- cursor: pointer;
- }
- .suggested-name {
- max-width: 75%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- form {
- width: 100%;
- }
- wui-icon-link {
- position: absolute;
- right: 20px;
- transform: translateY(11px);
- }
- `;var Dd=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Ko=class extends se{constructor(){super(),this.formRef=ec(),this.usubscribe=[],this.name="",this.error="",this.loading=ys.state.loading,this.suggestions=ys.state.suggestions,this.registered=!1,this.profileName=re.state.profileName,this.onDebouncedNameInputChange=ue.debounce(e=>{ys.validateName(e)?(this.error="",this.name=e,ys.getSuggestions(e),ys.isNameRegistered(e).then(r=>{this.registered=r})):e.length<4?this.error="Name must be at least 4 characters long":this.error="Can only contain letters, numbers and - characters"}),this.usubscribe.push(ys.subscribe(e=>{this.suggestions=e.suggestions,this.loading=e.loading}),re.subscribeKey("profileName",e=>{this.profileName=e,e&&(this.error="You already own a name")}))}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",this.onEnterKey.bind(this))}disconnectedCallback(){var e;super.disconnectedCallback(),this.usubscribe.forEach(r=>r()),(e=this.formRef.value)==null||e.removeEventListener("keydown",this.onEnterKey.bind(this))}render(){return M`
- <wui-flex
- flexDirection="column"
- alignItems="center"
- gap="m"
- .padding=${["0","s","m","s"]}
- >
- <form ${tc(this.formRef)} @submit=${this.onSubmitName.bind(this)}>
- <wui-ens-input
- @inputChange=${this.onNameInputChange.bind(this)}
- .errorMessage=${this.error}
- .value=${this.name}
- >
- </wui-ens-input>
- ${this.submitButtonTemplate()}
- <input type="submit" hidden />
- </form>
- ${this.templateSuggestions()}
- </wui-flex>
- `}submitButtonTemplate(){return this.isAllowedToSubmit()?M`
- <wui-icon-link
- size="sm"
- icon="chevronRight"
- iconcolor="accent-100"
- @click=${this.onSubmitName.bind(this)}
- >
- </wui-icon-link>
- `:null}onSelectSuggestion(e){return()=>{this.name=e,this.registered=!1,this.requestUpdate()}}onNameInputChange(e){this.onDebouncedNameInputChange(e.detail)}nameSuggestionTagTemplate(){return this.loading?M`<wui-loading-spinner size="lg" color="fg-100"></wui-loading-spinner>`:this.registered?M`<wui-tag variant="shade" size="lg">Registered</wui-tag>`:M`<wui-tag variant="success" size="lg">Available</wui-tag>`}templateSuggestions(){if(!this.name||this.name.length<4||this.error)return null;const e=this.registered?this.suggestions.filter(r=>r.name!==this.name):[];return M`<wui-flex flexDirection="column" gap="xxs" alignItems="center">
- <wui-flex
- data-testid="account-name-suggestion"
- .padding=${["m","m","m","m"]}
- justifyContent="space-between"
- class="suggestion"
- @click=${this.onSubmitName.bind(this)}
- >
- <wui-text color="fg-100" variant="paragraph-400" class="suggested-name">
- ${this.name}</wui-text
- >${this.nameSuggestionTagTemplate()}
- </wui-flex>
- ${e.map(r=>this.availableNameTemplate(r.name))}
- </wui-flex>`}availableNameTemplate(e){return M` <wui-flex
- data-testid="account-name-suggestion"
- .padding=${["m","m","m","m"]}
- justifyContent="space-between"
- class="suggestion"
- @click=${this.onSelectSuggestion(e)}
- >
- <wui-text color="fg-100" variant="paragraph-400" class="suggested-name">
- ${e}
- </wui-text>
- <wui-tag variant="success" size="lg">Available</wui-tag>
- </wui-flex>`}isAllowedToSubmit(){return!this.loading&&!this.registered&&!this.error&&!this.profileName&&ys.validateName(this.name)}async onSubmitName(){var r,n,i;const e=F.state.activeChain;try{if(!this.isAllowedToSubmit())return;const s=`${this.name}${_e.WC_NAME_SUFFIX}`;Re.sendEvent({type:"track",event:"REGISTER_NAME_INITIATED",properties:{isSmartAccount:((r=re.state.preferredAccountTypes)==null?void 0:r[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:s}}),await ys.registerName(s),Re.sendEvent({type:"track",event:"REGISTER_NAME_SUCCESS",properties:{isSmartAccount:((n=re.state.preferredAccountTypes)==null?void 0:n[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:s}})}catch(s){Fe.showError(s.message),Re.sendEvent({type:"track",event:"REGISTER_NAME_ERROR",properties:{isSmartAccount:((i=re.state.preferredAccountTypes)==null?void 0:i[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:`${this.name}${_e.WC_NAME_SUFFIX}`,error:(s==null?void 0:s.message)||"Unknown error"}})}}onEnterKey(e){e.key==="Enter"&&this.isAllowedToSubmit()&&this.onSubmitName()}};Ko.styles=j6e;Dd([q()],Ko.prototype,"errorMessage",void 0);Dd([G()],Ko.prototype,"name",void 0);Dd([G()],Ko.prototype,"error",void 0);Dd([G()],Ko.prototype,"loading",void 0);Dd([G()],Ko.prototype,"suggestions",void 0);Dd([G()],Ko.prototype,"registered",void 0);Dd([G()],Ko.prototype,"profileName",void 0);Ko=Dd([te("w3m-register-account-name-view")],Ko);const B6e=de`
- :host {
- width: var(--local-width);
- position: relative;
- }
- button {
- border: none;
- border-radius: var(--local-border-radius);
- width: var(--local-width);
- white-space: nowrap;
- }
- /* -- Sizes --------------------------------------------------- */
- button[data-size='md'] {
- padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-l);
- height: 36px;
- }
- button[data-size='md'][data-icon-left='true'][data-icon-right='false'] {
- padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-s);
- }
- button[data-size='md'][data-icon-right='true'][data-icon-left='false'] {
- padding: 8.2px var(--wui-spacing-s) 9px var(--wui-spacing-l);
- }
- button[data-size='lg'] {
- padding: var(--wui-spacing-m) var(--wui-spacing-2l);
- height: 48px;
- }
- /* -- Variants --------------------------------------------------------- */
- button[data-variant='main'] {
- background-color: var(--wui-color-accent-100);
- color: var(--wui-color-inverse-100);
- border: none;
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
- }
- button[data-variant='inverse'] {
- background-color: var(--wui-color-inverse-100);
- color: var(--wui-color-inverse-000);
- border: none;
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
- }
- button[data-variant='accent'] {
- background-color: var(--wui-color-accent-glass-010);
- color: var(--wui-color-accent-100);
- border: none;
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
- }
- button[data-variant='accent-error'] {
- background: var(--wui-color-error-glass-015);
- color: var(--wui-color-error-100);
- border: none;
- box-shadow: inset 0 0 0 1px var(--wui-color-error-glass-010);
- }
- button[data-variant='accent-success'] {
- background: var(--wui-color-success-glass-015);
- color: var(--wui-color-success-100);
- border: none;
- box-shadow: inset 0 0 0 1px var(--wui-color-success-glass-010);
- }
- button[data-variant='neutral'] {
- background: transparent;
- color: var(--wui-color-fg-100);
- border: none;
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
- }
- /* -- Focus states --------------------------------------------------- */
- button[data-variant='main']:focus-visible:enabled {
- background-color: var(--wui-color-accent-090);
- box-shadow:
- inset 0 0 0 1px var(--wui-color-accent-100),
- 0 0 0 4px var(--wui-color-accent-glass-020);
- }
- button[data-variant='inverse']:focus-visible:enabled {
- background-color: var(--wui-color-inverse-100);
- box-shadow:
- inset 0 0 0 1px var(--wui-color-gray-glass-010),
- 0 0 0 4px var(--wui-color-accent-glass-020);
- }
- button[data-variant='accent']:focus-visible:enabled {
- background-color: var(--wui-color-accent-glass-010);
- box-shadow:
- inset 0 0 0 1px var(--wui-color-accent-100),
- 0 0 0 4px var(--wui-color-accent-glass-020);
- }
- button[data-variant='accent-error']:focus-visible:enabled {
- background: var(--wui-color-error-glass-015);
- box-shadow:
- inset 0 0 0 1px var(--wui-color-error-100),
- 0 0 0 4px var(--wui-color-error-glass-020);
- }
- button[data-variant='accent-success']:focus-visible:enabled {
- background: var(--wui-color-success-glass-015);
- box-shadow:
- inset 0 0 0 1px var(--wui-color-success-100),
- 0 0 0 4px var(--wui-color-success-glass-020);
- }
- button[data-variant='neutral']:focus-visible:enabled {
- background: var(--wui-color-gray-glass-005);
- box-shadow:
- inset 0 0 0 1px var(--wui-color-gray-glass-010),
- 0 0 0 4px var(--wui-color-gray-glass-002);
- }
- /* -- Hover & Active states ----------------------------------------------------------- */
- @media (hover: hover) and (pointer: fine) {
- button[data-variant='main']:hover:enabled {
- background-color: var(--wui-color-accent-090);
- }
- button[data-variant='main']:active:enabled {
- background-color: var(--wui-color-accent-080);
- }
- button[data-variant='accent']:hover:enabled {
- background-color: var(--wui-color-accent-glass-015);
- }
- button[data-variant='accent']:active:enabled {
- background-color: var(--wui-color-accent-glass-020);
- }
- button[data-variant='accent-error']:hover:enabled {
- background: var(--wui-color-error-glass-020);
- color: var(--wui-color-error-100);
- }
- button[data-variant='accent-error']:active:enabled {
- background: var(--wui-color-error-glass-030);
- color: var(--wui-color-error-100);
- }
- button[data-variant='accent-success']:hover:enabled {
- background: var(--wui-color-success-glass-020);
- color: var(--wui-color-success-100);
- }
- button[data-variant='accent-success']:active:enabled {
- background: var(--wui-color-success-glass-030);
- color: var(--wui-color-success-100);
- }
- button[data-variant='neutral']:hover:enabled {
- background: var(--wui-color-gray-glass-002);
- }
- button[data-variant='neutral']:active:enabled {
- background: var(--wui-color-gray-glass-005);
- }
- button[data-size='lg'][data-icon-left='true'][data-icon-right='false'] {
- padding-left: var(--wui-spacing-m);
- }
- button[data-size='lg'][data-icon-right='true'][data-icon-left='false'] {
- padding-right: var(--wui-spacing-m);
- }
- }
- /* -- Disabled state --------------------------------------------------- */
- button:disabled {
- background-color: var(--wui-color-gray-glass-002);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
- color: var(--wui-color-gray-glass-020);
- cursor: not-allowed;
- }
- button > wui-text {
- transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: opacity;
- opacity: var(--local-opacity-100);
- }
- ::slotted(*) {
- transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: opacity;
- opacity: var(--local-opacity-100);
- }
- wui-loading-spinner {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- opacity: var(--local-opacity-000);
- }
- `;var lc=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const GB={main:"inverse-100",inverse:"inverse-000",accent:"accent-100","accent-error":"error-100","accent-success":"success-100",neutral:"fg-100",disabled:"gray-glass-020"},D6e={lg:"paragraph-600",md:"small-600"},M6e={lg:"md",md:"md"};let io=class extends se{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="main",this.hasIconLeft=!1,this.hasIconRight=!1,this.borderRadius="m"}render(){this.style.cssText=`
- --local-width: ${this.fullWidth?"100%":"auto"};
- --local-opacity-100: ${this.loading?0:1};
- --local-opacity-000: ${this.loading?1:0};
- --local-border-radius: var(--wui-border-radius-${this.borderRadius});
- `;const e=this.textVariant??D6e[this.size];return M`
- <button
- data-variant=${this.variant}
- data-icon-left=${this.hasIconLeft}
- data-icon-right=${this.hasIconRight}
- data-size=${this.size}
- ?disabled=${this.disabled}
- >
- ${this.loadingTemplate()}
- <slot name="iconLeft" @slotchange=${()=>this.handleSlotLeftChange()}></slot>
- <wui-text variant=${e} color="inherit">
- <slot></slot>
- </wui-text>
- <slot name="iconRight" @slotchange=${()=>this.handleSlotRightChange()}></slot>
- </button>
- `}handleSlotLeftChange(){this.hasIconLeft=!0}handleSlotRightChange(){this.hasIconRight=!0}loadingTemplate(){if(this.loading){const e=M6e[this.size],r=this.disabled?GB.disabled:GB[this.variant];return M`<wui-loading-spinner color=${r} size=${e}></wui-loading-spinner>`}return M``}};io.styles=[He,vt,B6e];lc([q()],io.prototype,"size",void 0);lc([q({type:Boolean})],io.prototype,"disabled",void 0);lc([q({type:Boolean})],io.prototype,"fullWidth",void 0);lc([q({type:Boolean})],io.prototype,"loading",void 0);lc([q()],io.prototype,"variant",void 0);lc([q({type:Boolean})],io.prototype,"hasIconLeft",void 0);lc([q({type:Boolean})],io.prototype,"hasIconRight",void 0);lc([q()],io.prototype,"borderRadius",void 0);lc([q()],io.prototype,"textVariant",void 0);io=lc([te("wui-button")],io);const L6e=de`
- :host {
- display: inline-flex;
- justify-content: center;
- align-items: center;
- position: relative;
- overflow: hidden;
- background-color: var(--wui-color-gray-glass-020);
- border-radius: var(--local-border-radius);
- border: var(--local-border);
- box-sizing: content-box;
- width: var(--local-size);
- height: var(--local-size);
- min-height: var(--local-size);
- min-width: var(--local-size);
- }
- @supports (background: color-mix(in srgb, white 50%, black)) {
- :host {
- background-color: color-mix(in srgb, var(--local-bg-value) var(--local-bg-mix), transparent);
- }
- }
- `;var Zu=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Zo=class extends se{constructor(){super(...arguments),this.size="md",this.backgroundColor="accent-100",this.iconColor="accent-100",this.background="transparent",this.border=!1,this.borderColor="wui-color-bg-125",this.icon="copy"}render(){const e=this.iconSize||this.size,r=this.size==="lg",n=this.size==="xl",i=r?"12%":"16%",s=r?"xxs":n?"s":"3xl",o=this.background==="gray",a=this.background==="opaque",c=this.backgroundColor==="accent-100"&&a||this.backgroundColor==="success-100"&&a||this.backgroundColor==="error-100"&&a||this.backgroundColor==="inverse-100"&&a;let u=`var(--wui-color-${this.backgroundColor})`;return c?u=`var(--wui-icon-box-bg-${this.backgroundColor})`:o&&(u=`var(--wui-color-gray-${this.backgroundColor})`),this.style.cssText=`
- --local-bg-value: ${u};
- --local-bg-mix: ${c||o?"100%":i};
- --local-border-radius: var(--wui-border-radius-${s});
- --local-size: var(--wui-icon-box-size-${this.size});
- --local-border: ${this.borderColor==="wui-color-bg-125"?"2px":"1px"} solid ${this.border?`var(--${this.borderColor})`:"transparent"}
- `,M` <wui-icon color=${this.iconColor} size=${e} name=${this.icon}></wui-icon> `}};Zo.styles=[He,vt,L6e];Zu([q()],Zo.prototype,"size",void 0);Zu([q()],Zo.prototype,"backgroundColor",void 0);Zu([q()],Zo.prototype,"iconColor",void 0);Zu([q()],Zo.prototype,"iconSize",void 0);Zu([q()],Zo.prototype,"background",void 0);Zu([q({type:Boolean})],Zo.prototype,"border",void 0);Zu([q()],Zo.prototype,"borderColor",void 0);Zu([q()],Zo.prototype,"icon",void 0);Zo=Zu([te("wui-icon-box")],Zo);const U6e=de`
- button {
- padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs);
- border-radius: var(--wui-border-radius-3xs);
- background-color: transparent;
- color: var(--wui-color-accent-100);
- }
- button:disabled {
- background-color: transparent;
- color: var(--wui-color-gray-glass-015);
- }
- button:hover {
- background-color: var(--wui-color-gray-glass-005);
- }
- `;var SA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Rm=class extends se{constructor(){super(...arguments),this.tabIdx=void 0,this.disabled=!1,this.color="inherit"}render(){return M`
- <button ?disabled=${this.disabled} tabindex=${we(this.tabIdx)}>
- <slot name="iconLeft"></slot>
- <wui-text variant="small-600" color=${this.color}>
- <slot></slot>
- </wui-text>
- <slot name="iconRight"></slot>
- </button>
- `}};Rm.styles=[He,vt,U6e];SA([q()],Rm.prototype,"tabIdx",void 0);SA([q({type:Boolean})],Rm.prototype,"disabled",void 0);SA([q()],Rm.prototype,"color",void 0);Rm=SA([te("wui-link")],Rm);const F6e=de`
- .continue-button-container {
- width: 100%;
- }
- `;var H6e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let n6=class extends se{render(){return M`
- <wui-flex
- flexDirection="column"
- alignItems="center"
- gap="xxl"
- .padding=${["0","0","l","0"]}
- >
- ${this.onboardingTemplate()} ${this.buttonsTemplate()}
- <wui-link
- @click=${()=>{ue.openHref(IV.URLS.FAQ,"_blank")}}
- >
- Learn more
- <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
- </wui-link>
- </wui-flex>
- `}onboardingTemplate(){return M` <wui-flex
- flexDirection="column"
- gap="xxl"
- alignItems="center"
- .padding=${["0","xxl","0","xxl"]}
- >
- <wui-flex gap="s" alignItems="center" justifyContent="center">
- <wui-icon-box
- size="xl"
- iconcolor="success-100"
- backgroundcolor="success-100"
- icon="checkmark"
- background="opaque"
- ></wui-icon-box>
- </wui-flex>
- <wui-flex flexDirection="column" alignItems="center" gap="s">
- <wui-text align="center" variant="medium-600" color="fg-100">
- Account name chosen successfully
- </wui-text>
- <wui-text align="center" variant="paragraph-400" color="fg-100">
- You can now fund your account and trade crypto
- </wui-text>
- </wui-flex>
- </wui-flex>`}buttonsTemplate(){return M`<wui-flex
- .padding=${["0","2l","0","2l"]}
- gap="s"
- class="continue-button-container"
- >
- <wui-button fullWidth size="lg" borderRadius="xs" @click=${this.redirectToAccount.bind(this)}
- >Let's Go!
- </wui-button>
- </wui-flex>`}redirectToAccount(){X.replace("Account")}};n6.styles=F6e;n6=H6e([te("w3m-register-account-name-success-view")],n6);const q6e=Object.freeze(Object.defineProperty({__proto__:null,get W3mApproveTransactionView(){return Oy},get W3mRegisterAccountNameSuccess(){return n6},get W3mRegisterAccountNameView(){return Ko},get W3mUpgradeWalletView(){return kP}},Symbol.toStringTag,{value:"Module"})),z6e=de`
- :host {
- position: relative;
- display: inline-block;
- }
- input {
- width: 50px;
- height: 50px;
- background: var(--wui-color-gray-glass-010);
- border-radius: var(--wui-border-radius-xs);
- border: 1px solid var(--wui-color-gray-glass-005);
- font-family: var(--wui-font-family);
- font-size: var(--wui-font-size-large);
- font-weight: var(--wui-font-weight-regular);
- letter-spacing: var(--wui-letter-spacing-large);
- text-align: center;
- color: var(--wui-color-fg-100);
- caret-color: var(--wui-color-accent-100);
- transition:
- background-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
- border-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
- box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md);
- will-change: background-color, border-color, box-shadow;
- box-sizing: border-box;
- -webkit-appearance: none;
- -moz-appearance: textfield;
- padding: 0px;
- }
- input::-webkit-outer-spin-button,
- input::-webkit-inner-spin-button {
- -webkit-appearance: none;
- margin: 0;
- }
- input[type='number'] {
- -moz-appearance: textfield;
- }
- input:disabled {
- cursor: not-allowed;
- border: 1px solid var(--wui-color-gray-glass-010);
- background: var(--wui-color-gray-glass-005);
- }
- input:focus:enabled {
- background-color: var(--wui-color-gray-glass-015);
- border: 1px solid var(--wui-color-accent-100);
- -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
- -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
- box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
- }
- @media (hover: hover) and (pointer: fine) {
- input:hover:enabled {
- background-color: var(--wui-color-gray-glass-015);
- }
- }
- `;var D7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Ny=class extends se{constructor(){super(...arguments),this.disabled=!1,this.value=""}render(){return M`<input
- type="number"
- maxlength="1"
- inputmode="numeric"
- autofocus
- ?disabled=${this.disabled}
- value=${this.value}
- /> `}};Ny.styles=[He,vt,z6e];D7([q({type:Boolean})],Ny.prototype,"disabled",void 0);D7([q({type:String})],Ny.prototype,"value",void 0);Ny=D7([te("wui-input-numeric")],Ny);const W6e=de`
- :host {
- position: relative;
- display: block;
- }
- `;var TA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let km=class extends se{constructor(){super(...arguments),this.length=6,this.otp="",this.values=Array.from({length:this.length}).map(()=>""),this.numerics=[],this.shouldInputBeEnabled=e=>this.values.slice(0,e).every(n=>n!==""),this.handleKeyDown=(e,r)=>{const n=e.target,i=this.getInputElement(n),s=["ArrowLeft","ArrowRight","Shift","Delete"];if(!i)return;s.includes(e.key)&&e.preventDefault();const o=i.selectionStart;switch(e.key){case"ArrowLeft":o&&i.setSelectionRange(o+1,o+1),this.focusInputField("prev",r);break;case"ArrowRight":this.focusInputField("next",r);break;case"Shift":this.focusInputField("next",r);break;case"Delete":i.value===""?this.focusInputField("prev",r):this.updateInput(i,r,"");break;case"Backspace":i.value===""?this.focusInputField("prev",r):this.updateInput(i,r,"");break}},this.focusInputField=(e,r)=>{if(e==="next"){const n=r+1;if(!this.shouldInputBeEnabled(n))return;const i=this.numerics[n<this.length?n:r],s=i?this.getInputElement(i):void 0;s&&(s.disabled=!1,s.focus())}if(e==="prev"){const n=r-1,i=this.numerics[n>-1?n:r],s=i?this.getInputElement(i):void 0;s&&s.focus()}}}firstUpdated(){var r,n;this.otp&&(this.values=this.otp.split(""));const e=(r=this.shadowRoot)==null?void 0:r.querySelectorAll("wui-input-numeric");e&&(this.numerics=Array.from(e)),(n=this.numerics[0])==null||n.focus()}render(){return M`
- <wui-flex gap="xxs" data-testid="wui-otp-input">
- ${Array.from({length:this.length}).map((e,r)=>M`
- <wui-input-numeric
- @input=${n=>this.handleInput(n,r)}
- @click=${n=>this.selectInput(n)}
- @keydown=${n=>this.handleKeyDown(n,r)}
- .disabled=${!this.shouldInputBeEnabled(r)}
- .value=${this.values[r]||""}
- >
- </wui-input-numeric>
- `)}
- </wui-flex>
- `}updateInput(e,r,n){const i=this.numerics[r],s=e||(i?this.getInputElement(i):void 0);s&&(s.value=n,this.values=this.values.map((o,a)=>a===r?n:o))}selectInput(e){const r=e.target;if(r){const n=this.getInputElement(r);n==null||n.select()}}handleInput(e,r){const n=e.target,i=this.getInputElement(n);if(i){const s=i.value;e.inputType==="insertFromPaste"?this.handlePaste(i,s,r):nt.isNumber(s)&&e.data?(this.updateInput(i,r,e.data),this.focusInputField("next",r)):this.updateInput(i,r,"")}this.dispatchInputChangeEvent()}handlePaste(e,r,n){const i=r[0];if(i&&nt.isNumber(i)){this.updateInput(e,n,i);const o=r.substring(1);if(n+1<this.length&&o.length){const a=this.numerics[n+1],c=a?this.getInputElement(a):void 0;c&&this.handlePaste(c,o,n+1)}else this.focusInputField("next",n)}else this.updateInput(e,n,"")}getInputElement(e){var r;return(r=e.shadowRoot)!=null&&r.querySelector("input")?e.shadowRoot.querySelector("input"):null}dispatchInputChangeEvent(){const e=this.values.join("");this.dispatchEvent(new CustomEvent("inputChange",{detail:e,bubbles:!0,composed:!0}))}};km.styles=[He,W6e];TA([q({type:Number})],km.prototype,"length",void 0);TA([q({type:String})],km.prototype,"otp",void 0);TA([G()],km.prototype,"values",void 0);km=TA([te("wui-otp")],km);const V6e=de`
- wui-loading-spinner {
- margin: 9px auto;
- }
- .email-display,
- .email-display wui-text {
- max-width: 100%;
- }
- `;var IA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const G6e=6;let $u=class extends se{firstUpdated(){this.startOTPTimeout()}disconnectedCallback(){clearTimeout(this.OTPTimeout)}constructor(){var e;super(),this.loading=!1,this.timeoutTimeLeft=ei.getTimeToNextEmailLogin(),this.error="",this.otp="",this.email=(e=X.state.data)==null?void 0:e.email,this.authConnector=ge.getAuthConnector()}render(){if(!this.email)throw new Error("w3m-email-otp-widget: No email provided");const e=!!this.timeoutTimeLeft,r=this.getFooterLabels(e);return M`
- <wui-flex
- flexDirection="column"
- alignItems="center"
- .padding=${["l","0","l","0"]}
- gap="l"
- >
- <wui-flex
- class="email-display"
- flexDirection="column"
- alignItems="center"
- .padding=${["0","xl","0","xl"]}
- >
- <wui-text variant="paragraph-400" color="fg-100" align="center">
- Enter the code we sent to
- </wui-text>
- <wui-text variant="paragraph-500" color="fg-100" lineClamp="1" align="center">
- ${this.email}
- </wui-text>
- </wui-flex>
- <wui-text variant="small-400" color="fg-200">The code expires in 20 minutes</wui-text>
- ${this.loading?M`<wui-loading-spinner size="xl" color="accent-100"></wui-loading-spinner>`:M` <wui-flex flexDirection="column" alignItems="center" gap="xs">
- <wui-otp
- dissabled
- length="6"
- @inputChange=${this.onOtpInputChange.bind(this)}
- .otp=${this.otp}
- ></wui-otp>
- ${this.error?M`
- <wui-text variant="small-400" align="center" color="error-100">
- ${this.error}. Try Again
- </wui-text>
- `:null}
- </wui-flex>`}
- <wui-flex alignItems="center" gap="xs">
- <wui-text variant="small-400" color="fg-200">${r.title}</wui-text>
- <wui-link @click=${this.onResendCode.bind(this)} .disabled=${e}>
- ${r.action}
- </wui-link>
- </wui-flex>
- </wui-flex>
- `}startOTPTimeout(){this.timeoutTimeLeft=ei.getTimeToNextEmailLogin(),this.OTPTimeout=setInterval(()=>{this.timeoutTimeLeft>0?this.timeoutTimeLeft=ei.getTimeToNextEmailLogin():clearInterval(this.OTPTimeout)},1e3)}async onOtpInputChange(e){var r;try{this.loading||(this.otp=e.detail,this.authConnector&&this.otp.length===G6e&&(this.loading=!0,await((r=this.onOtpSubmit)==null?void 0:r.call(this,this.otp))))}catch(n){this.error=ue.parseError(n),this.loading=!1}}async onResendCode(){try{if(this.onOtpResend){if(!this.loading&&!this.timeoutTimeLeft){if(this.error="",this.otp="",!ge.getAuthConnector()||!this.email)throw new Error("w3m-email-otp-widget: Unable to resend email");this.loading=!0,await this.onOtpResend(this.email),this.startOTPTimeout(),Fe.showSuccess("Code email resent")}}else this.onStartOver&&this.onStartOver()}catch(e){Fe.showError(e)}finally{this.loading=!1}}getFooterLabels(e){return this.onStartOver?{title:"Something wrong?",action:`Try again ${e?`in ${this.timeoutTimeLeft}s`:""}`}:{title:"Didn't receive it?",action:`Resend ${e?`in ${this.timeoutTimeLeft}s`:"Code"}`}}};$u.styles=V6e;IA([G()],$u.prototype,"loading",void 0);IA([G()],$u.prototype,"timeoutTimeLeft",void 0);IA([G()],$u.prototype,"error",void 0);$u=IA([te("w3m-email-otp-widget")],$u);var K6e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let NP=class extends $u{constructor(){super(...arguments),this.onOtpSubmit=async e=>{try{if(this.authConnector){if(await this.authConnector.provider.connectOtp({otp:e}),Re.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),F.state.activeChain)await xe.connectExternal(this.authConnector,F.state.activeChain);else throw new Error("Active chain is not set on ChainControll");Re.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"email",name:this.authConnector.name||"Unknown"}}),oe.state.siwx||We.close()}}catch(r){throw Re.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL",properties:{message:ue.parseError(r)}}),r}},this.onOtpResend=async e=>{this.authConnector&&(await this.authConnector.provider.connectEmail({email:e}),Re.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}))}}};NP=K6e([te("w3m-email-verify-otp-view")],NP);const Z6e=de`
- wui-icon-box {
- height: var(--wui-icon-box-size-xl);
- width: var(--wui-icon-box-size-xl);
- }
- `;var LJ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let $y=class extends se{constructor(){var e;super(),this.email=(e=X.state.data)==null?void 0:e.email,this.authConnector=ge.getAuthConnector(),this.loading=!1,this.listenForDeviceApproval()}render(){if(!this.email)throw new Error("w3m-email-verify-device-view: No email provided");if(!this.authConnector)throw new Error("w3m-email-verify-device-view: No auth connector provided");return M`
- <wui-flex
- flexDirection="column"
- alignItems="center"
- .padding=${["xxl","s","xxl","s"]}
- gap="l"
- >
- <wui-icon-box
- size="xl"
- iconcolor="accent-100"
- backgroundcolor="accent-100"
- icon="verify"
- background="opaque"
- ></wui-icon-box>
- <wui-flex flexDirection="column" alignItems="center" gap="s">
- <wui-flex flexDirection="column" alignItems="center">
- <wui-text variant="paragraph-400" color="fg-100">
- Approve the login link we sent to
- </wui-text>
- <wui-text variant="paragraph-400" color="fg-100"><b>${this.email}</b></wui-text>
- </wui-flex>
- <wui-text variant="small-400" color="fg-200" align="center">
- The code expires in 20 minutes
- </wui-text>
- <wui-flex alignItems="center" id="w3m-resend-section" gap="xs">
- <wui-text variant="small-400" color="fg-100" align="center">
- Didn't receive it?
- </wui-text>
- <wui-link @click=${this.onResendCode.bind(this)} .disabled=${this.loading}>
- Resend email
- </wui-link>
- </wui-flex>
- </wui-flex>
- </wui-flex>
- `}async listenForDeviceApproval(){if(this.authConnector)try{await this.authConnector.provider.connectDevice(),Re.sendEvent({type:"track",event:"DEVICE_REGISTERED_FOR_EMAIL"}),Re.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),X.replace("EmailVerifyOtp",{email:this.email})}catch{X.goBack()}}async onResendCode(){try{if(!this.loading){if(!this.authConnector||!this.email)throw new Error("w3m-email-login-widget: Unable to resend email");this.loading=!0,await this.authConnector.provider.connectEmail({email:this.email}),this.listenForDeviceApproval(),Fe.showSuccess("Code email resent")}}catch(e){Fe.showError(e)}finally{this.loading=!1}}};$y.styles=Z6e;LJ([G()],$y.prototype,"loading",void 0);$y=LJ([te("w3m-email-verify-device-view")],$y);const Y6e=de`
- :host {
- position: relative;
- display: inline-block;
- }
- wui-text {
- margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m);
- }
- `;var e2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let tp=class extends se{constructor(){super(...arguments),this.disabled=!1}render(){return M`
- <wui-input-text
- type="email"
- placeholder="Email"
- icon="mail"
- size="mdl"
- .disabled=${this.disabled}
- .value=${this.value}
- data-testid="wui-email-input"
- tabIdx=${we(this.tabIdx)}
- ></wui-input-text>
- ${this.templateError()}
- `}templateError(){return this.errorMessage?M`<wui-text variant="tiny-500" color="error-100">${this.errorMessage}</wui-text>`:null}};tp.styles=[He,Y6e];e2([q()],tp.prototype,"errorMessage",void 0);e2([q({type:Boolean})],tp.prototype,"disabled",void 0);e2([q()],tp.prototype,"value",void 0);e2([q()],tp.prototype,"tabIdx",void 0);tp=e2([te("wui-email-input")],tp);const J6e=de`
- wui-email-input {
- width: 100%;
- }
- form {
- width: 100%;
- display: block;
- position: relative;
- }
- `;var M7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Nm=class extends se{constructor(){var e,r;super(...arguments),this.formRef=ec(),this.initialEmail=((e=X.state.data)==null?void 0:e.email)??"",this.redirectView=(r=X.state.data)==null?void 0:r.redirectView,this.email="",this.loading=!1}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",r=>{r.key==="Enter"&&this.onSubmitEmail(r)})}render(){return M`
- <wui-flex flexDirection="column" padding="m" gap="m">
- <form ${tc(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
- <wui-email-input
- value=${this.initialEmail}
- .disabled=${this.loading}
- @inputChange=${this.onEmailInputChange.bind(this)}
- >
- </wui-email-input>
- <input type="submit" hidden />
- </form>
- ${this.buttonsTemplate()}
- </wui-flex>
- `}onEmailInputChange(e){this.email=e.detail}async onSubmitEmail(e){try{if(this.loading)return;this.loading=!0,e.preventDefault();const r=ge.getAuthConnector();if(!r)throw new Error("w3m-update-email-wallet: Auth connector not found");const n=await r.provider.updateEmail({email:this.email});Re.sendEvent({type:"track",event:"EMAIL_EDIT"}),n.action==="VERIFY_SECONDARY_OTP"?X.push("UpdateEmailSecondaryOtp",{email:this.initialEmail,newEmail:this.email,redirectView:this.redirectView}):X.push("UpdateEmailPrimaryOtp",{email:this.initialEmail,newEmail:this.email,redirectView:this.redirectView})}catch(r){Fe.showError(r),this.loading=!1}}buttonsTemplate(){const e=!this.loading&&this.email.length>3&&this.email!==this.initialEmail;return this.redirectView?M`
- <wui-flex gap="s">
- <wui-button size="md" variant="neutral" fullWidth @click=${X.goBack}>
- Cancel
- </wui-button>
- <wui-button
- size="md"
- variant="main"
- fullWidth
- @click=${this.onSubmitEmail.bind(this)}
- .disabled=${!e}
- .loading=${this.loading}
- >
- Save
- </wui-button>
- </wui-flex>
- `:M`
- <wui-button
- size="md"
- variant="main"
- fullWidth
- @click=${this.onSubmitEmail.bind(this)}
- .disabled=${!e}
- .loading=${this.loading}
- >
- Save
- </wui-button>
- `}};Nm.styles=J6e;M7([G()],Nm.prototype,"email",void 0);M7([G()],Nm.prototype,"loading",void 0);Nm=M7([te("w3m-update-email-wallet-view")],Nm);var Q6e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let $P=class extends $u{constructor(){var e;super(),this.email=(e=X.state.data)==null?void 0:e.email,this.onOtpSubmit=async r=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailPrimaryOtp({otp:r}),Re.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),X.replace("UpdateEmailSecondaryOtp",X.state.data))}catch(n){throw Re.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL",properties:{message:ue.parseError(n)}}),n}},this.onStartOver=()=>{X.replace("UpdateEmailWallet",X.state.data)}}};$P=Q6e([te("w3m-update-email-primary-otp-view")],$P);var X6e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let jP=class extends $u{constructor(){var e,r;super(),this.email=(e=X.state.data)==null?void 0:e.newEmail,this.redirectView=(r=X.state.data)==null?void 0:r.redirectView,this.onOtpSubmit=async n=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailSecondaryOtp({otp:n}),Re.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),this.redirectView&&X.reset(this.redirectView))}catch(i){throw Re.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL",properties:{message:ue.parseError(i)}}),i}},this.onStartOver=()=>{X.replace("UpdateEmailWallet",X.state.data)}}};jP=X6e([te("w3m-update-email-secondary-otp-view")],jP);var UJ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let i6=class extends se{constructor(){var e;super(),this.authConnector=ge.getAuthConnector(),this.isEmailEnabled=(e=oe.state.remoteFeatures)==null?void 0:e.email,this.isAuthEnabled=this.checkIfAuthEnabled(ge.state.connectors),this.connectors=ge.state.connectors,ge.subscribeKey("connectors",r=>{this.connectors=r,this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors)})}render(){if(!this.isEmailEnabled)throw new Error("w3m-email-login-view: Email is not enabled");if(!this.isAuthEnabled)throw new Error("w3m-email-login-view: No auth connector provided");return M`<wui-flex
- flexDirection="column"
- .padding=${["3xs","m","m","m"]}
- gap="l"
- >
- <w3m-email-login-widget></w3m-email-login-widget>
- </wui-flex> `}checkIfAuthEnabled(e){const r=e.filter(i=>i.type===Xt.CONNECTOR_TYPE_AUTH).map(i=>i.chain);return _e.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(i=>r.includes(i))}};UJ([G()],i6.prototype,"connectors",void 0);i6=UJ([te("w3m-email-login-view")],i6);const eAe=Object.freeze(Object.defineProperty({__proto__:null,get W3mEmailLoginView(){return i6},get W3mEmailVerifyDeviceView(){return $y},get W3mEmailVerifyOtpView(){return NP},get W3mUpdateEmailPrimaryOtpView(){return $P},get W3mUpdateEmailSecondaryOtpView(){return jP},get W3mUpdateEmailWalletView(){return Nm}},Symbol.toStringTag,{value:"Module"})),tAe=de`
- label {
- display: flex;
- align-items: center;
- cursor: pointer;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- column-gap: var(--wui-spacing-1xs);
- }
- label > input[type='checkbox'] {
- height: 0;
- width: 0;
- opacity: 0;
- pointer-events: none;
- position: absolute;
- }
- label > span {
- width: var(--wui-spacing-xl);
- height: var(--wui-spacing-xl);
- min-width: var(--wui-spacing-xl);
- min-height: var(--wui-spacing-xl);
- border-radius: var(--wui-border-radius-3xs);
- border-width: 1px;
- border-style: solid;
- border-color: var(--wui-color-gray-glass-010);
- display: flex;
- align-items: center;
- justify-content: center;
- transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
- will-change: background-color;
- }
- label > span:hover,
- label > input[type='checkbox']:focus-visible + span {
- background-color: var(--wui-color-gray-glass-010);
- }
- label input[type='checkbox']:checked + span {
- background-color: var(--wui-color-blue-base-90);
- }
- label > span > wui-icon {
- opacity: 0;
- transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-lg);
- will-change: opacity;
- }
- label > input[type='checkbox']:checked + span wui-icon {
- opacity: 1;
- }
- `;var FJ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let s6=class extends se{constructor(){super(...arguments),this.inputElementRef=ec(),this.checked=void 0}render(){return M`
- <label>
- <input
- ${tc(this.inputElementRef)}
- ?checked=${we(this.checked)}
- type="checkbox"
- @change=${this.dispatchChangeEvent}
- />
- <span>
- <wui-icon name="checkmarkBold" color="inverse-100" size="xxs"></wui-icon>
- </span>
- <slot></slot>
- </label>
- `}dispatchChangeEvent(){var e;this.dispatchEvent(new CustomEvent("checkboxChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.checked,bubbles:!0,composed:!0}))}};s6.styles=[He,tAe];FJ([q({type:Boolean})],s6.prototype,"checked",void 0);s6=FJ([te("wui-checkbox")],s6);const rAe=de`
- :host {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- wui-checkbox {
- padding: var(--wui-spacing-s);
- }
- a {
- text-decoration: none;
- color: var(--wui-color-fg-150);
- font-weight: 500;
- }
- `;var HJ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let o6=class extends se{constructor(){super(),this.unsubscribe=[],this.checked=As.state.isLegalCheckboxChecked,this.unsubscribe.push(As.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var i;const{termsConditionsUrl:e,privacyPolicyUrl:r}=oe.state,n=(i=oe.state.features)==null?void 0:i.legalCheckbox;return!e&&!r||!n?null:M`
- <wui-checkbox
- ?checked=${this.checked}
- @checkboxChange=${this.onCheckboxChange.bind(this)}
- data-testid="wui-checkbox"
- >
- <wui-text color="fg-250" variant="small-400" align="left">
- I agree to our ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
- </wui-text>
- </wui-checkbox>
- `}andTemplate(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=oe.state;return e&&r?"and":""}termsTemplate(){const{termsConditionsUrl:e}=oe.state;return e?M`<a rel="noreferrer" target="_blank" href=${e}>terms of service</a>`:null}privacyTemplate(){const{privacyPolicyUrl:e}=oe.state;return e?M`<a rel="noreferrer" target="_blank" href=${e}>privacy policy</a>`:null}onCheckboxChange(){As.setIsLegalCheckboxChecked(!this.checked)}};o6.styles=[rAe];HJ([G()],o6.prototype,"checked",void 0);o6=HJ([te("w3m-legal-checkbox")],o6);const nAe=/[.*+?^${}()|[\]\\]/gu,iAe=/[0-9,.]/u,sAe="https://reown.com",oAe=de`
- .reown-logo {
- height: var(--wui-spacing-xxl);
- }
- a {
- text-decoration: none;
- cursor: pointer;
- }
- a:hover {
- opacity: 0.9;
- }
- `;var aAe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let BP=class extends se{render(){return M`
- <a
- data-testid="ux-branding-reown"
- href=${sAe}
- rel="noreferrer"
- target="_blank"
- style="text-decoration: none;"
- >
- <wui-flex
- justifyContent="center"
- alignItems="center"
- gap="xs"
- .padding=${["0","0","l","0"]}
- >
- <wui-text variant="small-500" color="fg-100"> UX by </wui-text>
- <wui-icon name="reown" size="xxxl" class="reown-logo"></wui-icon>
- </wui-flex>
- </a>
- `}};BP.styles=[He,vt,oAe];BP=aAe([te("wui-ux-by-reown")],BP);const cAe=de`
- :host > wui-flex {
- background-color: var(--wui-color-gray-glass-005);
- }
- :host wui-ux-by-reown {
- padding-top: 0;
- }
- :host wui-ux-by-reown.branding-only {
- padding-top: var(--wui-spacing-m);
- }
- a {
- text-decoration: none;
- color: var(--wui-color-fg-175);
- font-weight: 500;
- }
- `;var qJ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let a6=class extends se{constructor(){super(),this.unsubscribe=[],this.remoteFeatures=oe.state.remoteFeatures,this.unsubscribe.push(oe.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var s;const{termsConditionsUrl:e,privacyPolicyUrl:r}=oe.state,n=(s=oe.state.features)==null?void 0:s.legalCheckbox;return!e&&!r||n?M`
- <wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex>
- `:M`
- <wui-flex flexDirection="column">
- <wui-flex .padding=${["m","s","s","s"]} justifyContent="center">
- <wui-text color="fg-250" variant="small-400" align="center">
- By connecting your wallet, you agree to our <br />
- ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
- </wui-text>
- </wui-flex>
- ${this.reownBrandingTemplate()}
- </wui-flex>
- `}andTemplate(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=oe.state;return e&&r?"and":""}termsTemplate(){const{termsConditionsUrl:e}=oe.state;return e?M`<a href=${e}>Terms of Service</a>`:null}privacyTemplate(){const{privacyPolicyUrl:e}=oe.state;return e?M`<a href=${e}>Privacy Policy</a>`:null}reownBrandingTemplate(e=!1){var r;return(r=this.remoteFeatures)!=null&&r.reownBranding?e?M`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:M`<wui-ux-by-reown></wui-ux-by-reown>`:null}};a6.styles=[cAe];qJ([G()],a6.prototype,"remoteFeatures",void 0);a6=qJ([te("w3m-legal-footer")],a6);const uAe=de`
- :host {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 40px;
- height: 40px;
- border-radius: var(--wui-border-radius-3xl);
- border: 1px solid var(--wui-color-gray-glass-005);
- overflow: hidden;
- }
- wui-icon {
- width: 100%;
- height: 100%;
- }
- `;var zJ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let c6=class extends se{constructor(){super(...arguments),this.logo="google"}render(){return M`<wui-icon color="inherit" size="inherit" name=${this.logo}></wui-icon> `}};c6.styles=[He,uAe];zJ([q()],c6.prototype,"logo",void 0);c6=zJ([te("wui-logo")],c6);const lAe=de`
- button {
- column-gap: var(--wui-spacing-s);
- padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
- width: 100%;
- justify-content: flex-start;
- background-color: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xs);
- color: var(--wui-color-fg-100);
- }
- wui-text {
- text-transform: capitalize;
- }
- wui-text[data-align='left'] {
- display: flex;
- flex: 1;
- }
- wui-text[data-align='center'] {
- display: flex;
- flex: 1;
- justify-content: center;
- }
- .invisible {
- opacity: 0;
- pointer-events: none;
- }
- button:disabled {
- background-color: var(--wui-color-gray-glass-015);
- color: var(--wui-color-gray-glass-015);
- }
- `;var c1=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let _d=class extends se{constructor(){super(...arguments),this.logo="google",this.name="Continue with google",this.align="left",this.disabled=!1}render(){return M`
- <button ?disabled=${this.disabled} tabindex=${we(this.tabIdx)}>
- <wui-logo logo=${this.logo}></wui-logo>
- <wui-text
- data-align=${this.align}
- variant="paragraph-500"
- color="inherit"
- align=${this.align}
- >${this.name}</wui-text
- >
- ${this.templatePlacement()}
- </button>
- `}templatePlacement(){return this.align==="center"?M` <wui-logo class="invisible" logo=${this.logo}></wui-logo>`:null}};_d.styles=[He,vt,lAe];c1([q()],_d.prototype,"logo",void 0);c1([q()],_d.prototype,"name",void 0);c1([q()],_d.prototype,"align",void 0);c1([q()],_d.prototype,"tabIdx",void 0);c1([q({type:Boolean})],_d.prototype,"disabled",void 0);_d=c1([te("wui-list-social")],_d);const dAe=de`
- :host {
- margin-top: var(--wui-spacing-3xs);
- }
- wui-separator {
- margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
- calc(var(--wui-spacing-m) * -1);
- width: calc(100% + var(--wui-spacing-s) * 2);
- }
- `;var u1=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Ed=class extends se{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=ge.state.connectors,this.authConnector=this.connectors.find(e=>e.type==="AUTH"),this.remoteFeatures=oe.state.remoteFeatures,this.isPwaLoading=!1,this.unsubscribe.push(ge.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(r=>r.type==="AUTH")}),oe.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}connectedCallback(){super.connectedCallback(),this.handlePwaFrameLoad()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var s;let e=((s=this.remoteFeatures)==null?void 0:s.socials)||[];const r=!!this.authConnector,n=e==null?void 0:e.length,i=X.state.view==="ConnectSocials";return(!r||!n)&&!i?null:(i&&!n&&(e=ct.DEFAULT_SOCIALS),M` <wui-flex flexDirection="column" gap="xs">
- ${e.map(o=>M`<wui-list-social
- @click=${()=>{this.onSocialClick(o)}}
- data-testid=${`social-selector-${o}`}
- name=${o}
- logo=${o}
- ?disabled=${this.isPwaLoading}
- ></wui-list-social>`)}
- </wui-flex>`)}async onSocialClick(e){e&&await OZ(e)}async handlePwaFrameLoad(){var e;if(ue.isPWA()){this.isPwaLoading=!0;try{((e=this.authConnector)==null?void 0:e.provider)instanceof s7&&await this.authConnector.provider.init()}catch(r){Fn.open({shortMessage:"Error loading embedded wallet in PWA",longMessage:r.message},"error")}finally{this.isPwaLoading=!1}}}};Ed.styles=dAe;u1([q()],Ed.prototype,"tabIdx",void 0);u1([G()],Ed.prototype,"connectors",void 0);u1([G()],Ed.prototype,"authConnector",void 0);u1([G()],Ed.prototype,"remoteFeatures",void 0);u1([G()],Ed.prototype,"isPwaLoading",void 0);Ed=u1([te("w3m-social-login-list")],Ed);const hAe=de`
- wui-flex {
- max-height: clamp(360px, 540px, 80vh);
- overflow: scroll;
- scrollbar-width: none;
- transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: opacity;
- }
- wui-flex::-webkit-scrollbar {
- display: none;
- }
- wui-flex.disabled {
- opacity: 0.3;
- pointer-events: none;
- user-select: none;
- }
- `;var WJ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let jy=class extends se{constructor(){super(),this.unsubscribe=[],this.checked=As.state.isLegalCheckboxChecked,this.unsubscribe.push(As.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var c;const{termsConditionsUrl:e,privacyPolicyUrl:r}=oe.state,n=(c=oe.state.features)==null?void 0:c.legalCheckbox,s=!!(e||r)&&!!n,o=s&&!this.checked,a=o?-1:void 0;return M`
- <w3m-legal-checkbox></w3m-legal-checkbox>
- <wui-flex
- flexDirection="column"
- .padding=${s?["0","s","s","s"]:"s"}
- gap="xs"
- class=${we(o?"disabled":void 0)}
- >
- <w3m-social-login-list tabIdx=${we(a)}></w3m-social-login-list>
- </wui-flex>
- <w3m-legal-footer></w3m-legal-footer>
- `}};jy.styles=hAe;WJ([G()],jy.prototype,"checked",void 0);jy=WJ([te("w3m-connect-socials-view")],jy);const fAe=de`
- :host {
- display: block;
- width: var(--wui-box-size-md);
- height: var(--wui-box-size-md);
- }
- svg {
- width: var(--wui-box-size-md);
- height: var(--wui-box-size-md);
- }
- rect {
- fill: none;
- stroke: var(--wui-color-accent-100);
- stroke-width: 4px;
- stroke-linecap: round;
- animation: dash 1s linear infinite;
- }
- @keyframes dash {
- to {
- stroke-dashoffset: 0px;
- }
- }
- `;var VJ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let u6=class extends se{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const e=this.radius>50?50:this.radius,n=36-e,i=116+n,s=245+n,o=360+n*1.75;return M`
- <svg viewBox="0 0 110 110" width="110" height="110">
- <rect
- x="2"
- y="2"
- width="106"
- height="106"
- rx=${e}
- stroke-dasharray="${i} ${s}"
- stroke-dashoffset=${o}
- />
- </svg>
- `}};u6.styles=[He,fAe];VJ([q({type:Number})],u6.prototype,"radius",void 0);u6=VJ([te("wui-loading-thumbnail")],u6);const pAe=de`
- wui-logo {
- width: 80px;
- height: 80px;
- border-radius: var(--wui-border-radius-m);
- }
- @keyframes shake {
- 0% {
- transform: translateX(0);
- }
- 25% {
- transform: translateX(3px);
- }
- 50% {
- transform: translateX(-3px);
- }
- 75% {
- transform: translateX(3px);
- }
- 100% {
- transform: translateX(0);
- }
- }
- wui-flex:first-child:not(:only-child) {
- position: relative;
- }
- wui-loading-thumbnail {
- position: absolute;
- }
- wui-icon-box {
- position: absolute;
- right: calc(var(--wui-spacing-3xs) * -1);
- bottom: calc(var(--wui-spacing-3xs) * -1);
- opacity: 0;
- transform: scale(0.5);
- transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
- }
- wui-text[align='center'] {
- width: 100%;
- padding: 0px var(--wui-spacing-l);
- }
- [data-error='true'] wui-icon-box {
- opacity: 1;
- transform: scale(1);
- }
- [data-error='true'] > wui-flex:first-child {
- animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
- }
- .capitalize {
- text-transform: capitalize;
- }
- `;var l1=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let ju=class extends se{constructor(){super(),this.unsubscribe=[],this.socialProvider=re.state.socialProvider,this.socialWindow=re.state.socialWindow,this.error=!1,this.connecting=!1,this.message="Connect in the provider window",this.authConnector=ge.getAuthConnector(),this.handleSocialConnection=async r=>{var n;if((n=r.data)!=null&&n.resultUri)if(r.origin===Fo.SECURE_SITE_ORIGIN){window.removeEventListener("message",this.handleSocialConnection,!1);try{if(this.authConnector&&!this.connecting){this.socialWindow&&(this.socialWindow.close(),re.setSocialWindow(void 0,F.state.activeChain)),this.connecting=!0,this.updateMessage();const i=r.data.resultUri;this.socialProvider&&Re.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:this.socialProvider}}),await xe.connectExternal({id:this.authConnector.id,type:this.authConnector.type,socialUri:i},this.authConnector.chain),this.socialProvider&&(Le.setConnectedSocialProvider(this.socialProvider),Re.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}))}}catch{this.error=!0,this.updateMessage(),this.socialProvider&&Re.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})}}else X.goBack(),Fe.showError("Untrusted Origin"),this.socialProvider&&Re.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})},Do.EmbeddedWalletAbortController.signal.addEventListener("abort",()=>{this.socialWindow&&(this.socialWindow.close(),re.setSocialWindow(void 0,F.state.activeChain))}),this.unsubscribe.push(re.subscribe(r=>{r.socialProvider&&(this.socialProvider=r.socialProvider),r.socialWindow&&(this.socialWindow=r.socialWindow),r.address&&(We.state.open||oe.state.enableEmbedded)&&We.close()})),this.authConnector&&this.connectSocial()}disconnectedCallback(){var e;this.unsubscribe.forEach(r=>r()),window.removeEventListener("message",this.handleSocialConnection,!1),(e=this.socialWindow)==null||e.close(),re.setSocialWindow(void 0,F.state.activeChain)}render(){return M`
- <wui-flex
- data-error=${we(this.error)}
- flexDirection="column"
- alignItems="center"
- .padding=${["3xl","xl","xl","xl"]}
- gap="xl"
- >
- <wui-flex justifyContent="center" alignItems="center">
- <wui-logo logo=${we(this.socialProvider)}></wui-logo>
- ${this.error?null:this.loaderTemplate()}
- <wui-icon-box
- backgroundColor="error-100"
- background="opaque"
- iconColor="error-100"
- icon="close"
- size="sm"
- border
- borderColor="wui-color-bg-125"
- ></wui-icon-box>
- </wui-flex>
- <wui-flex flexDirection="column" alignItems="center" gap="xs">
- <wui-text align="center" variant="paragraph-500" color="fg-100"
- >Log in with
- <span class="capitalize">${this.socialProvider??"Social"}</span></wui-text
- >
- <wui-text align="center" variant="small-400" color=${this.error?"error-100":"fg-200"}
- >${this.message}</wui-text
- ></wui-flex
- >
- </wui-flex>
- `}loaderTemplate(){const e=ar.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return M`<wui-loading-thumbnail radius=${r*9}></wui-loading-thumbnail>`}connectSocial(){const e=setInterval(()=>{var r;(r=this.socialWindow)!=null&&r.closed&&(!this.connecting&&X.state.view==="ConnectingSocial"&&(this.socialProvider&&Re.sendEvent({type:"track",event:"SOCIAL_LOGIN_CANCELED",properties:{provider:this.socialProvider}}),X.goBack()),clearInterval(e))},1e3);window.addEventListener("message",this.handleSocialConnection,!1)}updateMessage(){this.error?this.message="Something went wrong":this.connecting?this.message="Retrieving user data":this.message="Connect in the provider window"}};ju.styles=pAe;l1([G()],ju.prototype,"socialProvider",void 0);l1([G()],ju.prototype,"socialWindow",void 0);l1([G()],ju.prototype,"error",void 0);l1([G()],ju.prototype,"connecting",void 0);l1([G()],ju.prototype,"message",void 0);ju=l1([te("w3m-connecting-social-view")],ju);var p0={},NS,KB;function gAe(){return KB||(KB=1,NS=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),NS}var $S={},Al={},ZB;function xp(){if(ZB)return Al;ZB=1;let t;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Al.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},Al.getSymbolTotalCodewords=function(n){return e[n]},Al.getBCHDigit=function(r){let n=0;for(;r!==0;)n++,r>>>=1;return n},Al.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');t=n},Al.isKanjiModeEnabled=function(){return typeof t<"u"},Al.toSJIS=function(n){return t(n)},Al}var jS={},YB;function L7(){return YB||(YB=1,function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}}(jS)),jS}var BS,JB;function mAe(){if(JB)return BS;JB=1;function t(){this.buffer=[],this.length=0}return t.prototype={get:function(e){const r=Math.floor(e/8);return(this.buffer[r]>>>7-e%8&1)===1},put:function(e,r){for(let n=0;n<r;n++)this.putBit((e>>>r-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),e&&(this.buffer[r]|=128>>>this.length%8),this.length++}},BS=t,BS}var DS,QB;function wAe(){if(QB)return DS;QB=1;function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return t.prototype.set=function(e,r,n,i){const s=e*this.size+r;this.data[s]=n,i&&(this.reservedBit[s]=!0)},t.prototype.get=function(e,r){return this.data[e*this.size+r]},t.prototype.xor=function(e,r,n){this.data[e*this.size+r]^=n},t.prototype.isReserved=function(e,r){return this.reservedBit[e*this.size+r]},DS=t,DS}var MS={},XB;function bAe(){return XB||(XB=1,function(t){const e=xp().getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,s=e(n),o=s===145?26:Math.ceil((s-13)/(2*i-2))*2,a=[s-7];for(let c=1;c<i-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},t.getPositions=function(n){const i=[],s=t.getRowColCoords(n),o=s.length;for(let a=0;a<o;a++)for(let c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||i.push([s[a],s[c]]);return i}}(MS)),MS}var LS={},eD;function yAe(){if(eD)return LS;eD=1;const t=xp().getSymbolSize,e=7;return LS.getPositions=function(n){const i=t(n);return[[0,0],[i-e,0],[0,i-e]]},LS}var US={},tD;function vAe(){return tD||(tD=1,function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const s=i.size;let o=0,a=0,c=0,u=null,l=null;for(let d=0;d<s;d++){a=c=0,u=l=null;for(let h=0;h<s;h++){let f=i.get(d,h);f===u?a++:(a>=5&&(o+=e.N1+(a-5)),u=f,a=1),f=i.get(h,d),f===l?c++:(c>=5&&(o+=e.N1+(c-5)),l=f,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},t.getPenaltyN2=function(i){const s=i.size;let o=0;for(let a=0;a<s-1;a++)for(let c=0;c<s-1;c++){const u=i.get(a,c)+i.get(a,c+1)+i.get(a+1,c)+i.get(a+1,c+1);(u===4||u===0)&&o++}return o*e.N2},t.getPenaltyN3=function(i){const s=i.size;let o=0,a=0,c=0;for(let u=0;u<s;u++){a=c=0;for(let l=0;l<s;l++)a=a<<1&2047|i.get(u,l),l>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|i.get(l,u),l>=10&&(c===1488||c===93)&&o++}return o*e.N3},t.getPenaltyN4=function(i){let s=0;const o=i.data.length;for(let c=0;c<o;c++)s+=i.data[c];return Math.abs(Math.ceil(s*100/o/5)-10)*e.N4};function r(n,i,s){switch(n){case t.Patterns.PATTERN000:return(i+s)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(i+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return i*s%2+i*s%3===0;case t.Patterns.PATTERN110:return(i*s%2+i*s%3)%2===0;case t.Patterns.PATTERN111:return(i*s%3+(i+s)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,s){const o=s.size;for(let a=0;a<o;a++)for(let c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,r(i,c,a))},t.getBestMask=function(i,s){const o=Object.keys(t.Patterns).length;let a=0,c=1/0;for(let u=0;u<o;u++){s(u),t.applyMask(u,i);const l=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(u,i),l<c&&(c=l,a=u)}return a}}(US)),US}var P3={},rD;function GJ(){if(rD)return P3;rD=1;const t=L7(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return P3.getBlocksCount=function(i,s){switch(s){case t.L:return e[(i-1)*4+0];case t.M:return e[(i-1)*4+1];case t.Q:return e[(i-1)*4+2];case t.H:return e[(i-1)*4+3];default:return}},P3.getTotalCodewordsCount=function(i,s){switch(s){case t.L:return r[(i-1)*4+0];case t.M:return r[(i-1)*4+1];case t.Q:return r[(i-1)*4+2];case t.H:return r[(i-1)*4+3];default:return}},P3}var FS={},Q1={},nD;function _Ae(){if(nD)return Q1;nD=1;const t=new Uint8Array(512),e=new Uint8Array(256);return function(){let n=1;for(let i=0;i<255;i++)t[i]=n,e[n]=i,n<<=1,n&256&&(n^=285);for(let i=255;i<512;i++)t[i]=t[i-255]}(),Q1.log=function(n){if(n<1)throw new Error("log("+n+")");return e[n]},Q1.exp=function(n){return t[n]},Q1.mul=function(n,i){return n===0||i===0?0:t[e[n]+e[i]]},Q1}var iD;function EAe(){return iD||(iD=1,function(t){const e=_Ae();t.mul=function(n,i){const s=new Uint8Array(n.length+i.length-1);for(let o=0;o<n.length;o++)for(let a=0;a<i.length;a++)s[o+a]^=e.mul(n[o],i[a]);return s},t.mod=function(n,i){let s=new Uint8Array(n);for(;s.length-i.length>=0;){const o=s[0];for(let c=0;c<i.length;c++)s[c]^=e.mul(i[c],o);let a=0;for(;a<s.length&&s[a]===0;)a++;s=s.slice(a)}return s},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let s=0;s<n;s++)i=t.mul(i,new Uint8Array([1,e.exp(s)]));return i}}(FS)),FS}var HS,sD;function CAe(){if(sD)return HS;sD=1;const t=EAe();function e(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},e.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(n.length+this.degree);i.set(n);const s=t.mod(i,this.genPoly),o=this.degree-s.length;if(o>0){const a=new Uint8Array(this.degree);return a.set(s,o),a}return s},HS=e,HS}var qS={},zS={},WS={},oD;function KJ(){return oD||(oD=1,WS.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),WS}var Ea={},aD;function ZJ(){if(aD)return Ea;aD=1;const t="[0-9]+",e="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
- ]))+`;Ea.KANJI=new RegExp(r,"g"),Ea.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Ea.BYTE=new RegExp(n,"g"),Ea.NUMERIC=new RegExp(t,"g"),Ea.ALPHANUMERIC=new RegExp(e,"g");const i=new RegExp("^"+r+"$"),s=new RegExp("^"+t+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Ea.testKanji=function(c){return i.test(c)},Ea.testNumeric=function(c){return s.test(c)},Ea.testAlphanumeric=function(c){return o.test(c)},Ea}var cD;function Sp(){return cD||(cD=1,function(t){const e=KJ(),r=ZJ();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(s,o){if(t.isValid(s))return s;try{return n(s)}catch{return o}}}(zS)),zS}var uD;function AAe(){return uD||(uD=1,function(t){const e=xp(),r=GJ(),n=L7(),i=Sp(),s=KJ(),o=7973,a=e.getBCHDigit(o);function c(h,f,g){for(let p=1;p<=40;p++)if(f<=t.getCapacity(p,g,h))return p}function u(h,f){return i.getCharCountIndicator(h,f)+4}function l(h,f){let g=0;return h.forEach(function(p){const m=u(p.mode,f);g+=m+p.getBitsLength()}),g}function d(h,f){for(let g=1;g<=40;g++)if(l(h,g)<=t.getCapacity(g,f,i.MIXED))return g}t.from=function(f,g){return s.isValid(f)?parseInt(f,10):g},t.getCapacity=function(f,g,p){if(!s.isValid(f))throw new Error("Invalid QR Code version");typeof p>"u"&&(p=i.BYTE);const m=e.getSymbolTotalCodewords(f),b=r.getTotalCodewordsCount(f,g),v=(m-b)*8;if(p===i.MIXED)return v;const E=v-u(p,f);switch(p){case i.NUMERIC:return Math.floor(E/10*3);case i.ALPHANUMERIC:return Math.floor(E/11*2);case i.KANJI:return Math.floor(E/13);case i.BYTE:default:return Math.floor(E/8)}},t.getBestVersionForData=function(f,g){let p;const m=n.from(g,n.M);if(Array.isArray(f)){if(f.length>1)return d(f,m);if(f.length===0)return 1;p=f[0]}else p=f;return c(p.mode,p.getLength(),m)},t.getEncodedBits=function(f){if(!s.isValid(f)||f<7)throw new Error("Invalid QR Code version");let g=f<<12;for(;e.getBCHDigit(g)-a>=0;)g^=o<<e.getBCHDigit(g)-a;return f<<12|g}}(qS)),qS}var VS={},lD;function xAe(){if(lD)return VS;lD=1;const t=xp(),e=1335,r=21522,n=t.getBCHDigit(e);return VS.getEncodedBits=function(s,o){const a=s.bit<<3|o;let c=a<<10;for(;t.getBCHDigit(c)-n>=0;)c^=e<<t.getBCHDigit(c)-n;return(a<<10|c)^r},VS}var GS={},KS,dD;function SAe(){if(dD)return KS;dD=1;const t=Sp();function e(r){this.mode=t.NUMERIC,this.data=r.toString()}return e.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(n){let i,s,o;for(i=0;i+3<=this.data.length;i+=3)s=this.data.substr(i,3),o=parseInt(s,10),n.put(o,10);const a=this.data.length-i;a>0&&(s=this.data.substr(i),o=parseInt(s,10),n.put(o,a*3+1))},KS=e,KS}var ZS,hD;function TAe(){if(hD)return ZS;hD=1;const t=Sp(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=t.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(i){return 11*Math.floor(i/2)+6*(i%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(i){let s;for(s=0;s+2<=this.data.length;s+=2){let o=e.indexOf(this.data[s])*45;o+=e.indexOf(this.data[s+1]),i.put(o,11)}this.data.length%2&&i.put(e.indexOf(this.data[s]),6)},ZS=r,ZS}var YS,fD;function IAe(){return fD||(fD=1,YS=function(e){for(var r=[],n=e.length,i=0;i<n;i++){var s=e.charCodeAt(i);if(s>=55296&&s<=56319&&n>i+1){var o=e.charCodeAt(i+1);o>=56320&&o<=57343&&(s=(s-55296)*1024+o-56320+65536,i+=1)}if(s<128){r.push(s);continue}if(s<2048){r.push(s>>6|192),r.push(s&63|128);continue}if(s<55296||s>=57344&&s<65536){r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128);continue}if(s>=65536&&s<=1114111){r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer}),YS}var JS,pD;function PAe(){if(pD)return JS;pD=1;const t=IAe(),e=Sp();function r(n){this.mode=e.BYTE,typeof n=="string"&&(n=t(n)),this.data=new Uint8Array(n)}return r.getBitsLength=function(i){return i*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){for(let i=0,s=this.data.length;i<s;i++)n.put(this.data[i],8)},JS=r,JS}var QS,gD;function OAe(){if(gD)return QS;gD=1;const t=Sp(),e=xp();function r(n){this.mode=t.KANJI,this.data=n}return r.getBitsLength=function(i){return i*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){let i;for(i=0;i<this.data.length;i++){let s=e.toSJIS(this.data[i]);if(s>=33088&&s<=40956)s-=33088;else if(s>=57408&&s<=60351)s-=49472;else throw new Error("Invalid SJIS character: "+this.data[i]+`
- Make sure your charset is UTF-8`);s=(s>>>8&255)*192+(s&255),n.put(s,13)}},QS=r,QS}var XS={exports:{}},mD;function RAe(){return mD||(mD=1,function(t){var e={single_source_shortest_paths:function(r,n,i){var s={},o={};o[n]=0;var a=e.PriorityQueue.make();a.push(n,0);for(var c,u,l,d,h,f,g,p,m;!a.empty();){c=a.pop(),u=c.value,d=c.cost,h=r[u]||{};for(l in h)h.hasOwnProperty(l)&&(f=h[l],g=d+f,p=o[l],m=typeof o[l]>"u",(m||p>g)&&(o[l]=g,a.push(l,g),s[l]=u))}if(typeof i<"u"&&typeof o[i]>"u"){var b=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(b)}return s},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],s=n;s;)i.push(s),r[s],s=r[s];return i.reverse(),i},find_path:function(r,n,i){var s=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(s,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},s;r=r||{};for(s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e}(XS)),XS.exports}var wD;function kAe(){return wD||(wD=1,function(t){const e=Sp(),r=SAe(),n=TAe(),i=PAe(),s=OAe(),o=ZJ(),a=xp(),c=RAe();function u(b){return unescape(encodeURIComponent(b)).length}function l(b,v,E){const w=[];let C;for(;(C=b.exec(E))!==null;)w.push({data:C[0],index:C.index,mode:v,length:C[0].length});return w}function d(b){const v=l(o.NUMERIC,e.NUMERIC,b),E=l(o.ALPHANUMERIC,e.ALPHANUMERIC,b);let w,C;return a.isKanjiModeEnabled()?(w=l(o.BYTE,e.BYTE,b),C=l(o.KANJI,e.KANJI,b)):(w=l(o.BYTE_KANJI,e.BYTE,b),C=[]),v.concat(E,w,C).sort(function(_,x){return _.index-x.index}).map(function(_){return{data:_.data,mode:_.mode,length:_.length}})}function h(b,v){switch(v){case e.NUMERIC:return r.getBitsLength(b);case e.ALPHANUMERIC:return n.getBitsLength(b);case e.KANJI:return s.getBitsLength(b);case e.BYTE:return i.getBitsLength(b)}}function f(b){return b.reduce(function(v,E){const w=v.length-1>=0?v[v.length-1]:null;return w&&w.mode===E.mode?(v[v.length-1].data+=E.data,v):(v.push(E),v)},[])}function g(b){const v=[];for(let E=0;E<b.length;E++){const w=b[E];switch(w.mode){case e.NUMERIC:v.push([w,{data:w.data,mode:e.ALPHANUMERIC,length:w.length},{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.ALPHANUMERIC:v.push([w,{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.KANJI:v.push([w,{data:w.data,mode:e.BYTE,length:u(w.data)}]);break;case e.BYTE:v.push([{data:w.data,mode:e.BYTE,length:u(w.data)}])}}return v}function p(b,v){const E={},w={start:{}};let C=["start"];for(let y=0;y<b.length;y++){const _=b[y],x=[];for(let A=0;A<_.length;A++){const T=_[A],O=""+y+A;x.push(O),E[O]={node:T,lastCount:0},w[O]={};for(let k=0;k<C.length;k++){const j=C[k];E[j]&&E[j].node.mode===T.mode?(w[j][O]=h(E[j].lastCount+T.length,T.mode)-h(E[j].lastCount,T.mode),E[j].lastCount+=T.length):(E[j]&&(E[j].lastCount=T.length),w[j][O]=h(T.length,T.mode)+4+e.getCharCountIndicator(T.mode,v))}}C=x}for(let y=0;y<C.length;y++)w[C[y]].end=0;return{map:w,table:E}}function m(b,v){let E;const w=e.getBestModeForData(b);if(E=e.from(v,w),E!==e.BYTE&&E.bit<w.bit)throw new Error('"'+b+'" cannot be encoded with mode '+e.toString(E)+`.
- Suggested mode is: `+e.toString(w));switch(E===e.KANJI&&!a.isKanjiModeEnabled()&&(E=e.BYTE),E){case e.NUMERIC:return new r(b);case e.ALPHANUMERIC:return new n(b);case e.KANJI:return new s(b);case e.BYTE:return new i(b)}}t.fromArray=function(v){return v.reduce(function(E,w){return typeof w=="string"?E.push(m(w,null)):w.data&&E.push(m(w.data,w.mode)),E},[])},t.fromString=function(v,E){const w=d(v,a.isKanjiModeEnabled()),C=g(w),y=p(C,E),_=c.find_path(y.map,"start","end"),x=[];for(let A=1;A<_.length-1;A++)x.push(y.table[_[A]].node);return t.fromArray(f(x))},t.rawSplit=function(v){return t.fromArray(d(v,a.isKanjiModeEnabled()))}}(GS)),GS}var bD;function NAe(){if(bD)return $S;bD=1;const t=xp(),e=L7(),r=mAe(),n=wAe(),i=bAe(),s=yAe(),o=vAe(),a=GJ(),c=CAe(),u=AAe(),l=xAe(),d=Sp(),h=kAe();function f(y,_){const x=y.size,A=s.getPositions(_);for(let T=0;T<A.length;T++){const O=A[T][0],k=A[T][1];for(let j=-1;j<=7;j++)if(!(O+j<=-1||x<=O+j))for(let N=-1;N<=7;N++)k+N<=-1||x<=k+N||(j>=0&&j<=6&&(N===0||N===6)||N>=0&&N<=6&&(j===0||j===6)||j>=2&&j<=4&&N>=2&&N<=4?y.set(O+j,k+N,!0,!0):y.set(O+j,k+N,!1,!0))}}function g(y){const _=y.size;for(let x=8;x<_-8;x++){const A=x%2===0;y.set(x,6,A,!0),y.set(6,x,A,!0)}}function p(y,_){const x=i.getPositions(_);for(let A=0;A<x.length;A++){const T=x[A][0],O=x[A][1];for(let k=-2;k<=2;k++)for(let j=-2;j<=2;j++)k===-2||k===2||j===-2||j===2||k===0&&j===0?y.set(T+k,O+j,!0,!0):y.set(T+k,O+j,!1,!0)}}function m(y,_){const x=y.size,A=u.getEncodedBits(_);let T,O,k;for(let j=0;j<18;j++)T=Math.floor(j/3),O=j%3+x-8-3,k=(A>>j&1)===1,y.set(T,O,k,!0),y.set(O,T,k,!0)}function b(y,_,x){const A=y.size,T=l.getEncodedBits(_,x);let O,k;for(O=0;O<15;O++)k=(T>>O&1)===1,O<6?y.set(O,8,k,!0):O<8?y.set(O+1,8,k,!0):y.set(A-15+O,8,k,!0),O<8?y.set(8,A-O-1,k,!0):O<9?y.set(8,15-O-1+1,k,!0):y.set(8,15-O-1,k,!0);y.set(A-8,8,1,!0)}function v(y,_){const x=y.size;let A=-1,T=x-1,O=7,k=0;for(let j=x-1;j>0;j-=2)for(j===6&&j--;;){for(let N=0;N<2;N++)if(!y.isReserved(T,j-N)){let S=!1;k<_.length&&(S=(_[k]>>>O&1)===1),y.set(T,j-N,S),O--,O===-1&&(k++,O=7)}if(T+=A,T<0||x<=T){T-=A,A=-A;break}}}function E(y,_,x){const A=new r;x.forEach(function(N){A.put(N.mode.bit,4),A.put(N.getLength(),d.getCharCountIndicator(N.mode,y)),N.write(A)});const T=t.getSymbolTotalCodewords(y),O=a.getTotalCodewordsCount(y,_),k=(T-O)*8;for(A.getLengthInBits()+4<=k&&A.put(0,4);A.getLengthInBits()%8!==0;)A.putBit(0);const j=(k-A.getLengthInBits())/8;for(let N=0;N<j;N++)A.put(N%2?17:236,8);return w(A,y,_)}function w(y,_,x){const A=t.getSymbolTotalCodewords(_),T=a.getTotalCodewordsCount(_,x),O=A-T,k=a.getBlocksCount(_,x),j=A%k,N=k-j,S=Math.floor(A/k),P=Math.floor(O/k),I=P+1,B=S-P,$=new c(B);let R=0;const D=new Array(k),L=new Array(k);let U=0;const z=new Uint8Array(y.buffer);for(let ae=0;ae<k;ae++){const he=ae<N?P:I;D[ae]=z.slice(R,R+he),L[ae]=$.encode(D[ae]),R+=he,U=Math.max(U,he)}const W=new Uint8Array(A);let K=0,J,ne;for(J=0;J<U;J++)for(ne=0;ne<k;ne++)J<D[ne].length&&(W[K++]=D[ne][J]);for(J=0;J<B;J++)for(ne=0;ne<k;ne++)W[K++]=L[ne][J];return W}function C(y,_,x,A){let T;if(Array.isArray(y))T=h.fromArray(y);else if(typeof y=="string"){let S=_;if(!S){const P=h.rawSplit(y);S=u.getBestVersionForData(P,x)}T=h.fromString(y,S||40)}else throw new Error("Invalid data");const O=u.getBestVersionForData(T,x);if(!O)throw new Error("The amount of data is too big to be stored in a QR Code");if(!_)_=O;else if(_<O)throw new Error(`
- The chosen QR Code version cannot contain this amount of data.
- Minimum version required to store current data is: `+O+`.
- `);const k=E(_,x,T),j=t.getSymbolSize(_),N=new n(j);return f(N,_),g(N),p(N,_),b(N,x,0),_>=7&&m(N,_),v(N,k),isNaN(A)&&(A=o.getBestMask(N,b.bind(null,N,x))),o.applyMask(A,N),b(N,x,A),{modules:N,version:_,errorCorrectionLevel:x,maskPattern:A,segments:T}}return $S.create=function(_,x){if(typeof _>"u"||_==="")throw new Error("No input text");let A=e.M,T,O;return typeof x<"u"&&(A=e.from(x.errorCorrectionLevel,e.M),T=u.from(x.version),O=o.from(x.maskPattern),x.toSJISFunc&&t.setToSJISFunction(x.toSJISFunc)),C(_,T,A,O)},$S}var eT={},tT={},yD;function YJ(){return yD||(yD=1,function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(s){return[s,s]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,s=n.width&&n.width>=21?n.width:void 0,o=n.scale||4;return{width:s,scale:s?4:o,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const s=t.getScale(n,i);return Math.floor((n+i.margin*2)*s)},t.qrToImageData=function(n,i,s){const o=i.modules.size,a=i.modules.data,c=t.getScale(o,s),u=Math.floor((o+s.margin*2)*c),l=s.margin*c,d=[s.color.light,s.color.dark];for(let h=0;h<u;h++)for(let f=0;f<u;f++){let g=(h*u+f)*4,p=s.color.light;if(h>=l&&f>=l&&h<u-l&&f<u-l){const m=Math.floor((h-l)/c),b=Math.floor((f-l)/c);p=d[a[m*o+b]?1:0]}n[g++]=p.r,n[g++]=p.g,n[g++]=p.b,n[g]=p.a}}}(tT)),tT}var vD;function $Ae(){return vD||(vD=1,function(t){const e=YJ();function r(i,s,o){i.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=o,s.width=o,s.style.height=o+"px",s.style.width=o+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(s,o,a){let c=a,u=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(u=n()),c=e.getOptions(c);const l=e.getImageWidth(s.modules.size,c),d=u.getContext("2d"),h=d.createImageData(l,l);return e.qrToImageData(h.data,s,c),r(d,u,l),d.putImageData(h,0,0),u},t.renderToDataURL=function(s,o,a){let c=a;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const u=t.render(s,o,c),l=c.type||"image/png",d=c.rendererOpts||{};return u.toDataURL(l,d.quality)}}(eT)),eT}var rT={},_D;function jAe(){if(_D)return rT;_D=1;const t=YJ();function e(i,s){const o=i.a/255,a=s+'="'+i.hex+'"';return o<1?a+" "+s+'-opacity="'+o.toFixed(2).slice(1)+'"':a}function r(i,s,o){let a=i+s;return typeof o<"u"&&(a+=" "+o),a}function n(i,s,o){let a="",c=0,u=!1,l=0;for(let d=0;d<i.length;d++){const h=Math.floor(d%s),f=Math.floor(d/s);!h&&!u&&(u=!0),i[d]?(l++,d>0&&h>0&&i[d-1]||(a+=u?r("M",h+o,.5+f+o):r("m",c,0),c=0,u=!1),h+1<s&&i[d+1]||(a+=r("h",l),l=0)):c++}return a}return rT.render=function(s,o,a){const c=t.getOptions(o),u=s.modules.size,l=s.modules.data,d=u+c.margin*2,h=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+d+"v"+d+'H0z"/>':"",f="<path "+e(c.color.dark,"stroke")+' d="'+n(l,u,c.margin)+'"/>',g='viewBox="0 0 '+d+" "+d+'"',m='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+g+' shape-rendering="crispEdges">'+h+f+`</svg>
- `;return typeof a=="function"&&a(null,m),m},rT}var ED;function BAe(){if(ED)return p0;ED=1;const t=gAe(),e=NAe(),r=$Ae(),n=jAe();function i(s,o,a,c,u){const l=[].slice.call(arguments,1),d=l.length,h=typeof l[d-1]=="function";if(!h&&!t())throw new Error("Callback required as last argument");if(h){if(d<2)throw new Error("Too few arguments provided");d===2?(u=a,a=o,o=c=void 0):d===3&&(o.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=a,a=o,o=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(a=o,o=c=void 0):d===2&&!o.getContext&&(c=a,a=o,o=void 0),new Promise(function(f,g){try{const p=e.create(a,c);f(s(p,o,c))}catch(p){g(p)}})}try{const f=e.create(a,c);u(null,s(f,o,c))}catch(f){u(f)}}return p0.create=e.create,p0.toCanvas=i.bind(null,r.render),p0.toDataURL=i.bind(null,r.renderToDataURL),p0.toString=i.bind(null,function(s,o,a){return n.render(s,a)}),p0}var DAe=BAe();const MAe=cc(DAe),LAe=.1,CD=2.5,Sc=7;function nT(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+LAe}function UAe(t,e){const r=Array.prototype.slice.call(MAe.create(t,{errorCorrectionLevel:e}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((i,s,o)=>(o%n===0?i.push([s]):i[i.length-1].push(s))&&i,[])}const FAe={generate({uri:t,size:e,logoSize:r,dotColor:n="#141414"}){const i="transparent",o=[],a=UAe(t,"Q"),c=e/a.length,u=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];u.forEach(({x:p,y:m})=>{const b=(a.length-Sc)*c*p,v=(a.length-Sc)*c*m,E=.45;for(let w=0;w<u.length;w+=1){const C=c*(Sc-w*2);o.push(Se`
- <rect
- fill=${w===2?n:i}
- width=${w===0?C-5:C}
- rx= ${w===0?(C-5)*E:C*E}
- ry= ${w===0?(C-5)*E:C*E}
- stroke=${n}
- stroke-width=${w===0?5:0}
- height=${w===0?C-5:C}
- x= ${w===0?v+c*w+5/2:v+c*w}
- y= ${w===0?b+c*w+5/2:b+c*w}
- />
- `)}});const l=Math.floor((r+25)/c),d=a.length/2-l/2,h=a.length/2+l/2-1,f=[];a.forEach((p,m)=>{p.forEach((b,v)=>{if(a[m][v]&&!(m<Sc&&v<Sc||m>a.length-(Sc+1)&&v<Sc||m<Sc&&v>a.length-(Sc+1))&&!(m>d&&m<h&&v>d&&v<h)){const E=m*c+c/2,w=v*c+c/2;f.push([E,w])}})});const g={};return f.forEach(([p,m])=>{var b;g[p]?(b=g[p])==null||b.push(m):g[p]=[m]}),Object.entries(g).map(([p,m])=>{const b=m.filter(v=>m.every(E=>!nT(v,E,c)));return[Number(p),b]}).forEach(([p,m])=>{m.forEach(b=>{o.push(Se`<circle cx=${p} cy=${b} fill=${n} r=${c/CD} />`)})}),Object.entries(g).filter(([p,m])=>m.length>1).map(([p,m])=>{const b=m.filter(v=>m.some(E=>nT(v,E,c)));return[Number(p),b]}).map(([p,m])=>{m.sort((v,E)=>v<E?-1:1);const b=[];for(const v of m){const E=b.find(w=>w.some(C=>nT(v,C,c)));E?E.push(v):b.push([v])}return[p,b.map(v=>[v[0],v[v.length-1]])]}).forEach(([p,m])=>{m.forEach(([b,v])=>{o.push(Se`
- <line
- x1=${p}
- x2=${p}
- y1=${b}
- y2=${v}
- stroke=${n}
- stroke-width=${c/(CD/2)}
- stroke-linecap="round"
- />
- `)})}),o}},HAe=de`
- :host {
- position: relative;
- user-select: none;
- display: block;
- overflow: hidden;
- aspect-ratio: 1 / 1;
- width: var(--local-size);
- }
- :host([data-theme='dark']) {
- border-radius: clamp(0px, var(--wui-border-radius-l), 40px);
- background-color: var(--wui-color-inverse-100);
- padding: var(--wui-spacing-l);
- }
- :host([data-theme='light']) {
- box-shadow: 0 0 0 1px var(--wui-color-bg-125);
- background-color: var(--wui-color-bg-125);
- }
- :host([data-clear='true']) > wui-icon {
- display: none;
- }
- svg:first-child,
- wui-image,
- wui-icon {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translateY(-50%) translateX(-50%);
- }
- wui-image {
- width: 25%;
- height: 25%;
- border-radius: var(--wui-border-radius-xs);
- }
- wui-icon {
- width: 100%;
- height: 100%;
- color: var(--local-icon-color) !important;
- transform: translateY(-50%) translateX(-50%) scale(0.25);
- }
- `;var Yu=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const qAe="#3396ff";let Yo=class extends se{constructor(){super(...arguments),this.uri="",this.size=0,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),this.style.cssText=`
- --local-size: ${this.size}px;
- --local-icon-color: ${this.color??qAe}
- `,M`${this.templateVisual()} ${this.templateSvg()}`}templateSvg(){const e=this.theme==="light"?this.size:this.size-32;return Se`
- <svg height=${e} width=${e}>
- ${FAe.generate({uri:this.uri,size:e,logoSize:this.arenaClear?0:e/4,dotColor:this.color})}
- </svg>
- `}templateVisual(){return this.imageSrc?M`<wui-image src=${this.imageSrc} alt=${this.alt??"logo"}></wui-image>`:this.farcaster?M`<wui-icon
- class="farcaster"
- size="inherit"
- color="inherit"
- name="farcaster"
- ></wui-icon>`:M`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`}};Yo.styles=[He,HAe];Yu([q()],Yo.prototype,"uri",void 0);Yu([q({type:Number})],Yo.prototype,"size",void 0);Yu([q()],Yo.prototype,"theme",void 0);Yu([q()],Yo.prototype,"imageSrc",void 0);Yu([q()],Yo.prototype,"alt",void 0);Yu([q()],Yo.prototype,"color",void 0);Yu([q({type:Boolean})],Yo.prototype,"arenaClear",void 0);Yu([q({type:Boolean})],Yo.prototype,"farcaster",void 0);Yo=Yu([te("wui-qr-code")],Yo);const zAe=de`
- :host {
- display: block;
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
- background: linear-gradient(
- 120deg,
- var(--wui-color-bg-200) 5%,
- var(--wui-color-bg-200) 48%,
- var(--wui-color-bg-300) 55%,
- var(--wui-color-bg-300) 60%,
- var(--wui-color-bg-300) calc(60% + 10px),
- var(--wui-color-bg-200) calc(60% + 12px),
- var(--wui-color-bg-200) 100%
- );
- background-size: 250%;
- animation: shimmer 3s linear infinite reverse;
- }
- :host([variant='light']) {
- background: linear-gradient(
- 120deg,
- var(--wui-color-bg-150) 5%,
- var(--wui-color-bg-150) 48%,
- var(--wui-color-bg-200) 55%,
- var(--wui-color-bg-200) 60%,
- var(--wui-color-bg-200) calc(60% + 10px),
- var(--wui-color-bg-150) calc(60% + 12px),
- var(--wui-color-bg-150) 100%
- );
- background-size: 250%;
- }
- @keyframes shimmer {
- from {
- background-position: -250% 0;
- }
- to {
- background-position: 250% 0;
- }
- }
- `;var t2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let rp=class extends se{constructor(){super(...arguments),this.width="",this.height="",this.borderRadius="m",this.variant="default"}render(){return this.style.cssText=`
- width: ${this.width};
- height: ${this.height};
- border-radius: ${`clamp(0px,var(--wui-border-radius-${this.borderRadius}), 40px)`};
- `,M`<slot></slot>`}};rp.styles=[zAe];t2([q()],rp.prototype,"width",void 0);t2([q()],rp.prototype,"height",void 0);t2([q()],rp.prototype,"borderRadius",void 0);t2([q()],rp.prototype,"variant",void 0);rp=t2([te("wui-shimmer")],rp);const WAe=de`
- @keyframes fadein {
- from {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
- }
- wui-shimmer {
- width: 100%;
- aspect-ratio: 1 / 1;
- border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
- }
- wui-qr-code {
- opacity: 0;
- animation-duration: 200ms;
- animation-timing-function: ease;
- animation-name: fadein;
- animation-fill-mode: forwards;
- }
- wui-logo {
- width: 80px;
- height: 80px;
- border-radius: var(--wui-border-radius-m);
- }
- wui-flex:first-child:not(:only-child) {
- position: relative;
- }
- wui-loading-thumbnail {
- position: absolute;
- }
- wui-icon-box {
- position: absolute;
- right: calc(var(--wui-spacing-3xs) * -1);
- bottom: calc(var(--wui-spacing-3xs) * -1);
- opacity: 0;
- transform: scale(0.5);
- transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
- }
- `;var r2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Cd=class extends se{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.socialProvider=re.state.socialProvider,this.uri=re.state.farcasterUrl,this.ready=!1,this.loading=!1,this.authConnector=ge.getAuthConnector(),this.forceUpdate=()=>{this.requestUpdate()},this.unsubscribe.push(re.subscribeKey("farcasterUrl",e=>{e&&(this.uri=e,this.connectFarcaster())}),re.subscribeKey("socialProvider",e=>{e&&(this.socialProvider=e)})),window.addEventListener("resize",this.forceUpdate)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.timeout),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),M`${this.platformTemplate()}`}platformTemplate(){return ue.isMobile()?M`${this.mobileTemplate()}`:M`${this.desktopTemplate()}`}desktopTemplate(){return this.loading?M`${this.loadingTemplate()}`:M`${this.qrTemplate()}`}qrTemplate(){return M` <wui-flex
- flexDirection="column"
- alignItems="center"
- .padding=${["0","xl","xl","xl"]}
- gap="xl"
- >
- <wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
- <wui-text variant="paragraph-500" color="fg-100">
- Scan this QR Code with your phone
- </wui-text>
- ${this.copyTemplate()}
- </wui-flex>`}loadingTemplate(){return M`
- <wui-flex
- flexDirection="column"
- alignItems="center"
- .padding=${["xl","xl","xl","xl"]}
- gap="xl"
- >
- <wui-flex justifyContent="center" alignItems="center">
- <wui-logo logo="farcaster"></wui-logo>
- ${this.loaderTemplate()}
- <wui-icon-box
- backgroundColor="error-100"
- background="opaque"
- iconColor="error-100"
- icon="close"
- size="sm"
- border
- borderColor="wui-color-bg-125"
- ></wui-icon-box>
- </wui-flex>
- <wui-flex flexDirection="column" alignItems="center" gap="xs">
- <wui-text align="center" variant="paragraph-500" color="fg-100">
- Loading user data
- </wui-text>
- <wui-text align="center" variant="small-400" color="fg-200">
- Please wait a moment while we load your data.
- </wui-text>
- </wui-flex>
- </wui-flex>
- `}mobileTemplate(){return M` <wui-flex
- flexDirection="column"
- alignItems="center"
- .padding=${["3xl","xl","xl","xl"]}
- gap="xl"
- >
- <wui-flex justifyContent="center" alignItems="center">
- <wui-logo logo="farcaster"></wui-logo>
- ${this.loaderTemplate()}
- <wui-icon-box
- backgroundColor="error-100"
- background="opaque"
- iconColor="error-100"
- icon="close"
- size="sm"
- border
- borderColor="wui-color-bg-125"
- ></wui-icon-box>
- </wui-flex>
- <wui-flex flexDirection="column" alignItems="center" gap="xs">
- <wui-text align="center" variant="paragraph-500" color="fg-100"
- >Continue in Farcaster</span></wui-text
- >
- <wui-text align="center" variant="small-400" color="fg-200"
- >Accept connection request in the app</wui-text
- ></wui-flex
- >
- ${this.mobileLinkTemplate()}
- </wui-flex>`}loaderTemplate(){const e=ar.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return M`<wui-loading-thumbnail radius=${r*9}></wui-loading-thumbnail>`}async connectFarcaster(){var e;if(this.authConnector)try{await((e=this.authConnector)==null?void 0:e.provider.connectFarcaster()),this.socialProvider&&(Le.setConnectedSocialProvider(this.socialProvider),Re.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:this.socialProvider}})),this.loading=!0,await xe.connectExternal(this.authConnector,this.authConnector.chain),this.socialProvider&&Re.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}),this.loading=!1,We.close()}catch(r){this.socialProvider&&Re.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}}),X.goBack(),Fe.showError(r)}}mobileLinkTemplate(){return M`<wui-button
- size="md"
- ?loading=${this.loading}
- ?disabled=${!this.uri||this.loading}
- @click=${()=>{this.uri&&ue.openHref(this.uri,"_blank")}}
- >
- Open farcaster</wui-button
- >`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40;return M` <wui-qr-code
- size=${e}
- theme=${ar.state.themeMode}
- uri=${this.uri}
- ?farcaster=${!0}
- data-testid="wui-qr-code"
- color=${we(ar.state.themeVariables["--w3m-qr-color"])}
- ></wui-qr-code>`}copyTemplate(){const e=!this.uri||!this.ready;return M`<wui-link
- .disabled=${e}
- @click=${this.onCopyUri}
- color="fg-200"
- data-testid="copy-wc2-uri"
- >
- <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
- Copy link
- </wui-link>`}onCopyUri(){try{this.uri&&(ue.copyToClopboard(this.uri),Fe.showSuccess("Link copied"))}catch{Fe.showError("Failed to copy")}}};Cd.styles=WAe;r2([G()],Cd.prototype,"socialProvider",void 0);r2([G()],Cd.prototype,"uri",void 0);r2([G()],Cd.prototype,"ready",void 0);r2([G()],Cd.prototype,"loading",void 0);Cd=r2([te("w3m-connecting-farcaster-view")],Cd);const VAe=Object.freeze(Object.defineProperty({__proto__:null,get W3mConnectSocialsView(){return jy},get W3mConnectingFarcasterView(){return Cd},get W3mConnectingSocialView(){return ju}},Symbol.toStringTag,{value:"Module"})),GAe=de`
- :host {
- width: 100%;
- display: block;
- }
- `;var U7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let By=class extends se{constructor(){super(),this.unsubscribe=[],this.text="",this.open=_s.state.open,this.unsubscribe.push(X.subscribeKey("view",()=>{_s.hide()}),We.subscribeKey("open",e=>{e||_s.hide()}),_s.subscribeKey("open",e=>{this.open=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),_s.hide()}render(){return M`
- <div
- @pointermove=${this.onMouseEnter.bind(this)}
- @pointerleave=${this.onMouseLeave.bind(this)}
- >
- ${this.renderChildren()}
- </div>
- `}renderChildren(){return M`<slot></slot> `}onMouseEnter(){const e=this.getBoundingClientRect();this.open||_s.showTooltip({message:this.text,triggerRect:{width:e.width,height:e.height,left:e.left,top:e.top},variant:"shade"})}onMouseLeave(e){this.contains(e.relatedTarget)||_s.hide()}};By.styles=[GAe];U7([q()],By.prototype,"text",void 0);U7([G()],By.prototype,"open",void 0);By=U7([te("w3m-tooltip-trigger")],By);const KAe=de`
- :host {
- pointer-events: none;
- }
- :host > wui-flex {
- display: var(--w3m-tooltip-display);
- opacity: var(--w3m-tooltip-opacity);
- padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s);
- border-radius: var(--wui-border-radius-xxs);
- color: var(--wui-color-bg-100);
- position: fixed;
- top: var(--w3m-tooltip-top);
- left: var(--w3m-tooltip-left);
- transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px));
- max-width: calc(var(--w3m-modal-width) - var(--wui-spacing-xl));
- transition: opacity 0.2s var(--wui-ease-out-power-2);
- will-change: opacity;
- }
- :host([data-variant='shade']) > wui-flex {
- background-color: var(--wui-color-bg-150);
- border: 1px solid var(--wui-color-gray-glass-005);
- }
- :host([data-variant='shade']) > wui-flex > wui-text {
- color: var(--wui-color-fg-150);
- }
- :host([data-variant='fill']) > wui-flex {
- background-color: var(--wui-color-fg-100);
- border: none;
- }
- wui-icon {
- position: absolute;
- width: 12px !important;
- height: 4px !important;
- color: var(--wui-color-bg-150);
- }
- wui-icon[data-placement='top'] {
- bottom: 0px;
- left: 50%;
- transform: translate(-50%, 95%);
- }
- wui-icon[data-placement='bottom'] {
- top: 0;
- left: 50%;
- transform: translate(-50%, -95%) rotate(180deg);
- }
- wui-icon[data-placement='right'] {
- top: 50%;
- left: 0;
- transform: translate(-65%, -50%) rotate(90deg);
- }
- wui-icon[data-placement='left'] {
- top: 50%;
- right: 0%;
- transform: translate(65%, -50%) rotate(270deg);
- }
- `;var n2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let np=class extends se{constructor(){super(),this.unsubscribe=[],this.open=_s.state.open,this.message=_s.state.message,this.triggerRect=_s.state.triggerRect,this.variant=_s.state.variant,this.unsubscribe.push(_s.subscribe(e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){this.dataset.variant=this.variant;const e=this.triggerRect.top,r=this.triggerRect.left;return this.style.cssText=`
- --w3m-tooltip-top: ${e}px;
- --w3m-tooltip-left: ${r}px;
- --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px;
- --w3m-tooltip-display: ${this.open?"flex":"none"};
- --w3m-tooltip-opacity: ${this.open?1:0};
- `,M`<wui-flex>
- <wui-icon data-placement="top" color="fg-100" size="inherit" name="cursor"></wui-icon>
- <wui-text color="inherit" variant="small-500">${this.message}</wui-text>
- </wui-flex>`}};np.styles=[KAe];n2([G()],np.prototype,"open",void 0);n2([G()],np.prototype,"message",void 0);n2([G()],np.prototype,"triggerRect",void 0);n2([G()],np.prototype,"variant",void 0);np=n2([te("w3m-tooltip"),te("w3m-tooltip")],np);const ZAe=de`
- :host {
- width: 100%;
- }
- .details-container > wui-flex {
- background: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xxs);
- width: 100%;
- }
- .details-container > wui-flex > button {
- border: none;
- background: none;
- padding: var(--wui-spacing-s);
- border-radius: var(--wui-border-radius-xxs);
- cursor: pointer;
- }
- .details-content-container {
- padding: var(--wui-spacing-1xs);
- padding-top: 0px;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .details-content-container > wui-flex {
- width: 100%;
- }
- .details-row {
- width: 100%;
- padding: var(--wui-spacing-s);
- padding-left: var(--wui-spacing-s);
- padding-right: var(--wui-spacing-1xs);
- border-radius: calc(var(--wui-border-radius-5xs) + var(--wui-border-radius-4xs));
- background: var(--wui-color-gray-glass-002);
- }
- .details-row-title {
- white-space: nowrap;
- }
- .details-row.provider-free-row {
- padding-right: var(--wui-spacing-xs);
- }
- `;var lo=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const YAe=ct.CONVERT_SLIPPAGE_TOLERANCE;let Yi=class extends se{constructor(){var e;super(),this.unsubscribe=[],this.networkName=(e=F.state.activeCaipNetwork)==null?void 0:e.name,this.detailsOpen=!1,this.sourceToken=ye.state.sourceToken,this.toToken=ye.state.toToken,this.toTokenAmount=ye.state.toTokenAmount,this.sourceTokenPriceInUSD=ye.state.sourceTokenPriceInUSD,this.toTokenPriceInUSD=ye.state.toTokenPriceInUSD,this.priceImpact=ye.state.priceImpact,this.maxSlippage=ye.state.maxSlippage,this.networkTokenSymbol=ye.state.networkTokenSymbol,this.inputError=ye.state.inputError,this.unsubscribe.push(ye.subscribe(r=>{this.sourceToken=r.sourceToken,this.toToken=r.toToken,this.toTokenAmount=r.toTokenAmount,this.priceImpact=r.priceImpact,this.maxSlippage=r.maxSlippage,this.sourceTokenPriceInUSD=r.sourceTokenPriceInUSD,this.toTokenPriceInUSD=r.toTokenPriceInUSD,this.inputError=r.inputError}))}render(){const e=this.toTokenAmount&&this.maxSlippage?Dt.bigNumber(this.toTokenAmount).minus(this.maxSlippage).toString():null;if(!this.sourceToken||!this.toToken||this.inputError)return null;const r=this.sourceTokenPriceInUSD&&this.toTokenPriceInUSD?1/this.toTokenPriceInUSD*this.sourceTokenPriceInUSD:0;return M`
- <wui-flex flexDirection="column" alignItems="center" gap="1xs" class="details-container">
- <wui-flex flexDirection="column">
- <button @click=${this.toggleDetails.bind(this)}>
- <wui-flex justifyContent="space-between" .padding=${["0","xs","0","xs"]}>
- <wui-flex justifyContent="flex-start" flexGrow="1" gap="xs">
- <wui-text variant="small-400" color="fg-100">
- 1 ${this.sourceToken.symbol} =
- ${nt.formatNumberToLocalString(r,3)}
- ${this.toToken.symbol}
- </wui-text>
- <wui-text variant="small-400" color="fg-200">
- $${nt.formatNumberToLocalString(this.sourceTokenPriceInUSD)}
- </wui-text>
- </wui-flex>
- <wui-icon name="chevronBottom"></wui-icon>
- </wui-flex>
- </button>
- ${this.detailsOpen?M`
- <wui-flex flexDirection="column" gap="xs" class="details-content-container">
- ${this.priceImpact?M` <wui-flex flexDirection="column" gap="xs">
- <wui-flex
- justifyContent="space-between"
- alignItems="center"
- class="details-row"
- >
- <wui-flex alignItems="center" gap="xs">
- <wui-text class="details-row-title" variant="small-400" color="fg-150">
- Price impact
- </wui-text>
- <w3m-tooltip-trigger
- text="Price impact reflects the change in market price due to your trade"
- >
- <wui-icon size="xs" color="fg-250" name="infoCircle"></wui-icon>
- </w3m-tooltip-trigger>
- </wui-flex>
- <wui-flex>
- <wui-text variant="small-400" color="fg-200">
- ${nt.formatNumberToLocalString(this.priceImpact,3)}%
- </wui-text>
- </wui-flex>
- </wui-flex>
- </wui-flex>`:null}
- ${this.maxSlippage&&this.sourceToken.symbol?M`<wui-flex flexDirection="column" gap="xs">
- <wui-flex
- justifyContent="space-between"
- alignItems="center"
- class="details-row"
- >
- <wui-flex alignItems="center" gap="xs">
- <wui-text class="details-row-title" variant="small-400" color="fg-150">
- Max. slippage
- </wui-text>
- <w3m-tooltip-trigger
- text=${`Max slippage sets the minimum amount you must receive for the transaction to proceed. ${e?`Transaction will be reversed if you receive less than ${nt.formatNumberToLocalString(e,6)} ${this.toToken.symbol} due to price changes.`:""}`}
- >
- <wui-icon size="xs" color="fg-250" name="infoCircle"></wui-icon>
- </w3m-tooltip-trigger>
- </wui-flex>
- <wui-flex>
- <wui-text variant="small-400" color="fg-200">
- ${nt.formatNumberToLocalString(this.maxSlippage,6)}
- ${this.toToken.symbol} ${YAe}%
- </wui-text>
- </wui-flex>
- </wui-flex>
- </wui-flex>`:null}
- <wui-flex flexDirection="column" gap="xs">
- <wui-flex
- justifyContent="space-between"
- alignItems="center"
- class="details-row provider-free-row"
- >
- <wui-flex alignItems="center" gap="xs">
- <wui-text class="details-row-title" variant="small-400" color="fg-150">
- Provider fee
- </wui-text>
- </wui-flex>
- <wui-flex>
- <wui-text variant="small-400" color="fg-200">0.85%</wui-text>
- </wui-flex>
- </wui-flex>
- </wui-flex>
- </wui-flex>
- `:null}
- </wui-flex>
- </wui-flex>
- `}toggleDetails(){this.detailsOpen=!this.detailsOpen}};Yi.styles=[ZAe];lo([G()],Yi.prototype,"networkName",void 0);lo([q()],Yi.prototype,"detailsOpen",void 0);lo([G()],Yi.prototype,"sourceToken",void 0);lo([G()],Yi.prototype,"toToken",void 0);lo([G()],Yi.prototype,"toTokenAmount",void 0);lo([G()],Yi.prototype,"sourceTokenPriceInUSD",void 0);lo([G()],Yi.prototype,"toTokenPriceInUSD",void 0);lo([G()],Yi.prototype,"priceImpact",void 0);lo([G()],Yi.prototype,"maxSlippage",void 0);lo([G()],Yi.prototype,"networkTokenSymbol",void 0);lo([G()],Yi.prototype,"inputError",void 0);Yi=lo([te("w3m-swap-details")],Yi);const JAe=de`
- :host {
- width: 100%;
- }
- :host > wui-flex {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- border-radius: var(--wui-border-radius-s);
- padding: var(--wui-spacing-xl);
- padding-right: var(--wui-spacing-s);
- background-color: var(--wui-color-gray-glass-002);
- box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-002);
- width: 100%;
- height: 100px;
- box-sizing: border-box;
- position: relative;
- }
- wui-shimmer.market-value {
- opacity: 0;
- }
- :host > wui-flex > svg.input_mask {
- position: absolute;
- inset: 0;
- z-index: 5;
- }
- :host wui-flex .input_mask__border,
- :host wui-flex .input_mask__background {
- transition: fill var(--wui-duration-md) var(--wui-ease-out-power-1);
- will-change: fill;
- }
- :host wui-flex .input_mask__border {
- fill: var(--wui-color-gray-glass-020);
- }
- :host wui-flex .input_mask__background {
- fill: var(--wui-color-gray-glass-002);
- }
- `;var JJ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let l6=class extends se{constructor(){super(...arguments),this.target="sourceToken"}render(){return M`
- <wui-flex class justifyContent="space-between">
- <wui-flex
- flex="1"
- flexDirection="column"
- alignItems="flex-start"
- justifyContent="center"
- class="swap-input"
- gap="xxs"
- >
- <wui-shimmer width="80px" height="40px" borderRadius="xxs" variant="light"></wui-shimmer>
- </wui-flex>
- ${this.templateTokenSelectButton()}
- </wui-flex>
- `}templateTokenSelectButton(){return M`
- <wui-flex
- class="swap-token-button"
- flexDirection="column"
- alignItems="flex-end"
- justifyContent="center"
- gap="xxs"
- >
- <wui-shimmer width="80px" height="40px" borderRadius="3xl" variant="light"></wui-shimmer>
- </wui-flex>
- `}};l6.styles=[JAe];JJ([q()],l6.prototype,"target",void 0);l6=JJ([te("w3m-swap-input-skeleton")],l6);const QAe=de`
- :host {
- display: block;
- }
- :host > button {
- gap: var(--wui-spacing-xxs);
- padding: var(--wui-spacing-xs);
- padding-right: var(--wui-spacing-1xs);
- height: 40px;
- border-radius: var(--wui-border-radius-l);
- background: var(--wui-color-gray-glass-002);
- border-width: 0px;
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
- }
- :host > button wui-image {
- width: 24px;
- height: 24px;
- border-radius: var(--wui-border-radius-s);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
- }
- `;var F7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Dy=class extends se{constructor(){super(...arguments),this.text=""}render(){return M`
- <button>
- ${this.tokenTemplate()}
- <wui-text variant="paragraph-600" color="fg-100">${this.text}</wui-text>
- </button>
- `}tokenTemplate(){return this.imageSrc?M`<wui-image src=${this.imageSrc}></wui-image>`:M`
- <wui-icon-box
- size="sm"
- iconColor="fg-200"
- backgroundColor="fg-300"
- icon="networkPlaceholder"
- ></wui-icon-box>
- `}};Dy.styles=[He,vt,QAe];F7([q()],Dy.prototype,"imageSrc",void 0);F7([q()],Dy.prototype,"text",void 0);Dy=F7([te("wui-token-button")],Dy);const XAe=de`
- :host > wui-flex {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- border-radius: var(--wui-border-radius-s);
- background-color: var(--wui-color-gray-glass-002);
- padding: var(--wui-spacing-xl);
- padding-right: var(--wui-spacing-s);
- width: 100%;
- height: 100px;
- box-sizing: border-box;
- box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-002);
- position: relative;
- transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-lg);
- will-change: background-color;
- }
- :host wui-flex.focus {
- box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-005);
- }
- :host > wui-flex .swap-input,
- :host > wui-flex .swap-token-button {
- z-index: 10;
- }
- :host > wui-flex .swap-input {
- -webkit-mask-image: linear-gradient(
- 270deg,
- transparent 0px,
- transparent 8px,
- black 24px,
- black 25px,
- black 32px,
- black 100%
- );
- mask-image: linear-gradient(
- 270deg,
- transparent 0px,
- transparent 8px,
- black 24px,
- black 25px,
- black 32px,
- black 100%
- );
- }
- :host > wui-flex .swap-input input {
- background: none;
- border: none;
- height: 42px;
- width: 100%;
- font-size: 32px;
- font-style: normal;
- font-weight: 400;
- line-height: 130%;
- letter-spacing: -1.28px;
- outline: none;
- caret-color: var(--wui-color-accent-100);
- color: var(--wui-color-fg-100);
- padding: 0px;
- }
- :host > wui-flex .swap-input input:focus-visible {
- outline: none;
- }
- :host > wui-flex .swap-input input::-webkit-outer-spin-button,
- :host > wui-flex .swap-input input::-webkit-inner-spin-button {
- -webkit-appearance: none;
- margin: 0;
- }
- .max-value-button {
- background-color: transparent;
- border: none;
- cursor: pointer;
- color: var(--wui-color-gray-glass-020);
- padding-left: 0px;
- }
- .market-value {
- min-height: 18px;
- }
- `;var na=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const exe=5e-5;let Ss=class extends se{constructor(){super(...arguments),this.focused=!1,this.price=0,this.target="sourceToken",this.onSetAmount=null,this.onSetMaxValue=null}render(){const e=this.marketValue||"0",r=Dt.bigNumber(e).gt("0");return M`
- <wui-flex class="${this.focused?"focus":""}" justifyContent="space-between">
- <wui-flex
- flex="1"
- flexDirection="column"
- alignItems="flex-start"
- justifyContent="center"
- class="swap-input"
- >
- <input
- data-testid="swap-input-${this.target}"
- @focusin=${()=>this.onFocusChange(!0)}
- @focusout=${()=>this.onFocusChange(!1)}
- ?disabled=${this.disabled}
- .value=${this.value}
- @input=${this.dispatchInputChangeEvent}
- @keydown=${this.handleKeydown}
- placeholder="0"
- type="text"
- inputmode="decimal"
- />
- <wui-text class="market-value" variant="small-400" color="fg-200">
- ${r?`$${nt.formatNumberToLocalString(this.marketValue,2)}`:null}
- </wui-text>
- </wui-flex>
- ${this.templateTokenSelectButton()}
- </wui-flex>
- `}handleKeydown(e){return xne.numericInputKeyDown(e,this.value,r=>{var n;return(n=this.onSetAmount)==null?void 0:n.call(this,this.target,r)})}dispatchInputChangeEvent(e){if(!this.onSetAmount)return;const r=e.target.value.replace(/[^0-9.]/gu,"");r===","||r==="."?this.onSetAmount(this.target,"0."):r.endsWith(",")?this.onSetAmount(this.target,r.replace(",",".")):this.onSetAmount(this.target,r)}setMaxValueToInput(){var e;(e=this.onSetMaxValue)==null||e.call(this,this.target,this.balance)}templateTokenSelectButton(){return this.token?M`
- <wui-flex
- class="swap-token-button"
- flexDirection="column"
- alignItems="flex-end"
- justifyContent="center"
- gap="xxs"
- >
- <wui-token-button
- data-testid="swap-input-token-${this.target}"
- text=${this.token.symbol}
- imageSrc=${this.token.logoUri}
- @click=${this.onSelectToken.bind(this)}
- >
- </wui-token-button>
- <wui-flex alignItems="center" gap="xxs"> ${this.tokenBalanceTemplate()} </wui-flex>
- </wui-flex>
- `:M` <wui-button
- data-testid="swap-select-token-button-${this.target}"
- class="swap-token-button"
- size="md"
- variant="accent"
- @click=${this.onSelectToken.bind(this)}
- >
- Select token
- </wui-button>`}tokenBalanceTemplate(){const e=Dt.multiply(this.balance,this.price),r=e?e==null?void 0:e.gt(exe):!1;return M`
- ${r?M`<wui-text variant="small-400" color="fg-200">
- ${nt.formatNumberToLocalString(this.balance,2)}
- </wui-text>`:null}
- ${this.target==="sourceToken"?this.tokenActionButtonTemplate(r):null}
- `}tokenActionButtonTemplate(e){return e?M` <button class="max-value-button" @click=${this.setMaxValueToInput.bind(this)}>
- <wui-text color="accent-100" variant="small-600">Max</wui-text>
- </button>`:M` <button class="max-value-button" @click=${this.onBuyToken.bind(this)}>
- <wui-text color="accent-100" variant="small-600">Buy</wui-text>
- </button>`}onFocusChange(e){this.focused=e}onSelectToken(){Re.sendEvent({type:"track",event:"CLICK_SELECT_TOKEN_TO_SWAP"}),X.push("SwapSelectToken",{target:this.target})}onBuyToken(){X.push("OnRampProviders")}};Ss.styles=[XAe];na([q()],Ss.prototype,"focused",void 0);na([q()],Ss.prototype,"balance",void 0);na([q()],Ss.prototype,"value",void 0);na([q()],Ss.prototype,"price",void 0);na([q()],Ss.prototype,"marketValue",void 0);na([q()],Ss.prototype,"disabled",void 0);na([q()],Ss.prototype,"target",void 0);na([q()],Ss.prototype,"token",void 0);na([q()],Ss.prototype,"onSetAmount",void 0);na([q()],Ss.prototype,"onSetMaxValue",void 0);Ss=na([te("w3m-swap-input")],Ss);const txe=de`
- :host > wui-flex:first-child {
- overflow-y: auto;
- overflow-x: hidden;
- scrollbar-width: none;
- }
- :host > wui-flex:first-child::-webkit-scrollbar {
- display: none;
- }
- wui-loading-hexagon {
- position: absolute;
- }
- .action-button {
- width: 100%;
- border-radius: var(--wui-border-radius-xs);
- }
- .action-button:disabled {
- border-color: 1px solid var(--wui-color-gray-glass-005);
- }
- .swap-inputs-container {
- position: relative;
- }
- .replace-tokens-button-container {
- display: flex;
- justify-content: center;
- align-items: center;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- gap: var(--wui-spacing-1xs);
- border-radius: var(--wui-border-radius-xs);
- background-color: var(--wui-color-modal-bg-base);
- padding: var(--wui-spacing-xxs);
- }
- .replace-tokens-button-container > button {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 40px;
- width: 40px;
- padding: var(--wui-spacing-xs);
- border: none;
- border-radius: var(--wui-border-radius-xxs);
- background: var(--wui-color-gray-glass-002);
- transition: background-color var(--wui-duration-md) var(--wui-ease-out-power-1);
- will-change: background-color;
- z-index: 20;
- }
- .replace-tokens-button-container > button:hover {
- background: var(--wui-color-gray-glass-005);
- }
- .details-container > wui-flex {
- background: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xxs);
- width: 100%;
- }
- .details-container > wui-flex > button {
- border: none;
- background: none;
- padding: var(--wui-spacing-s);
- border-radius: var(--wui-border-radius-xxs);
- transition: background 0.2s linear;
- }
- .details-container > wui-flex > button:hover {
- background: var(--wui-color-gray-glass-002);
- }
- .details-content-container {
- padding: var(--wui-spacing-1xs);
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .details-content-container > wui-flex {
- width: 100%;
- }
- .details-row {
- width: 100%;
- padding: var(--wui-spacing-s) var(--wui-spacing-xl);
- border-radius: var(--wui-border-radius-xxs);
- background: var(--wui-color-gray-glass-002);
- }
- `;var On=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let tn=class extends se{constructor(){var e,r;super(),this.unsubscribe=[],this.initialParams=(e=X.state.data)==null?void 0:e.swap,this.detailsOpen=!1,this.caipAddress=re.state.caipAddress,this.caipNetworkId=(r=F.state.activeCaipNetwork)==null?void 0:r.caipNetworkId,this.initialized=ye.state.initialized,this.loadingQuote=ye.state.loadingQuote,this.loadingPrices=ye.state.loadingPrices,this.loadingTransaction=ye.state.loadingTransaction,this.sourceToken=ye.state.sourceToken,this.sourceTokenAmount=ye.state.sourceTokenAmount,this.sourceTokenPriceInUSD=ye.state.sourceTokenPriceInUSD,this.toToken=ye.state.toToken,this.toTokenAmount=ye.state.toTokenAmount,this.toTokenPriceInUSD=ye.state.toTokenPriceInUSD,this.inputError=ye.state.inputError,this.fetchError=ye.state.fetchError,this.onDebouncedGetSwapCalldata=ue.debounce(async()=>{await ye.swapTokens()},200),F.subscribeKey("activeCaipNetwork",n=>this.onCaipNetworkChange({newCaipNetwork:n,resetSwapState:!0,initializeSwapState:!1})),re.subscribeKey("caipAddress",n=>this.onCaipAddressChange({newCaipAddress:n,resetSwapState:!0,initializeSwapState:!1})),this.unsubscribe.push(F.subscribeKey("activeCaipNetwork",n=>this.onCaipNetworkChange({newCaipNetwork:n,resetSwapState:!1,initializeSwapState:!0})),re.subscribeKey("caipAddress",n=>this.onCaipAddressChange({newCaipAddress:n,resetSwapState:!1,initializeSwapState:!0})),We.subscribeKey("open",n=>{n||ye.resetState()}),X.subscribeKey("view",n=>{n.includes("Swap")||ye.resetValues()}),ye.subscribe(n=>{this.initialized=n.initialized,this.loadingQuote=n.loadingQuote,this.loadingPrices=n.loadingPrices,this.loadingTransaction=n.loadingTransaction,this.sourceToken=n.sourceToken,this.sourceTokenAmount=n.sourceTokenAmount,this.sourceTokenPriceInUSD=n.sourceTokenPriceInUSD,this.toToken=n.toToken,this.toTokenAmount=n.toTokenAmount,this.toTokenPriceInUSD=n.toTokenPriceInUSD,this.inputError=n.inputError,this.fetchError=n.fetchError}))}async firstUpdated(){ye.initializeState(),this.watchTokensAndValues(),await this.handleSwapParameters()}disconnectedCallback(){this.unsubscribe.forEach(e=>e==null?void 0:e()),clearInterval(this.interval)}render(){return M`
- <wui-flex flexDirection="column" .padding=${["0","l","l","l"]} gap="s">
- ${this.initialized?this.templateSwap():this.templateLoading()}
- </wui-flex>
- `}watchTokensAndValues(){this.interval=setInterval(()=>{ye.getNetworkTokenPrice(),ye.getMyTokensWithBalance(),ye.swapTokens()},1e4)}templateSwap(){return M`
- <wui-flex flexDirection="column" gap="s">
- <wui-flex flexDirection="column" alignItems="center" gap="xs" class="swap-inputs-container">
- ${this.templateTokenInput("sourceToken",this.sourceToken)}
- ${this.templateTokenInput("toToken",this.toToken)} ${this.templateReplaceTokensButton()}
- </wui-flex>
- ${this.templateDetails()} ${this.templateActionButton()}
- </wui-flex>
- `}actionButtonLabel(){return this.fetchError?"Swap":!this.sourceToken||!this.toToken?"Select token":this.sourceTokenAmount?this.inputError?this.inputError:"Review swap":"Enter amount"}templateReplaceTokensButton(){return M`
- <wui-flex class="replace-tokens-button-container">
- <button @click=${this.onSwitchTokens.bind(this)}>
- <wui-icon name="recycleHorizontal" color="fg-250" size="lg"></wui-icon>
- </button>
- </wui-flex>
- `}templateLoading(){return M`
- <wui-flex flexDirection="column" gap="l">
- <wui-flex flexDirection="column" alignItems="center" gap="xs" class="swap-inputs-container">
- <w3m-swap-input-skeleton target="sourceToken"></w3m-swap-input-skeleton>
- <w3m-swap-input-skeleton target="toToken"></w3m-swap-input-skeleton>
- ${this.templateReplaceTokensButton()}
- </wui-flex>
- ${this.templateActionButton()}
- </wui-flex>
- `}templateTokenInput(e,r){var a,c;const n=(a=ye.state.myTokensWithBalance)==null?void 0:a.find(u=>(u==null?void 0:u.address)===(r==null?void 0:r.address)),i=e==="toToken"?this.toTokenAmount:this.sourceTokenAmount,s=e==="toToken"?this.toTokenPriceInUSD:this.sourceTokenPriceInUSD,o=Dt.parseLocalStringToNumber(i)*s;return M`<w3m-swap-input
- .value=${e==="toToken"?this.toTokenAmount:this.sourceTokenAmount}
- .disabled=${e==="toToken"}
- .onSetAmount=${this.handleChangeAmount.bind(this)}
- target=${e}
- .token=${r}
- .balance=${(c=n==null?void 0:n.quantity)==null?void 0:c.numeric}
- .price=${n==null?void 0:n.price}
- .marketValue=${o}
- .onSetMaxValue=${this.onSetMaxValue.bind(this)}
- ></w3m-swap-input>`}onSetMaxValue(e,r){const n=Dt.bigNumber(r||"0");this.handleChangeAmount(e,n.gt(0)?n.toFixed(20):"0")}templateDetails(){return!this.sourceToken||!this.toToken||this.inputError?null:M`<w3m-swap-details .detailsOpen=${this.detailsOpen}></w3m-swap-details>`}handleChangeAmount(e,r){ye.clearError(),e==="sourceToken"?ye.setSourceTokenAmount(r):ye.setToTokenAmount(r),this.onDebouncedGetSwapCalldata()}templateActionButton(){const e=!this.toToken||!this.sourceToken,r=!this.sourceTokenAmount,n=this.loadingQuote||this.loadingPrices||this.loadingTransaction,i=n||e||r||this.inputError;return M` <wui-flex gap="xs">
- <wui-button
- data-testid="swap-action-button"
- class="action-button"
- fullWidth
- size="lg"
- borderRadius="xs"
- variant=${e?"neutral":"main"}
- .loading=${n}
- .disabled=${i}
- @click=${this.onSwapPreview.bind(this)}
- >
- ${this.actionButtonLabel()}
- </wui-button>
- </wui-flex>`}onSwitchTokens(){ye.switchTokens()}async onSwapPreview(){var r,n,i;const e=F.state.activeChain;this.fetchError&&await ye.swapTokens(),Re.sendEvent({type:"track",event:"INITIATE_SWAP",properties:{network:this.caipNetworkId||"",swapFromToken:((r=this.sourceToken)==null?void 0:r.symbol)||"",swapToToken:((n=this.toToken)==null?void 0:n.symbol)||"",swapFromAmount:this.sourceTokenAmount||"",swapToAmount:this.toTokenAmount||"",isSmartAccount:((i=re.state.preferredAccountTypes)==null?void 0:i[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT}}),X.push("SwapPreview")}async handleSwapParameters(){this.initialParams&&(ye.state.initialized||await new Promise(r=>{const n=ye.subscribeKey("initialized",i=>{i&&(n==null||n(),r())})}),await this.setSwapParameters(this.initialParams))}async setSwapParameters({amount:e,fromToken:r,toToken:n}){(!ye.state.tokens||!ye.state.myTokensWithBalance)&&await new Promise(o=>{const a=ye.subscribeKey("myTokensWithBalance",c=>{c&&c.length>0&&(a==null||a(),o())});setTimeout(()=>{a==null||a(),o()},5e3)});const i=[...ye.state.tokens||[],...ye.state.myTokensWithBalance||[]];if(r){const s=i.find(o=>o.symbol.toLowerCase()===r.toLowerCase());s&&ye.setSourceToken(s)}if(n){const s=i.find(o=>o.symbol.toLowerCase()===n.toLowerCase());s&&ye.setToToken(s)}e&&!isNaN(Number(e))&&ye.setSourceTokenAmount(e)}onCaipAddressChange({newCaipAddress:e,resetSwapState:r,initializeSwapState:n}){this.caipAddress!==e&&(this.caipAddress=e,r&&ye.resetState(),n&&ye.initializeState())}onCaipNetworkChange({newCaipNetwork:e,resetSwapState:r,initializeSwapState:n}){this.caipNetworkId!==(e==null?void 0:e.caipNetworkId)&&(this.caipNetworkId=e==null?void 0:e.caipNetworkId,r&&ye.resetState(),n&&ye.initializeState())}};tn.styles=txe;On([q({type:Object})],tn.prototype,"initialParams",void 0);On([G()],tn.prototype,"interval",void 0);On([G()],tn.prototype,"detailsOpen",void 0);On([G()],tn.prototype,"caipAddress",void 0);On([G()],tn.prototype,"caipNetworkId",void 0);On([G()],tn.prototype,"initialized",void 0);On([G()],tn.prototype,"loadingQuote",void 0);On([G()],tn.prototype,"loadingPrices",void 0);On([G()],tn.prototype,"loadingTransaction",void 0);On([G()],tn.prototype,"sourceToken",void 0);On([G()],tn.prototype,"sourceTokenAmount",void 0);On([G()],tn.prototype,"sourceTokenPriceInUSD",void 0);On([G()],tn.prototype,"toToken",void 0);On([G()],tn.prototype,"toTokenAmount",void 0);On([G()],tn.prototype,"toTokenPriceInUSD",void 0);On([G()],tn.prototype,"inputError",void 0);On([G()],tn.prototype,"fetchError",void 0);tn=On([te("w3m-swap-view")],tn);const rxe=de`
- :host > wui-flex:first-child {
- overflow-y: auto;
- overflow-x: hidden;
- scrollbar-width: none;
- }
- :host > wui-flex:first-child::-webkit-scrollbar {
- display: none;
- }
- .preview-container,
- .details-container {
- width: 100%;
- }
- .token-image {
- width: 24px;
- height: 24px;
- box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
- border-radius: 12px;
- }
- wui-loading-hexagon {
- position: absolute;
- }
- .token-item {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: var(--wui-spacing-xxs);
- padding: var(--wui-spacing-xs);
- height: 40px;
- border: none;
- border-radius: 80px;
- background: var(--wui-color-gray-glass-002);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
- cursor: pointer;
- transition: background 0.2s linear;
- }
- .token-item:hover {
- background: var(--wui-color-gray-glass-005);
- }
- .preview-token-details-container {
- width: 100%;
- }
- .details-row {
- width: 100%;
- padding: var(--wui-spacing-s) var(--wui-spacing-xl);
- border-radius: var(--wui-border-radius-xxs);
- background: var(--wui-color-gray-glass-002);
- }
- .action-buttons-container {
- width: 100%;
- gap: var(--wui-spacing-xs);
- }
- .action-buttons-container > button {
- display: flex;
- align-items: center;
- justify-content: center;
- background: transparent;
- height: 48px;
- border-radius: var(--wui-border-radius-xs);
- border: none;
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
- }
- .action-buttons-container > button:disabled {
- opacity: 0.8;
- cursor: not-allowed;
- }
- .action-button > wui-loading-spinner {
- display: inline-block;
- }
- .cancel-button:hover,
- .action-button:hover {
- cursor: pointer;
- }
- .action-buttons-container > wui-button.cancel-button {
- flex: 2;
- }
- .action-buttons-container > wui-button.action-button {
- flex: 4;
- }
- .action-buttons-container > button.action-button > wui-text {
- color: white;
- }
- .details-container > wui-flex {
- background: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xxs);
- width: 100%;
- }
- .details-container > wui-flex > button {
- border: none;
- background: none;
- padding: var(--wui-spacing-s);
- border-radius: var(--wui-border-radius-xxs);
- transition: background 0.2s linear;
- }
- .details-container > wui-flex > button:hover {
- background: var(--wui-color-gray-glass-002);
- }
- .details-content-container {
- padding: var(--wui-spacing-1xs);
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .details-content-container > wui-flex {
- width: 100%;
- }
- .details-row {
- width: 100%;
- padding: var(--wui-spacing-s) var(--wui-spacing-xl);
- border-radius: var(--wui-border-radius-xxs);
- background: var(--wui-color-gray-glass-002);
- }
- `;var Rn=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let rn=class extends se{constructor(){super(),this.unsubscribe=[],this.detailsOpen=!0,this.approvalTransaction=ye.state.approvalTransaction,this.swapTransaction=ye.state.swapTransaction,this.sourceToken=ye.state.sourceToken,this.sourceTokenAmount=ye.state.sourceTokenAmount??"",this.sourceTokenPriceInUSD=ye.state.sourceTokenPriceInUSD,this.toToken=ye.state.toToken,this.toTokenAmount=ye.state.toTokenAmount??"",this.toTokenPriceInUSD=ye.state.toTokenPriceInUSD,this.caipNetwork=F.state.activeCaipNetwork,this.balanceSymbol=re.state.balanceSymbol,this.inputError=ye.state.inputError,this.loadingQuote=ye.state.loadingQuote,this.loadingApprovalTransaction=ye.state.loadingApprovalTransaction,this.loadingBuildTransaction=ye.state.loadingBuildTransaction,this.loadingTransaction=ye.state.loadingTransaction,this.unsubscribe.push(re.subscribeKey("balanceSymbol",e=>{this.balanceSymbol!==e&&X.goBack()}),F.subscribeKey("activeCaipNetwork",e=>{this.caipNetwork!==e&&(this.caipNetwork=e)}),ye.subscribe(e=>{this.approvalTransaction=e.approvalTransaction,this.swapTransaction=e.swapTransaction,this.sourceToken=e.sourceToken,this.toToken=e.toToken,this.toTokenPriceInUSD=e.toTokenPriceInUSD,this.sourceTokenAmount=e.sourceTokenAmount??"",this.toTokenAmount=e.toTokenAmount??"",this.inputError=e.inputError,e.inputError&&X.goBack(),this.loadingQuote=e.loadingQuote,this.loadingApprovalTransaction=e.loadingApprovalTransaction,this.loadingBuildTransaction=e.loadingBuildTransaction,this.loadingTransaction=e.loadingTransaction}))}firstUpdated(){ye.getTransaction(),this.refreshTransaction()}disconnectedCallback(){this.unsubscribe.forEach(e=>e==null?void 0:e()),clearInterval(this.interval)}render(){return M`
- <wui-flex flexDirection="column" .padding=${["0","l","l","l"]} gap="s">
- ${this.templateSwap()}
- </wui-flex>
- `}refreshTransaction(){this.interval=setInterval(()=>{ye.getApprovalLoadingState()||ye.getTransaction()},1e4)}templateSwap(){var c,u,l,d;const e=`${nt.formatNumberToLocalString(parseFloat(this.sourceTokenAmount))} ${(c=this.sourceToken)==null?void 0:c.symbol}`,r=`${nt.formatNumberToLocalString(parseFloat(this.toTokenAmount))} ${(u=this.toToken)==null?void 0:u.symbol}`,n=parseFloat(this.sourceTokenAmount)*this.sourceTokenPriceInUSD,i=parseFloat(this.toTokenAmount)*this.toTokenPriceInUSD,s=nt.formatNumberToLocalString(n),o=nt.formatNumberToLocalString(i),a=this.loadingQuote||this.loadingBuildTransaction||this.loadingTransaction||this.loadingApprovalTransaction;return M`
- <wui-flex flexDirection="column" alignItems="center" gap="l">
- <wui-flex class="preview-container" flexDirection="column" alignItems="flex-start" gap="l">
- <wui-flex
- class="preview-token-details-container"
- alignItems="center"
- justifyContent="space-between"
- gap="l"
- >
- <wui-flex flexDirection="column" alignItems="flex-start" gap="4xs">
- <wui-text variant="small-400" color="fg-150">Send</wui-text>
- <wui-text variant="paragraph-400" color="fg-100">$${s}</wui-text>
- </wui-flex>
- <wui-token-button
- flexDirection="row-reverse"
- text=${e}
- imageSrc=${(l=this.sourceToken)==null?void 0:l.logoUri}
- >
- </wui-token-button>
- </wui-flex>
- <wui-icon name="recycleHorizontal" color="fg-200" size="md"></wui-icon>
- <wui-flex
- class="preview-token-details-container"
- alignItems="center"
- justifyContent="space-between"
- gap="l"
- >
- <wui-flex flexDirection="column" alignItems="flex-start" gap="4xs">
- <wui-text variant="small-400" color="fg-150">Receive</wui-text>
- <wui-text variant="paragraph-400" color="fg-100">$${o}</wui-text>
- </wui-flex>
- <wui-token-button
- flexDirection="row-reverse"
- text=${r}
- imageSrc=${(d=this.toToken)==null?void 0:d.logoUri}
- >
- </wui-token-button>
- </wui-flex>
- </wui-flex>
- ${this.templateDetails()}
- <wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="xs">
- <wui-icon size="sm" color="fg-200" name="infoCircle"></wui-icon>
- <wui-text variant="small-400" color="fg-200">Review transaction carefully</wui-text>
- </wui-flex>
- <wui-flex
- class="action-buttons-container"
- flexDirection="row"
- alignItems="center"
- justifyContent="space-between"
- gap="xs"
- >
- <wui-button
- class="cancel-button"
- fullWidth
- size="lg"
- borderRadius="xs"
- variant="neutral"
- @click=${this.onCancelTransaction.bind(this)}
- >
- <wui-text variant="paragraph-600" color="fg-200">Cancel</wui-text>
- </wui-button>
- <wui-button
- class="action-button"
- fullWidth
- size="lg"
- borderRadius="xs"
- variant="main"
- ?loading=${a}
- ?disabled=${a}
- @click=${this.onSendTransaction.bind(this)}
- >
- <wui-text variant="paragraph-600" color="inverse-100">
- ${this.actionButtonLabel()}
- </wui-text>
- </wui-button>
- </wui-flex>
- </wui-flex>
- `}templateDetails(){return!this.sourceToken||!this.toToken||this.inputError?null:M`<w3m-swap-details .detailsOpen=${this.detailsOpen}></w3m-swap-details>`}actionButtonLabel(){return this.loadingApprovalTransaction?"Approving...":this.approvalTransaction?"Approve":"Swap"}onCancelTransaction(){X.goBack()}onSendTransaction(){this.approvalTransaction?ye.sendTransactionForApproval(this.approvalTransaction):ye.sendTransactionForSwap(this.swapTransaction)}};rn.styles=rxe;Rn([G()],rn.prototype,"interval",void 0);Rn([G()],rn.prototype,"detailsOpen",void 0);Rn([G()],rn.prototype,"approvalTransaction",void 0);Rn([G()],rn.prototype,"swapTransaction",void 0);Rn([G()],rn.prototype,"sourceToken",void 0);Rn([G()],rn.prototype,"sourceTokenAmount",void 0);Rn([G()],rn.prototype,"sourceTokenPriceInUSD",void 0);Rn([G()],rn.prototype,"toToken",void 0);Rn([G()],rn.prototype,"toTokenAmount",void 0);Rn([G()],rn.prototype,"toTokenPriceInUSD",void 0);Rn([G()],rn.prototype,"caipNetwork",void 0);Rn([G()],rn.prototype,"balanceSymbol",void 0);Rn([G()],rn.prototype,"inputError",void 0);Rn([G()],rn.prototype,"loadingQuote",void 0);Rn([G()],rn.prototype,"loadingApprovalTransaction",void 0);Rn([G()],rn.prototype,"loadingBuildTransaction",void 0);Rn([G()],rn.prototype,"loadingTransaction",void 0);rn=Rn([te("w3m-swap-preview-view")],rn);const nxe=de`
- :host {
- height: 60px;
- min-height: 60px;
- }
- :host > wui-flex {
- cursor: pointer;
- height: 100%;
- display: flex;
- column-gap: var(--wui-spacing-s);
- padding: var(--wui-spacing-xs);
- padding-right: var(--wui-spacing-l);
- width: 100%;
- background-color: transparent;
- border-radius: var(--wui-border-radius-xs);
- color: var(--wui-color-fg-250);
- transition:
- background-color var(--wui-ease-out-power-1) var(--wui-duration-lg),
- opacity var(--wui-ease-out-power-1) var(--wui-duration-lg);
- will-change: background-color, opacity;
- }
- @media (hover: hover) and (pointer: fine) {
- :host > wui-flex:hover {
- background-color: var(--wui-color-gray-glass-002);
- }
- :host > wui-flex:active {
- background-color: var(--wui-color-gray-glass-005);
- }
- }
- :host([disabled]) > wui-flex {
- opacity: 0.6;
- }
- :host([disabled]) > wui-flex:hover {
- background-color: transparent;
- }
- :host > wui-flex > wui-flex {
- flex: 1;
- }
- :host > wui-flex > wui-image,
- :host > wui-flex > .token-item-image-placeholder {
- width: 40px;
- max-width: 40px;
- height: 40px;
- border-radius: var(--wui-border-radius-3xl);
- position: relative;
- }
- :host > wui-flex > .token-item-image-placeholder {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- :host > wui-flex > wui-image::after,
- :host > wui-flex > .token-item-image-placeholder::after {
- position: absolute;
- content: '';
- inset: 0;
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
- border-radius: var(--wui-border-radius-l);
- }
- button > wui-icon-box[data-variant='square-blue'] {
- border-radius: var(--wui-border-radius-3xs);
- position: relative;
- border: none;
- width: 36px;
- height: 36px;
- }
- `;var Md=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let rc=class extends se{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.imageSrc=void 0,this.name=void 0,this.symbol=void 0,this.price=void 0,this.amount=void 0,this.visible=!1,this.imageError=!1,this.observer=new IntersectionObserver(e=>{e.forEach(r=>{r.isIntersecting?this.visible=!0:this.visible=!1})},{threshold:.1})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var r;if(!this.visible)return null;const e=this.amount&&this.price?(r=Dt.multiply(this.price,this.amount))==null?void 0:r.toFixed(3):null;return M`
- <wui-flex alignItems="center">
- ${this.visualTemplate()}
- <wui-flex flexDirection="column" gap="3xs">
- <wui-flex justifyContent="space-between">
- <wui-text variant="paragraph-500" color="fg-100" lineClamp="1">${this.name}</wui-text>
- ${e?M`
- <wui-text variant="paragraph-500" color="fg-100">
- $${nt.formatNumberToLocalString(e,3)}
- </wui-text>
- `:null}
- </wui-flex>
- <wui-flex justifyContent="space-between">
- <wui-text variant="small-400" color="fg-200" lineClamp="1">${this.symbol}</wui-text>
- ${this.amount?M`<wui-text variant="small-400" color="fg-200">
- ${nt.formatNumberToLocalString(this.amount,4)}
- </wui-text>`:null}
- </wui-flex>
- </wui-flex>
- </wui-flex>
- `}visualTemplate(){return this.imageError?M`<wui-flex class="token-item-image-placeholder">
- <wui-icon name="image" color="inherit"></wui-icon>
- </wui-flex>`:this.imageSrc?M`<wui-image
- width="40"
- height="40"
- src=${this.imageSrc}
- @onLoadError=${this.imageLoadError}
- ></wui-image>`:null}imageLoadError(){this.imageError=!0}};rc.styles=[He,vt,nxe];Md([q()],rc.prototype,"imageSrc",void 0);Md([q()],rc.prototype,"name",void 0);Md([q()],rc.prototype,"symbol",void 0);Md([q()],rc.prototype,"price",void 0);Md([q()],rc.prototype,"amount",void 0);Md([G()],rc.prototype,"visible",void 0);Md([G()],rc.prototype,"imageError",void 0);rc=Md([te("wui-token-list-item")],rc);const ixe=de`
- :host {
- --tokens-scroll--top-opacity: 0;
- --tokens-scroll--bottom-opacity: 1;
- --suggested-tokens-scroll--left-opacity: 0;
- --suggested-tokens-scroll--right-opacity: 1;
- }
- :host > wui-flex:first-child {
- overflow-y: hidden;
- overflow-x: hidden;
- scrollbar-width: none;
- scrollbar-height: none;
- }
- :host > wui-flex:first-child::-webkit-scrollbar {
- display: none;
- }
- wui-loading-hexagon {
- position: absolute;
- }
- .suggested-tokens-container {
- overflow-x: auto;
- mask-image: linear-gradient(
- to right,
- rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 0px,
- rgba(200, 200, 200, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 1px,
- black 50px,
- black 90px,
- black calc(100% - 90px),
- black calc(100% - 50px),
- rgba(155, 155, 155, calc(1 - var(--suggested-tokens-scroll--right-opacity))) calc(100% - 1px),
- rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--right-opacity))) 100%
- );
- }
- .suggested-tokens-container::-webkit-scrollbar {
- display: none;
- }
- .tokens-container {
- border-top: 1px solid var(--wui-color-gray-glass-005);
- height: 100%;
- max-height: 390px;
- }
- .tokens {
- width: 100%;
- overflow-y: auto;
- mask-image: linear-gradient(
- to bottom,
- rgba(0, 0, 0, calc(1 - var(--tokens-scroll--top-opacity))) 0px,
- rgba(200, 200, 200, calc(1 - var(--tokens-scroll--top-opacity))) 1px,
- black 50px,
- black 90px,
- black calc(100% - 90px),
- black calc(100% - 50px),
- rgba(155, 155, 155, calc(1 - var(--tokens-scroll--bottom-opacity))) calc(100% - 1px),
- rgba(0, 0, 0, calc(1 - var(--tokens-scroll--bottom-opacity))) 100%
- );
- }
- .network-search-input,
- .select-network-button {
- height: 40px;
- }
- .select-network-button {
- border: none;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- gap: var(--wui-spacing-xs);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
- background-color: transparent;
- border-radius: var(--wui-border-radius-xxs);
- padding: var(--wui-spacing-xs);
- align-items: center;
- transition: background-color 0.2s linear;
- }
- .select-network-button:hover {
- background-color: var(--wui-color-gray-glass-002);
- }
- .select-network-button > wui-image {
- width: 26px;
- height: 26px;
- border-radius: var(--wui-border-radius-xs);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
- }
- `;var Ju=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let so=class extends se{constructor(){var e;super(),this.unsubscribe=[],this.targetToken=(e=X.state.data)==null?void 0:e.target,this.sourceToken=ye.state.sourceToken,this.sourceTokenAmount=ye.state.sourceTokenAmount,this.toToken=ye.state.toToken,this.myTokensWithBalance=ye.state.myTokensWithBalance,this.popularTokens=ye.state.popularTokens,this.searchValue="",this.unsubscribe.push(ye.subscribe(r=>{this.sourceToken=r.sourceToken,this.toToken=r.toToken,this.myTokensWithBalance=r.myTokensWithBalance}))}updated(){var n,i;const e=(n=this.renderRoot)==null?void 0:n.querySelector(".suggested-tokens-container");e==null||e.addEventListener("scroll",this.handleSuggestedTokensScroll.bind(this));const r=(i=this.renderRoot)==null?void 0:i.querySelector(".tokens");r==null||r.addEventListener("scroll",this.handleTokenListScroll.bind(this))}disconnectedCallback(){var n,i;super.disconnectedCallback();const e=(n=this.renderRoot)==null?void 0:n.querySelector(".suggested-tokens-container"),r=(i=this.renderRoot)==null?void 0:i.querySelector(".tokens");e==null||e.removeEventListener("scroll",this.handleSuggestedTokensScroll.bind(this)),r==null||r.removeEventListener("scroll",this.handleTokenListScroll.bind(this)),clearInterval(this.interval)}render(){return M`
- <wui-flex flexDirection="column" gap="s">
- ${this.templateSearchInput()} ${this.templateSuggestedTokens()} ${this.templateTokens()}
- </wui-flex>
- `}onSelectToken(e){this.targetToken==="sourceToken"?ye.setSourceToken(e):(ye.setToToken(e),this.sourceToken&&this.sourceTokenAmount&&ye.swapTokens()),X.goBack()}templateSearchInput(){return M`
- <wui-flex .padding=${["3xs","s","0","s"]} gap="xs">
- <wui-input-text
- data-testid="swap-select-token-search-input"
- class="network-search-input"
- size="sm"
- placeholder="Search token"
- icon="search"
- .value=${this.searchValue}
- @inputChange=${this.onSearchInputChange.bind(this)}
- ></wui-input-text>
- </wui-flex>
- `}templateTokens(){const e=this.myTokensWithBalance?Object.values(this.myTokensWithBalance):[],r=this.popularTokens?this.popularTokens:[],n=this.filterTokensWithText(e,this.searchValue),i=this.filterTokensWithText(r,this.searchValue);return M`
- <wui-flex class="tokens-container">
- <wui-flex class="tokens" .padding=${["0","s","s","s"]} flexDirection="column">
- ${(n==null?void 0:n.length)>0?M`
- <wui-flex justifyContent="flex-start" padding="s">
- <wui-text variant="paragraph-500" color="fg-200">Your tokens</wui-text>
- </wui-flex>
- ${n.map(s=>{var a,c,u;const o=s.symbol===((a=this.sourceToken)==null?void 0:a.symbol)||s.symbol===((c=this.toToken)==null?void 0:c.symbol);return M`
- <wui-token-list-item
- data-testid="swap-select-token-item-${s.symbol}"
- name=${s.name}
- ?disabled=${o}
- symbol=${s.symbol}
- price=${s==null?void 0:s.price}
- amount=${(u=s==null?void 0:s.quantity)==null?void 0:u.numeric}
- imageSrc=${s.logoUri}
- @click=${()=>{o||this.onSelectToken(s)}}
- >
- </wui-token-list-item>
- `})}
- `:null}
- <wui-flex justifyContent="flex-start" padding="s">
- <wui-text variant="paragraph-500" color="fg-200">Tokens</wui-text>
- </wui-flex>
- ${(i==null?void 0:i.length)>0?i.map(s=>M`
- <wui-token-list-item
- data-testid="swap-select-token-item-${s.symbol}"
- name=${s.name}
- symbol=${s.symbol}
- imageSrc=${s.logoUri}
- @click=${()=>this.onSelectToken(s)}
- >
- </wui-token-list-item>
- `):null}
- </wui-flex>
- </wui-flex>
- `}templateSuggestedTokens(){const e=ye.state.suggestedTokens?ye.state.suggestedTokens.slice(0,8):null;return e?M`
- <wui-flex class="suggested-tokens-container" .padding=${["0","s","0","s"]} gap="xs">
- ${e.map(r=>M`
- <wui-token-button
- text=${r.symbol}
- imageSrc=${r.logoUri}
- @click=${()=>this.onSelectToken(r)}
- >
- </wui-token-button>
- `)}
- </wui-flex>
- `:null}onSearchInputChange(e){this.searchValue=e.detail}handleSuggestedTokensScroll(){var r;const e=(r=this.renderRoot)==null?void 0:r.querySelector(".suggested-tokens-container");e&&(e.style.setProperty("--suggested-tokens-scroll--left-opacity",K0.interpolate([0,100],[0,1],e.scrollLeft).toString()),e.style.setProperty("--suggested-tokens-scroll--right-opacity",K0.interpolate([0,100],[0,1],e.scrollWidth-e.scrollLeft-e.offsetWidth).toString()))}handleTokenListScroll(){var r;const e=(r=this.renderRoot)==null?void 0:r.querySelector(".tokens");e&&(e.style.setProperty("--tokens-scroll--top-opacity",K0.interpolate([0,100],[0,1],e.scrollTop).toString()),e.style.setProperty("--tokens-scroll--bottom-opacity",K0.interpolate([0,100],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString()))}filterTokensWithText(e,r){return e.filter(n=>`${n.symbol} ${n.name} ${n.address}`.toLowerCase().includes(r.toLowerCase()))}};so.styles=ixe;Ju([G()],so.prototype,"interval",void 0);Ju([G()],so.prototype,"targetToken",void 0);Ju([G()],so.prototype,"sourceToken",void 0);Ju([G()],so.prototype,"sourceTokenAmount",void 0);Ju([G()],so.prototype,"toToken",void 0);Ju([G()],so.prototype,"myTokensWithBalance",void 0);Ju([G()],so.prototype,"popularTokens",void 0);Ju([G()],so.prototype,"searchValue",void 0);so=Ju([te("w3m-swap-select-token-view")],so);const sxe=Object.freeze(Object.defineProperty({__proto__:null,get W3mSwapPreviewView(){return rn},get W3mSwapSelectTokenView(){return so},get W3mSwapView(){return tn}},Symbol.toStringTag,{value:"Module"})),oxe=de`
- :host {
- width: 100%;
- height: 100px;
- border-radius: var(--wui-border-radius-s);
- border: 1px solid var(--wui-color-gray-glass-002);
- background-color: var(--wui-color-gray-glass-002);
- transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
- will-change: background-color;
- position: relative;
- }
- :host(:hover) {
- background-color: var(--wui-color-gray-glass-005);
- }
- wui-flex {
- width: 100%;
- height: fit-content;
- }
- wui-button {
- display: ruby;
- color: var(--wui-color-fg-100);
- margin: 0 var(--wui-spacing-xs);
- }
- .instruction {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- z-index: 2;
- }
- .paste {
- display: inline-flex;
- }
- textarea {
- background: transparent;
- width: 100%;
- font-family: var(--w3m-font-family);
- font-size: var(--wui-font-size-medium);
- font-style: normal;
- font-weight: var(--wui-font-weight-light);
- line-height: 130%;
- letter-spacing: var(--wui-letter-spacing-medium);
- color: var(--wui-color-fg-100);
- caret-color: var(--wui-color-accent-100);
- box-sizing: border-box;
- -webkit-appearance: none;
- -moz-appearance: textfield;
- padding: 0px;
- border: none;
- outline: none;
- appearance: none;
- resize: none;
- overflow: hidden;
- }
- `;var PA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let $m=class extends se{constructor(){super(...arguments),this.inputElementRef=ec(),this.instructionElementRef=ec(),this.instructionHidden=!!this.value,this.pasting=!1,this.onDebouncedSearch=ue.debounce(async e=>{if(!e.length){this.setReceiverAddress("");return}const r=F.state.activeChain;if(ue.isAddress(e,r)){this.setReceiverAddress(e);return}try{const i=await xe.getEnsAddress(e);if(i){Qe.setReceiverProfileName(e),Qe.setReceiverAddress(i);const s=await xe.getEnsAvatar(e);Qe.setReceiverProfileImageUrl(s||void 0)}}catch{this.setReceiverAddress(e)}finally{Qe.setLoading(!1)}})}firstUpdated(){this.value&&(this.instructionHidden=!0),this.checkHidden()}render(){return M` <wui-flex
- @click=${this.onBoxClick.bind(this)}
- flexDirection="column"
- justifyContent="center"
- gap="4xs"
- .padding=${["2xl","l","xl","l"]}
- >
- <wui-text
- ${tc(this.instructionElementRef)}
- class="instruction"
- color="fg-300"
- variant="medium-400"
- >
- Type or
- <wui-button
- class="paste"
- size="md"
- variant="neutral"
- iconLeft="copy"
- @click=${this.onPasteClick.bind(this)}
- >
- <wui-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wui-icon>
- Paste
- </wui-button>
- address
- </wui-text>
- <textarea
- spellcheck="false"
- ?disabled=${!this.instructionHidden}
- ${tc(this.inputElementRef)}
- @input=${this.onInputChange.bind(this)}
- @blur=${this.onBlur.bind(this)}
- .value=${this.value??""}
- autocomplete="off"
- >
- ${this.value??""}</textarea
- >
- </wui-flex>`}async focusInput(){var e;this.instructionElementRef.value&&(this.instructionHidden=!0,await this.toggleInstructionFocus(!1),this.instructionElementRef.value.style.pointerEvents="none",(e=this.inputElementRef.value)==null||e.focus(),this.inputElementRef.value&&(this.inputElementRef.value.selectionStart=this.inputElementRef.value.selectionEnd=this.inputElementRef.value.value.length))}async focusInstruction(){var e;this.instructionElementRef.value&&(this.instructionHidden=!1,await this.toggleInstructionFocus(!0),this.instructionElementRef.value.style.pointerEvents="auto",(e=this.inputElementRef.value)==null||e.blur())}async toggleInstructionFocus(e){this.instructionElementRef.value&&await this.instructionElementRef.value.animate([{opacity:e?0:1},{opacity:e?1:0}],{duration:100,easing:"ease",fill:"forwards"}).finished}onBoxClick(){!this.value&&!this.instructionHidden&&this.focusInput()}onBlur(){!this.value&&this.instructionHidden&&!this.pasting&&this.focusInstruction()}checkHidden(){this.instructionHidden&&this.focusInput()}async onPasteClick(){this.pasting=!0;const e=await navigator.clipboard.readText();Qe.setReceiverAddress(e),this.focusInput()}onInputChange(e){var n;const r=e.target;this.pasting=!1,this.value=(n=e.target)==null?void 0:n.value,r.value&&!this.instructionHidden&&this.focusInput(),Qe.setLoading(!0),this.onDebouncedSearch(r.value)}setReceiverAddress(e){Qe.setReceiverAddress(e),Qe.setReceiverProfileName(void 0),Qe.setReceiverProfileImageUrl(void 0),Qe.setLoading(!1)}};$m.styles=oxe;PA([q()],$m.prototype,"value",void 0);PA([G()],$m.prototype,"instructionHidden",void 0);PA([G()],$m.prototype,"pasting",void 0);$m=PA([te("w3m-input-address")],$m);const axe=de`
- :host {
- position: relative;
- display: inline-block;
- }
- input {
- background: transparent;
- width: 100%;
- height: auto;
- font-family: var(--wui-font-family);
- color: var(--wui-color-fg-100);
- font-feature-settings: 'case' on;
- font-size: 32px;
- font-weight: var(--wui-font-weight-light);
- caret-color: var(--wui-color-accent-100);
- line-height: 130%;
- letter-spacing: -1.28px;
- box-sizing: border-box;
- -webkit-appearance: none;
- -moz-appearance: textfield;
- padding: 0px;
- }
- input::-webkit-outer-spin-button,
- input::-webkit-inner-spin-button {
- -webkit-appearance: none;
- margin: 0;
- }
- input::placeholder {
- color: var(--wui-color-fg-275);
- }
- `;var OA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let jm=class extends se{constructor(){super(...arguments),this.inputElementRef=ec(),this.disabled=!1,this.value="",this.placeholder="0"}render(){var e;return(e=this.inputElementRef)!=null&&e.value&&this.value&&(this.inputElementRef.value.value=this.value),M`<input
- ${tc(this.inputElementRef)}
- type="text"
- inputmode="decimal"
- pattern="[0-9,.]*"
- placeholder=${this.placeholder}
- ?disabled=${this.disabled}
- autofocus
- value=${this.value??""}
- @input=${this.dispatchInputChangeEvent.bind(this)}
- /> `}dispatchInputChangeEvent(e){var n,i;const r=e.data;if(r&&((n=this.inputElementRef)!=null&&n.value))if(r===","){const s=this.inputElementRef.value.value.replace(",",".");this.inputElementRef.value.value=s,this.value=`${this.value}${s}`}else iAe.test(r)||(this.inputElementRef.value.value=this.value.replace(new RegExp(r.replace(nAe,"\\$&"),"gu"),""));this.dispatchEvent(new CustomEvent("inputChange",{detail:(i=this.inputElementRef.value)==null?void 0:i.value,bubbles:!0,composed:!0}))}};jm.styles=[He,vt,axe];OA([q({type:Boolean})],jm.prototype,"disabled",void 0);OA([q({type:String})],jm.prototype,"value",void 0);OA([q({type:String})],jm.prototype,"placeholder",void 0);jm=OA([te("wui-input-amount")],jm);const cxe=de`
- :host {
- width: 100%;
- height: 100px;
- border-radius: var(--wui-border-radius-s);
- border: 1px solid var(--wui-color-gray-glass-002);
- background-color: var(--wui-color-gray-glass-002);
- transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
- will-change: background-color;
- }
- :host(:hover) {
- background-color: var(--wui-color-gray-glass-005);
- }
- wui-flex {
- width: 100%;
- height: fit-content;
- }
- wui-button {
- width: 100%;
- display: flex;
- justify-content: flex-end;
- }
- wui-input-amount {
- mask-image: linear-gradient(
- 270deg,
- transparent 0px,
- transparent 8px,
- black 24px,
- black 25px,
- black 32px,
- black 100%
- );
- }
- .totalValue {
- width: 100%;
- }
- `;var H7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let My=class extends se{render(){return M` <wui-flex
- flexDirection="column"
- gap="4xs"
- .padding=${["xl","s","l","l"]}
- >
- <wui-flex alignItems="center">
- <wui-input-amount
- @inputChange=${this.onInputChange.bind(this)}
- ?disabled=${!this.token&&!0}
- .value=${this.sendTokenAmount?String(this.sendTokenAmount):""}
- ></wui-input-amount>
- ${this.buttonTemplate()}
- </wui-flex>
- <wui-flex alignItems="center" justifyContent="space-between">
- ${this.sendValueTemplate()}
- <wui-flex alignItems="center" gap="4xs" justifyContent="flex-end">
- ${this.maxAmountTemplate()} ${this.actionTemplate()}
- </wui-flex>
- </wui-flex>
- </wui-flex>`}buttonTemplate(){return this.token?M`<wui-token-button
- text=${this.token.symbol}
- imageSrc=${this.token.iconUrl}
- @click=${this.handleSelectButtonClick.bind(this)}
- >
- </wui-token-button>`:M`<wui-button
- size="md"
- variant="accent"
- @click=${this.handleSelectButtonClick.bind(this)}
- >Select token</wui-button
- >`}handleSelectButtonClick(){X.push("WalletSendSelectToken")}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const r=this.token.price*this.sendTokenAmount;return M`<wui-text class="totalValue" variant="small-400" color="fg-200"
- >${r?`$${nt.formatNumberToLocalString(r,2)}`:"Incorrect value"}</wui-text
- >`}return null}maxAmountTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?M` <wui-text variant="small-400" color="error-100">
- ${nt.roundNumber(Number(this.token.quantity.numeric),6,5)}
- </wui-text>`:M` <wui-text variant="small-400" color="fg-200">
- ${nt.roundNumber(Number(this.token.quantity.numeric),6,5)}
- </wui-text>`:null}actionTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?M`<wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>`:M`<wui-link @click=${this.onMaxClick.bind(this)}>Max</wui-link>`:null}onInputChange(e){Qe.setTokenAmount(e.detail)}onMaxClick(){if(this.token){const e=Dt.bigNumber(this.token.quantity.numeric);Qe.setTokenAmount(Number(e.toFixed(20)))}}onBuyClick(){X.push("OnRampProviders")}};My.styles=cxe;H7([q({type:Object})],My.prototype,"token",void 0);H7([q({type:Number})],My.prototype,"sendTokenAmount",void 0);My=H7([te("w3m-input-token")],My);const uxe=de`
- :host {
- display: block;
- }
- wui-flex {
- position: relative;
- }
- wui-icon-box {
- width: 40px;
- height: 40px;
- border-radius: var(--wui-border-radius-xs) !important;
- border: 5px solid var(--wui-color-bg-125);
- background: var(--wui-color-bg-175);
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- z-index: 3;
- }
- wui-button {
- --local-border-radius: var(--wui-border-radius-xs) !important;
- }
- .inputContainer {
- height: fit-content;
- }
- `;var Tp=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let nc=class extends se{constructor(){super(),this.unsubscribe=[],this.token=Qe.state.token,this.sendTokenAmount=Qe.state.sendTokenAmount,this.receiverAddress=Qe.state.receiverAddress,this.receiverProfileName=Qe.state.receiverProfileName,this.loading=Qe.state.loading,this.message="Preview Send",this.fetchNetworkPrice(),this.fetchBalances(),this.unsubscribe.push(Qe.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.receiverProfileName=e.receiverProfileName,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.getMessage(),M` <wui-flex flexDirection="column" .padding=${["0","l","l","l"]}>
- <wui-flex class="inputContainer" gap="xs" flexDirection="column">
- <w3m-input-token
- .token=${this.token}
- .sendTokenAmount=${this.sendTokenAmount}
- ></w3m-input-token>
- <wui-icon-box
- size="inherit"
- backgroundColor="fg-300"
- iconSize="lg"
- iconColor="fg-250"
- background="opaque"
- icon="arrowBottom"
- ></wui-icon-box>
- <w3m-input-address
- .value=${this.receiverProfileName?this.receiverProfileName:this.receiverAddress}
- ></w3m-input-address>
- </wui-flex>
- <wui-flex .margin=${["l","0","0","0"]}>
- <wui-button
- @click=${this.onButtonClick.bind(this)}
- ?disabled=${!this.message.startsWith("Preview Send")}
- size="lg"
- variant="main"
- ?loading=${this.loading}
- fullWidth
- >
- ${this.message}
- </wui-button>
- </wui-flex>
- </wui-flex>`}async fetchBalances(){await Qe.fetchTokenBalance(),Qe.fetchNetworkBalance()}async fetchNetworkPrice(){await ye.getNetworkTokenPrice()}onButtonClick(){X.push("WalletSendPreview")}getMessage(){var e;this.message="Preview Send",this.receiverAddress&&!ue.isAddress(this.receiverAddress,F.state.activeChain)&&(this.message="Invalid Address"),this.receiverAddress||(this.message="Add Address"),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message="Insufficient Funds"),this.sendTokenAmount||(this.message="Add Amount"),this.sendTokenAmount&&((e=this.token)!=null&&e.price)&&(this.sendTokenAmount*this.token.price||(this.message="Incorrect Value")),this.token||(this.message="Select Token")}};nc.styles=uxe;Tp([G()],nc.prototype,"token",void 0);Tp([G()],nc.prototype,"sendTokenAmount",void 0);Tp([G()],nc.prototype,"receiverAddress",void 0);Tp([G()],nc.prototype,"receiverProfileName",void 0);Tp([G()],nc.prototype,"loading",void 0);Tp([G()],nc.prototype,"message",void 0);nc=Tp([te("w3m-wallet-send-view")],nc);const lxe=de`
- button {
- padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs);
- display: flex;
- justify-content: space-between;
- width: 100%;
- border-radius: var(--wui-border-radius-xs);
- background-color: var(--wui-color-gray-glass-002);
- }
- button[data-clickable='false'] {
- pointer-events: none;
- background-color: transparent;
- }
- wui-image,
- wui-icon {
- width: var(--wui-spacing-3xl);
- height: var(--wui-spacing-3xl);
- }
- wui-image {
- border-radius: var(--wui-border-radius-3xl);
- }
- `;var Ip=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Bu=class extends se{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return M`
- <button data-clickable=${String(this.clickable)}>
- <wui-flex gap="s" alignItems="center">
- ${this.visualTemplate()}
- <wui-flex flexDirection="column" justifyContent="spaceBetween">
- <wui-text variant="paragraph-500" color="fg-100">${this.tokenName}</wui-text>
- <wui-text variant="small-400" color="fg-200">
- ${nt.formatNumberToLocalString(this.tokenAmount,4)} ${this.tokenCurrency}
- </wui-text>
- </wui-flex>
- </wui-flex>
- <wui-text variant="paragraph-500" color="fg-100">$${this.tokenValue.toFixed(2)}</wui-text>
- </button>
- `}visualTemplate(){return this.tokenName&&this.tokenImageUrl?M`<wui-image alt=${this.tokenName} src=${this.tokenImageUrl}></wui-image>`:M`<wui-icon name="coinPlaceholder" color="fg-100"></wui-icon>`}};Bu.styles=[He,vt,lxe];Ip([q()],Bu.prototype,"tokenName",void 0);Ip([q()],Bu.prototype,"tokenImageUrl",void 0);Ip([q({type:Number})],Bu.prototype,"tokenValue",void 0);Ip([q()],Bu.prototype,"tokenAmount",void 0);Ip([q()],Bu.prototype,"tokenCurrency",void 0);Ip([q({type:Boolean})],Bu.prototype,"clickable",void 0);Bu=Ip([te("wui-list-token")],Bu);const dxe=de`
- :host {
- position: relative;
- display: flex;
- width: 100%;
- height: 1px;
- background-color: var(--wui-color-gray-glass-005);
- justify-content: center;
- align-items: center;
- }
- :host > wui-text {
- position: absolute;
- padding: 0px 10px;
- background-color: var(--wui-color-modal-bg);
- transition: background-color var(--wui-duration-lg) var(--wui-ease-out-power-1);
- will-change: background-color;
- }
- `;var QJ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let d6=class extends se{constructor(){super(...arguments),this.text=""}render(){return M`${this.template()}`}template(){return this.text?M`<wui-text variant="small-500" color="fg-200">${this.text}</wui-text>`:null}};d6.styles=[He,dxe];QJ([q()],d6.prototype,"text",void 0);d6=QJ([te("wui-separator")],d6);const hxe=de`
- .contentContainer {
- height: 440px;
- overflow: scroll;
- scrollbar-width: none;
- }
- .contentContainer::-webkit-scrollbar {
- display: none;
- }
- wui-icon-box {
- width: 40px;
- height: 40px;
- border-radius: var(--wui-border-radius-xxs);
- }
- `;var i2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Ad=class extends se{constructor(){super(),this.unsubscribe=[],this.tokenBalances=Qe.state.tokenBalances,this.search="",this.onDebouncedSearch=ue.debounce(e=>{this.search=e}),this.unsubscribe.push(Qe.subscribe(e=>{this.tokenBalances=e.tokenBalances}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return M`
- <wui-flex flexDirection="column">
- ${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
- </wui-flex>
- `}templateSearchInput(){return M`
- <wui-flex gap="xs" padding="s">
- <wui-input-text
- @inputChange=${this.onInputChange.bind(this)}
- class="network-search-input"
- size="sm"
- placeholder="Search token"
- icon="search"
- ></wui-input-text>
- </wui-flex>
- `}templateTokens(){var e,r;return this.tokens=(e=this.tokenBalances)==null?void 0:e.filter(n=>{var i;return n.chainId===((i=F.state.activeCaipNetwork)==null?void 0:i.caipNetworkId)}),this.search?this.filteredTokens=(r=this.tokenBalances)==null?void 0:r.filter(n=>n.name.toLowerCase().includes(this.search.toLowerCase())):this.filteredTokens=this.tokens,M`
- <wui-flex
- class="contentContainer"
- flexDirection="column"
- .padding=${["0","s","0","s"]}
- >
- <wui-flex justifyContent="flex-start" .padding=${["m","s","s","s"]}>
- <wui-text variant="paragraph-500" color="fg-200">Your tokens</wui-text>
- </wui-flex>
- <wui-flex flexDirection="column" gap="xs">
- ${this.filteredTokens&&this.filteredTokens.length>0?this.filteredTokens.map(n=>M`<wui-list-token
- @click=${this.handleTokenClick.bind(this,n)}
- ?clickable=${!0}
- tokenName=${n.name}
- tokenImageUrl=${n.iconUrl}
- tokenAmount=${n.quantity.numeric}
- tokenValue=${n.value}
- tokenCurrency=${n.symbol}
- ></wui-list-token>`):M`<wui-flex
- .padding=${["4xl","0","0","0"]}
- alignItems="center"
- flexDirection="column"
- gap="l"
- >
- <wui-icon-box
- icon="coinPlaceholder"
- size="inherit"
- iconColor="fg-200"
- backgroundColor="fg-200"
- iconSize="lg"
- ></wui-icon-box>
- <wui-flex
- class="textContent"
- gap="xs"
- flexDirection="column"
- justifyContent="center"
- flexDirection="column"
- >
- <wui-text variant="paragraph-500" align="center" color="fg-100"
- >No tokens found</wui-text
- >
- <wui-text variant="small-400" align="center" color="fg-200"
- >Your tokens will appear here</wui-text
- >
- </wui-flex>
- <wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
- </wui-flex>`}
- </wui-flex>
- </wui-flex>
- `}onBuyClick(){X.push("OnRampProviders")}onInputChange(e){this.onDebouncedSearch(e.detail)}handleTokenClick(e){Qe.setToken(e),Qe.setTokenAmount(void 0),X.goBack()}};Ad.styles=hxe;i2([G()],Ad.prototype,"tokenBalances",void 0);i2([G()],Ad.prototype,"tokens",void 0);i2([G()],Ad.prototype,"filteredTokens",void 0);i2([G()],Ad.prototype,"search",void 0);Ad=i2([te("w3m-wallet-send-select-token-view")],Ad);const fxe=de`
- :host {
- display: block;
- width: var(--local-width);
- height: var(--local-height);
- border-radius: var(--wui-border-radius-3xl);
- box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005);
- overflow: hidden;
- position: relative;
- }
- :host([data-variant='generated']) {
- --mixed-local-color-1: var(--local-color-1);
- --mixed-local-color-2: var(--local-color-2);
- --mixed-local-color-3: var(--local-color-3);
- --mixed-local-color-4: var(--local-color-4);
- --mixed-local-color-5: var(--local-color-5);
- }
- @supports (background: color-mix(in srgb, white 50%, black)) {
- :host([data-variant='generated']) {
- --mixed-local-color-1: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--local-color-1)
- );
- --mixed-local-color-2: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--local-color-2)
- );
- --mixed-local-color-3: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--local-color-3)
- );
- --mixed-local-color-4: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--local-color-4)
- );
- --mixed-local-color-5: color-mix(
- in srgb,
- var(--w3m-color-mix) var(--w3m-color-mix-strength),
- var(--local-color-5)
- );
- }
- }
- :host([data-variant='generated']) {
- box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005);
- background: radial-gradient(
- var(--local-radial-circle),
- #fff 0.52%,
- var(--mixed-local-color-5) 31.25%,
- var(--mixed-local-color-3) 51.56%,
- var(--mixed-local-color-2) 65.63%,
- var(--mixed-local-color-1) 82.29%,
- var(--mixed-local-color-4) 100%
- );
- }
- :host([data-variant='default']) {
- box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005);
- background: radial-gradient(
- 75.29% 75.29% at 64.96% 24.36%,
- #fff 0.52%,
- #f5ccfc 31.25%,
- #dba4f5 51.56%,
- #9a8ee8 65.63%,
- #6493da 82.29%,
- #6ebdea 100%
- );
- }
- `;var s2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let ip=class extends se{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0,this.size="xl"}render(){return this.style.cssText=`
- --local-width: var(--wui-icon-box-size-${this.size});
- --local-height: var(--wui-icon-box-size-${this.size});
- `,M`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",M`<wui-image src=${this.imageSrc} alt=${this.alt??"avatar"}></wui-image>`;if(this.address){this.dataset.variant="generated";const e=nt.generateAvatarColors(this.address);return this.style.cssText+=`
- ${e}`,null}return this.dataset.variant="default",null}};ip.styles=[He,fxe];s2([q()],ip.prototype,"imageSrc",void 0);s2([q()],ip.prototype,"alt",void 0);s2([q()],ip.prototype,"address",void 0);s2([q()],ip.prototype,"size",void 0);ip=s2([te("wui-avatar")],ip);const pxe=de`
- :host {
- display: flex;
- gap: var(--wui-spacing-xs);
- border-radius: var(--wui-border-radius-3xl);
- border: 1px solid var(--wui-color-gray-glass-002);
- background: var(--wui-color-gray-glass-002);
- padding: var(--wui-spacing-2xs) var(--wui-spacing-xs) var(--wui-spacing-2xs)
- var(--wui-spacing-s);
- align-items: center;
- }
- wui-avatar,
- wui-icon,
- wui-image {
- width: 32px;
- height: 32px;
- border: 1px solid var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-3xl);
- box-shadow: 0 0 0 2px var(--wui-color-gray-glass-002);
- }
- `;var o2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let sp=class extends se{constructor(){super(...arguments),this.text="",this.address="",this.isAddress=!1}render(){return M`<wui-text variant="large-500" color="fg-100">${this.text}</wui-text>
- ${this.imageTemplate()}`}imageTemplate(){return this.isAddress?M`<wui-avatar address=${this.address} .imageSrc=${this.imageSrc}></wui-avatar>`:this.imageSrc?M`<wui-image src=${this.imageSrc}></wui-image>`:M`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`}};sp.styles=[He,vt,pxe];o2([q()],sp.prototype,"text",void 0);o2([q()],sp.prototype,"address",void 0);o2([q()],sp.prototype,"imageSrc",void 0);o2([q({type:Boolean})],sp.prototype,"isAddress",void 0);sp=o2([te("wui-preview-item")],sp);const gxe=de`
- :host {
- display: flex;
- column-gap: var(--wui-spacing-s);
- padding: 17px 18px 17px var(--wui-spacing-m);
- width: 100%;
- background-color: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xs);
- color: var(--wui-color-fg-250);
- }
- wui-image {
- width: var(--wui-icon-size-lg);
- height: var(--wui-icon-size-lg);
- border-radius: var(--wui-border-radius-3xl);
- }
- wui-icon {
- width: var(--wui-icon-size-lg);
- height: var(--wui-icon-size-lg);
- }
- `;var RA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Bm=class extends se{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return M`
- <wui-flex justifyContent="space-between" alignItems="center">
- <wui-text variant="paragraph-500" color=${this.textValue?"fg-200":"fg-100"}>
- ${this.textTitle}
- </wui-text>
- ${this.templateContent()}
- </wui-flex>
- `}templateContent(){return this.imageSrc?M`<wui-image src=${this.imageSrc} alt=${this.textTitle}></wui-image>`:this.textValue?M` <wui-text variant="paragraph-400" color="fg-100"> ${this.textValue} </wui-text>`:M`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`}};Bm.styles=[He,vt,gxe];RA([q()],Bm.prototype,"imageSrc",void 0);RA([q()],Bm.prototype,"textTitle",void 0);RA([q()],Bm.prototype,"textValue",void 0);Bm=RA([te("wui-list-content")],Bm);const mxe=de`
- :host {
- display: flex;
- width: auto;
- flex-direction: column;
- gap: var(--wui-border-radius-1xs);
- border-radius: var(--wui-border-radius-s);
- background: var(--wui-color-gray-glass-002);
- padding: var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs)
- var(--wui-spacing-1xs);
- }
- wui-text {
- padding: 0 var(--wui-spacing-1xs);
- }
- wui-flex {
- margin-top: var(--wui-spacing-1xs);
- }
- .network {
- cursor: pointer;
- transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
- will-change: background-color;
- }
- .network:focus-visible {
- border: 1px solid var(--wui-color-accent-100);
- background-color: var(--wui-color-gray-glass-005);
- -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
- -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
- box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
- }
- .network:hover {
- background-color: var(--wui-color-gray-glass-005);
- }
- .network:active {
- background-color: var(--wui-color-gray-glass-010);
- }
- `;var q7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Ly=class extends se{render(){return M` <wui-text variant="small-400" color="fg-200">Details</wui-text>
- <wui-flex flexDirection="column" gap="xxs">
- <wui-list-content
- textTitle="Address"
- textValue=${nt.getTruncateString({string:this.receiverAddress??"",charsStart:4,charsEnd:4,truncate:"middle"})}
- >
- </wui-list-content>
- ${this.networkTemplate()}
- </wui-flex>`}networkTemplate(){var e;return(e=this.caipNetwork)!=null&&e.name?M` <wui-list-content
- @click=${()=>this.onNetworkClick(this.caipNetwork)}
- class="network"
- textTitle="Network"
- imageSrc=${we(pt.getNetworkImage(this.caipNetwork))}
- ></wui-list-content>`:null}onNetworkClick(e){e&&X.push("Networks",{network:e})}};Ly.styles=mxe;q7([q()],Ly.prototype,"receiverAddress",void 0);q7([q({type:Object})],Ly.prototype,"caipNetwork",void 0);Ly=q7([te("w3m-wallet-send-details")],Ly);const wxe=de`
- wui-avatar,
- wui-image {
- display: ruby;
- width: 32px;
- height: 32px;
- border-radius: var(--wui-border-radius-3xl);
- }
- .sendButton {
- width: 70%;
- --local-width: 100% !important;
- --local-border-radius: var(--wui-border-radius-xs) !important;
- }
- .cancelButton {
- width: 30%;
- --local-width: 100% !important;
- --local-border-radius: var(--wui-border-radius-xs) !important;
- }
- `;var Ld=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Jo=class extends se{constructor(){super(),this.unsubscribe=[],this.token=Qe.state.token,this.sendTokenAmount=Qe.state.sendTokenAmount,this.receiverAddress=Qe.state.receiverAddress,this.receiverProfileName=Qe.state.receiverProfileName,this.receiverProfileImageUrl=Qe.state.receiverProfileImageUrl,this.caipNetwork=F.state.activeCaipNetwork,this.loading=Qe.state.loading,this.unsubscribe.push(Qe.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress,this.receiverProfileName=e.receiverProfileName,this.receiverProfileImageUrl=e.receiverProfileImageUrl,this.loading=e.loading}),F.subscribeKey("activeCaipNetwork",e=>this.caipNetwork=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e,r;return M` <wui-flex flexDirection="column" .padding=${["0","l","l","l"]}>
- <wui-flex gap="xs" flexDirection="column" .padding=${["0","xs","0","xs"]}>
- <wui-flex alignItems="center" justifyContent="space-between">
- <wui-flex flexDirection="column" gap="4xs">
- <wui-text variant="small-400" color="fg-150">Send</wui-text>
- ${this.sendValueTemplate()}
- </wui-flex>
- <wui-preview-item
- text="${this.sendTokenAmount?nt.roundNumber(this.sendTokenAmount,6,5):"unknown"} ${(e=this.token)==null?void 0:e.symbol}"
- .imageSrc=${(r=this.token)==null?void 0:r.iconUrl}
- ></wui-preview-item>
- </wui-flex>
- <wui-flex>
- <wui-icon color="fg-200" size="md" name="arrowBottom"></wui-icon>
- </wui-flex>
- <wui-flex alignItems="center" justifyContent="space-between">
- <wui-text variant="small-400" color="fg-150">To</wui-text>
- <wui-preview-item
- text="${this.receiverProfileName?nt.getTruncateString({string:this.receiverProfileName,charsStart:20,charsEnd:0,truncate:"end"}):nt.getTruncateString({string:this.receiverAddress?this.receiverAddress:"",charsStart:4,charsEnd:4,truncate:"middle"})}"
- address=${this.receiverAddress??""}
- .imageSrc=${this.receiverProfileImageUrl??void 0}
- .isAddress=${!0}
- ></wui-preview-item>
- </wui-flex>
- </wui-flex>
- <wui-flex flexDirection="column" .padding=${["xxl","0","0","0"]}>
- <w3m-wallet-send-details
- .caipNetwork=${this.caipNetwork}
- .receiverAddress=${this.receiverAddress}
- ></w3m-wallet-send-details>
- <wui-flex justifyContent="center" gap="xxs" .padding=${["s","0","0","0"]}>
- <wui-icon size="sm" color="fg-200" name="warningCircle"></wui-icon>
- <wui-text variant="small-400" color="fg-200">Review transaction carefully</wui-text>
- </wui-flex>
- <wui-flex justifyContent="center" gap="s" .padding=${["l","0","0","0"]}>
- <wui-button
- class="cancelButton"
- @click=${this.onCancelClick.bind(this)}
- size="lg"
- variant="neutral"
- >
- Cancel
- </wui-button>
- <wui-button
- class="sendButton"
- @click=${this.onSendClick.bind(this)}
- size="lg"
- variant="main"
- .loading=${this.loading}
- >
- Send
- </wui-button>
- </wui-flex>
- </wui-flex></wui-flex
- >`}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const r=this.token.price*this.sendTokenAmount;return M`<wui-text variant="paragraph-400" color="fg-100"
- >$${r.toFixed(2)}</wui-text
- >`}return null}async onSendClick(){var e,r,n;if(!this.sendTokenAmount||!this.receiverAddress){Fe.showError("Please enter a valid amount and receiver address");return}try{await Qe.sendToken(),Fe.showSuccess("Transaction started"),X.replace("Account")}catch(i){Fe.showError("Failed to send transaction. Please try again."),console.error("SendController:sendToken - failed to send transaction",i);const s=F.state.activeChain,o=i instanceof Error?i.message:"Unknown error";Re.sendEvent({type:"track",event:"SEND_ERROR",properties:{message:o,isSmartAccount:((e=re.state.preferredAccountTypes)==null?void 0:e[s])===bt.ACCOUNT_TYPES.SMART_ACCOUNT,token:((r=this.token)==null?void 0:r.symbol)||"",amount:this.sendTokenAmount,network:((n=F.state.activeCaipNetwork)==null?void 0:n.caipNetworkId)||""}})}}onCancelClick(){X.goBack()}};Jo.styles=wxe;Ld([G()],Jo.prototype,"token",void 0);Ld([G()],Jo.prototype,"sendTokenAmount",void 0);Ld([G()],Jo.prototype,"receiverAddress",void 0);Ld([G()],Jo.prototype,"receiverProfileName",void 0);Ld([G()],Jo.prototype,"receiverProfileImageUrl",void 0);Ld([G()],Jo.prototype,"caipNetwork",void 0);Ld([G()],Jo.prototype,"loading",void 0);Jo=Ld([te("w3m-wallet-send-preview-view")],Jo);const bxe=Object.freeze(Object.defineProperty({__proto__:null,get W3mSendSelectTokenView(){return Ad},get W3mWalletSendPreviewView(){return Jo},get W3mWalletSendView(){return nc}},Symbol.toStringTag,{value:"Module"})),yxe=de`
- button {
- border: none;
- border-radius: var(--wui-border-radius-3xl);
- }
- button[data-variant='main'] {
- background-color: var(--wui-color-accent-100);
- color: var(--wui-color-inverse-100);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
- }
- button[data-variant='accent'] {
- background-color: var(--wui-color-accent-glass-010);
- color: var(--wui-color-accent-100);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
- }
- button[data-variant='gray'] {
- background-color: transparent;
- color: var(--wui-color-fg-200);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
- }
- button[data-variant='shade'] {
- background-color: transparent;
- color: var(--wui-color-accent-100);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
- }
- button[data-size='sm'] {
- height: 32px;
- padding: 0 var(--wui-spacing-s);
- }
- button[data-size='md'] {
- height: 40px;
- padding: 0 var(--wui-spacing-l);
- }
- button[data-size='sm'] > wui-image {
- width: 16px;
- height: 16px;
- }
- button[data-size='md'] > wui-image {
- width: 24px;
- height: 24px;
- }
- button[data-size='sm'] > wui-icon {
- width: 12px;
- height: 12px;
- }
- button[data-size='md'] > wui-icon {
- width: 14px;
- height: 14px;
- }
- wui-image {
- border-radius: var(--wui-border-radius-3xl);
- overflow: hidden;
- }
- button.disabled > wui-icon,
- button.disabled > wui-image {
- filter: grayscale(1);
- }
- button[data-variant='main'] > wui-image {
- box-shadow: inset 0 0 0 1px var(--wui-color-accent-090);
- }
- button[data-variant='shade'] > wui-image,
- button[data-variant='gray'] > wui-image {
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
- }
- @media (hover: hover) and (pointer: fine) {
- button[data-variant='main']:focus-visible {
- background-color: var(--wui-color-accent-090);
- }
- button[data-variant='main']:hover:enabled {
- background-color: var(--wui-color-accent-090);
- }
- button[data-variant='main']:active:enabled {
- background-color: var(--wui-color-accent-080);
- }
- button[data-variant='accent']:hover:enabled {
- background-color: var(--wui-color-accent-glass-015);
- }
- button[data-variant='accent']:active:enabled {
- background-color: var(--wui-color-accent-glass-020);
- }
- button[data-variant='shade']:focus-visible,
- button[data-variant='gray']:focus-visible,
- button[data-variant='shade']:hover,
- button[data-variant='gray']:hover {
- background-color: var(--wui-color-gray-glass-002);
- }
- button[data-variant='gray']:active,
- button[data-variant='shade']:active {
- background-color: var(--wui-color-gray-glass-005);
- }
- }
- button.disabled {
- color: var(--wui-color-gray-glass-020);
- background-color: var(--wui-color-gray-glass-002);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
- pointer-events: none;
- }
- `;var Pp=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Du=class extends se{constructor(){super(...arguments),this.variant="accent",this.imageSrc="",this.disabled=!1,this.icon="externalLink",this.size="md",this.text=""}render(){const e=this.size==="sm"?"small-600":"paragraph-600";return M`
- <button
- class=${this.disabled?"disabled":""}
- data-variant=${this.variant}
- data-size=${this.size}
- >
- ${this.imageSrc?M`<wui-image src=${this.imageSrc}></wui-image>`:null}
- <wui-text variant=${e} color="inherit"> ${this.text} </wui-text>
- <wui-icon name=${this.icon} color="inherit" size="inherit"></wui-icon>
- </button>
- `}};Du.styles=[He,vt,yxe];Pp([q()],Du.prototype,"variant",void 0);Pp([q()],Du.prototype,"imageSrc",void 0);Pp([q({type:Boolean})],Du.prototype,"disabled",void 0);Pp([q()],Du.prototype,"icon",void 0);Pp([q()],Du.prototype,"size",void 0);Pp([q()],Du.prototype,"text",void 0);Du=Pp([te("wui-chip-button")],Du);const vxe=de`
- button {
- display: flex;
- gap: var(--wui-spacing-xl);
- width: 100%;
- background-color: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xxs);
- padding: var(--wui-spacing-m) var(--wui-spacing-s);
- }
- wui-text {
- width: 100%;
- }
- wui-flex {
- width: auto;
- }
- .network-icon {
- width: var(--wui-spacing-2l);
- height: var(--wui-spacing-2l);
- border-radius: calc(var(--wui-spacing-2l) / 2);
- overflow: hidden;
- box-shadow:
- 0 0 0 3px var(--wui-color-gray-glass-002),
- 0 0 0 3px var(--wui-color-modal-bg);
- }
- `;var z7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Uy=class extends se{constructor(){super(...arguments),this.networkImages=[""],this.text=""}render(){return M`
- <button>
- <wui-text variant="small-400" color="fg-200">${this.text}</wui-text>
- <wui-flex gap="3xs" alignItems="center">
- ${this.networksTemplate()}
- <wui-icon name="chevronRight" size="sm" color="fg-200"></wui-icon>
- </wui-flex>
- </button>
- `}networksTemplate(){const e=this.networkImages.slice(0,5);return M` <wui-flex class="networks">
- ${e==null?void 0:e.map(r=>M` <wui-flex class="network-icon"> <wui-image src=${r}></wui-image> </wui-flex>`)}
- </wui-flex>`}};Uy.styles=[He,vt,vxe];z7([q({type:Array})],Uy.prototype,"networkImages",void 0);z7([q()],Uy.prototype,"text",void 0);Uy=z7([te("wui-compatible-network")],Uy);const _xe=de`
- wui-compatible-network {
- margin-top: var(--wui-spacing-l);
- }
- `;var a2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let xd=class extends se{constructor(){super(),this.unsubscribe=[],this.address=re.state.address,this.profileName=re.state.profileName,this.network=F.state.activeCaipNetwork,this.preferredAccountTypes=re.state.preferredAccountTypes,this.unsubscribe.push(re.subscribe(e=>{e.address?(this.address=e.address,this.profileName=e.profileName,this.preferredAccountTypes=e.preferredAccountTypes):Fe.showError("Account not found")}),F.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-wallet-receive-view: No account provided");const e=pt.getNetworkImage(this.network);return M` <wui-flex
- flexDirection="column"
- .padding=${["0","l","l","l"]}
- alignItems="center"
- >
- <wui-chip-button
- data-testid="receive-address-copy-button"
- @click=${this.onCopyClick.bind(this)}
- text=${nt.getTruncateString({string:this.profileName||this.address||"",charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
- icon="copy"
- size="sm"
- imageSrc=${e||""}
- variant="gray"
- ></wui-chip-button>
- <wui-flex
- flexDirection="column"
- .padding=${["l","0","0","0"]}
- alignItems="center"
- gap="s"
- >
- <wui-qr-code
- size=${232}
- theme=${ar.state.themeMode}
- uri=${this.address}
- ?arenaClear=${!0}
- color=${we(ar.state.themeVariables["--w3m-qr-color"])}
- data-testid="wui-qr-code"
- ></wui-qr-code>
- <wui-text variant="paragraph-500" color="fg-100" align="center">
- Copy your address or scan this QR code
- </wui-text>
- </wui-flex>
- ${this.networkTemplate()}
- </wui-flex>`}networkTemplate(){var a,c;const e=F.getAllRequestedCaipNetworks(),r=F.checkIfSmartAccountEnabled(),n=F.state.activeCaipNetwork,i=e.filter(u=>(u==null?void 0:u.chainNamespace)===(n==null?void 0:n.chainNamespace));if(((a=this.preferredAccountTypes)==null?void 0:a[n==null?void 0:n.chainNamespace])===bt.ACCOUNT_TYPES.SMART_ACCOUNT&&r)return n?M`<wui-compatible-network
- @click=${this.onReceiveClick.bind(this)}
- text="Only receive assets on this network"
- .networkImages=${[pt.getNetworkImage(n)??""]}
- ></wui-compatible-network>`:null;const o=((c=i==null?void 0:i.filter(u=>{var l;return(l=u==null?void 0:u.assets)==null?void 0:l.imageId}))==null?void 0:c.slice(0,5)).map(pt.getNetworkImage).filter(Boolean);return M`<wui-compatible-network
- @click=${this.onReceiveClick.bind(this)}
- text="Only receive assets on these networks"
- .networkImages=${o}
- ></wui-compatible-network>`}onReceiveClick(){X.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&(ue.copyToClopboard(this.address),Fe.showSuccess("Address copied"))}catch{Fe.showError("Failed to copy")}}};xd.styles=_xe;a2([G()],xd.prototype,"address",void 0);a2([G()],xd.prototype,"profileName",void 0);a2([G()],xd.prototype,"network",void 0);a2([G()],xd.prototype,"preferredAccountTypes",void 0);xd=a2([te("w3m-wallet-receive-view")],xd);const Exe=Object.freeze(Object.defineProperty({__proto__:null,get W3mWalletReceiveView(){return xd}},Symbol.toStringTag,{value:"Module"})),Cxe=de`
- :host > wui-flex:first-child {
- column-gap: var(--wui-spacing-s);
- padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
- width: 100%;
- }
- wui-flex {
- display: flex;
- flex: 1;
- }
- `;var Axe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let DP=class extends se{render(){return M`
- <wui-flex alignItems="center">
- <wui-shimmer width="40px" height="40px"></wui-shimmer>
- <wui-flex flexDirection="column" gap="2xs">
- <wui-shimmer width="72px" height="16px" borderRadius="4xs"></wui-shimmer>
- <wui-shimmer width="148px" height="14px" borderRadius="4xs"></wui-shimmer>
- </wui-flex>
- <wui-shimmer width="24px" height="12px" borderRadius="5xs"></wui-shimmer>
- </wui-flex>
- `}};DP.styles=[He,Cxe];DP=Axe([te("wui-transaction-list-item-loader")],DP);const xxe=de`
- :host {
- width: 100%;
- }
- :host > wui-flex {
- width: 100%;
- padding: var(--wui-spacing-s);
- border-radius: var(--wui-border-radius-xs);
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- gap: var(--wui-spacing-s);
- }
- :host > wui-flex:hover {
- background-color: var(--wui-color-gray-glass-002);
- }
- .purchase-image-container {
- display: flex;
- justify-content: center;
- align-items: center;
- position: relative;
- width: var(--wui-icon-box-size-lg);
- height: var(--wui-icon-box-size-lg);
- }
- .purchase-image-container wui-image {
- width: 100%;
- height: 100%;
- position: relative;
- border-radius: calc(var(--wui-icon-box-size-lg) / 2);
- }
- .purchase-image-container wui-image::after {
- content: '';
- display: block;
- width: 100%;
- height: 100%;
- position: absolute;
- inset: 0;
- border-radius: calc(var(--wui-icon-box-size-lg) / 2);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
- }
- .purchase-image-container wui-icon-box {
- position: absolute;
- right: 0;
- bottom: 0;
- transform: translate(20%, 20%);
- }
- `;var Ns=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Si=class extends se{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="Bought",this.purchaseValue="",this.purchaseCurrency="",this.date="",this.completed=!1,this.inProgress=!1,this.failed=!1,this.onClick=null,this.symbol=""}firstUpdated(){this.icon||this.fetchTokenImage()}render(){return M`
- <wui-flex>
- ${this.imageTemplate()}
- <wui-flex flexDirection="column" gap="4xs" flexGrow="1">
- <wui-flex gap="xxs" alignItems="center" justifyContent="flex-start">
- ${this.statusIconTemplate()}
- <wui-text variant="paragraph-500" color="fg-100"> ${this.label}</wui-text>
- </wui-flex>
- <wui-text variant="small-400" color="fg-200">
- + ${this.purchaseValue} ${this.purchaseCurrency}
- </wui-text>
- </wui-flex>
- ${this.inProgress?M`<wui-loading-spinner color="fg-200" size="md"></wui-loading-spinner>`:M`<wui-text variant="micro-700" color="fg-300"><span>${this.date}</span></wui-text>`}
- </wui-flex>
- `}async fetchTokenImage(){await Ne._fetchTokenImage(this.purchaseCurrency)}statusIconTemplate(){return this.inProgress?null:this.completed?this.boughtIconTemplate():this.errorIconTemplate()}errorIconTemplate(){return M`<wui-icon-box
- size="xxs"
- iconColor="error-100"
- backgroundColor="error-100"
- background="opaque"
- icon="close"
- borderColor="wui-color-bg-125"
- ></wui-icon-box>`}imageTemplate(){const e=this.icon||`https://avatar.vercel.sh/andrew.svg?size=50&text=${this.symbol}`;return M`<wui-flex class="purchase-image-container">
- <wui-image src=${e}></wui-image>
- </wui-flex>`}boughtIconTemplate(){return M`<wui-icon-box
- size="xxs"
- iconColor="success-100"
- backgroundColor="success-100"
- background="opaque"
- icon="arrowBottom"
- borderColor="wui-color-bg-125"
- ></wui-icon-box>`}};Si.styles=[xxe];Ns([q({type:Boolean})],Si.prototype,"disabled",void 0);Ns([q()],Si.prototype,"color",void 0);Ns([q()],Si.prototype,"label",void 0);Ns([q()],Si.prototype,"purchaseValue",void 0);Ns([q()],Si.prototype,"purchaseCurrency",void 0);Ns([q()],Si.prototype,"date",void 0);Ns([q({type:Boolean})],Si.prototype,"completed",void 0);Ns([q({type:Boolean})],Si.prototype,"inProgress",void 0);Ns([q({type:Boolean})],Si.prototype,"failed",void 0);Ns([q()],Si.prototype,"onClick",void 0);Ns([q()],Si.prototype,"symbol",void 0);Ns([q()],Si.prototype,"icon",void 0);Si=Ns([te("w3m-onramp-activity-item")],Si);const Sxe=de`
- :host > wui-flex {
- height: 500px;
- overflow-y: auto;
- overflow-x: hidden;
- scrollbar-width: none;
- padding: var(--wui-spacing-m);
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- }
- :host > wui-flex::-webkit-scrollbar {
- display: none;
- }
- :host > wui-flex > wui-flex {
- width: 100%;
- }
- wui-transaction-list-item-loader {
- width: 100%;
- }
- `;var c2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const Txe=7;let Sd=class extends se{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=$t.state.selectedProvider,this.loading=!1,this.coinbaseTransactions=Dr.state.coinbaseTransactions,this.tokenImages=er.state.tokenImages,this.unsubscribe.push($t.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e}),er.subscribeKey("tokenImages",e=>this.tokenImages=e),()=>{clearTimeout(this.refetchTimeout)},Dr.subscribe(e=>{this.coinbaseTransactions={...e.coinbaseTransactions}})),Dr.clearCursor(),this.fetchTransactions()}render(){return M`
- <wui-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs">
- ${this.loading?this.templateLoading():this.templateTransactionsByYear()}
- </wui-flex>
- `}templateTransactions(e){return e==null?void 0:e.map(r=>{var a,c,u;const n=bC.formatDate((a=r==null?void 0:r.metadata)==null?void 0:a.minedAt),i=r.transfers[0],s=i==null?void 0:i.fungible_info;if(!s)return null;const o=((c=s==null?void 0:s.icon)==null?void 0:c.url)||((u=this.tokenImages)==null?void 0:u[s.symbol||""]);return M`
- <w3m-onramp-activity-item
- label="Bought"
- .completed=${r.metadata.status==="ONRAMP_TRANSACTION_STATUS_SUCCESS"}
- .inProgress=${r.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS"}
- .failed=${r.metadata.status==="ONRAMP_TRANSACTION_STATUS_FAILED"}
- purchaseCurrency=${we(s.symbol)}
- purchaseValue=${i.quantity.numeric}
- date=${n}
- icon=${we(o)}
- symbol=${we(s.symbol)}
- ></w3m-onramp-activity-item>
- `})}templateTransactionsByYear(){return Object.keys(this.coinbaseTransactions).sort().reverse().map(r=>{const n=parseInt(r,10);return new Array(12).fill(null).map((s,o)=>o).reverse().map(s=>{var c;const o=Xh.getTransactionGroupTitle(n,s),a=(c=this.coinbaseTransactions[n])==null?void 0:c[s];return a?M`
- <wui-flex flexDirection="column">
- <wui-flex
- alignItems="center"
- flexDirection="row"
- .padding=${["xs","s","s","s"]}
- >
- <wui-text variant="paragraph-500" color="fg-200">${o}</wui-text>
- </wui-flex>
- <wui-flex flexDirection="column" gap="xs">
- ${this.templateTransactions(a)}
- </wui-flex>
- </wui-flex>
- `:null})})}async fetchTransactions(){await this.fetchCoinbaseTransactions()}async fetchCoinbaseTransactions(){const e=re.state.address,r=oe.state.projectId;if(!e)throw new Error("No address found");if(!r)throw new Error("No projectId found");this.loading=!0,await Dr.fetchTransactions(e,"coinbase"),this.loading=!1,this.refetchLoadingTransactions()}refetchLoadingTransactions(){var i;const e=new Date;if((((i=this.coinbaseTransactions[e.getFullYear()])==null?void 0:i[e.getMonth()])||[]).filter(s=>s.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length===0){clearTimeout(this.refetchTimeout);return}this.refetchTimeout=setTimeout(async()=>{const s=re.state.address;await Dr.fetchTransactions(s,"coinbase"),this.refetchLoadingTransactions()},3e3)}templateLoading(){return Array(Txe).fill(M` <wui-transaction-list-item-loader></wui-transaction-list-item-loader> `).map(e=>e)}};Sd.styles=Sxe;c2([G()],Sd.prototype,"selectedOnRampProvider",void 0);c2([G()],Sd.prototype,"loading",void 0);c2([G()],Sd.prototype,"coinbaseTransactions",void 0);c2([G()],Sd.prototype,"tokenImages",void 0);Sd=c2([te("w3m-onramp-activity-view")],Sd);const Ixe=de`
- button {
- column-gap: var(--wui-spacing-s);
- padding: 11px 18px 11px var(--wui-spacing-s);
- width: 100%;
- background-color: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xs);
- color: var(--wui-color-fg-250);
- transition:
- color var(--wui-ease-out-power-1) var(--wui-duration-md),
- background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: color, background-color;
- }
- button[data-iconvariant='square'],
- button[data-iconvariant='square-blue'] {
- padding: 6px 18px 6px 9px;
- }
- button > wui-flex {
- flex: 1;
- }
- button > wui-image {
- width: 32px;
- height: 32px;
- box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
- border-radius: var(--wui-border-radius-3xl);
- }
- button > wui-icon {
- width: 36px;
- height: 36px;
- transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: opacity;
- }
- button > wui-icon-box[data-variant='blue'] {
- box-shadow: 0 0 0 2px var(--wui-color-accent-glass-005);
- }
- button > wui-icon-box[data-variant='overlay'] {
- box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
- }
- button > wui-icon-box[data-variant='square-blue'] {
- border-radius: var(--wui-border-radius-3xs);
- position: relative;
- border: none;
- width: 36px;
- height: 36px;
- }
- button > wui-icon-box[data-variant='square-blue']::after {
- content: '';
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- border-radius: inherit;
- border: 1px solid var(--wui-color-accent-glass-010);
- pointer-events: none;
- }
- button > wui-icon:last-child {
- width: 14px;
- height: 14px;
- }
- button:disabled {
- color: var(--wui-color-gray-glass-020);
- }
- button[data-loading='true'] > wui-icon {
- opacity: 0;
- }
- wui-loading-spinner {
- position: absolute;
- right: 18px;
- top: 50%;
- transform: translateY(-50%);
- }
- `;var ia=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Ts=class extends se{constructor(){super(...arguments),this.tabIdx=void 0,this.variant="icon",this.disabled=!1,this.imageSrc=void 0,this.alt=void 0,this.chevron=!1,this.loading=!1}render(){return M`
- <button
- ?disabled=${this.loading?!0:!!this.disabled}
- data-loading=${this.loading}
- data-iconvariant=${we(this.iconVariant)}
- tabindex=${we(this.tabIdx)}
- >
- ${this.loadingTemplate()} ${this.visualTemplate()}
- <wui-flex gap="3xs">
- <slot></slot>
- </wui-flex>
- ${this.chevronTemplate()}
- </button>
- `}visualTemplate(){if(this.variant==="image"&&this.imageSrc)return M`<wui-image src=${this.imageSrc} alt=${this.alt??"list item"}></wui-image>`;if(this.iconVariant==="square"&&this.icon&&this.variant==="icon")return M`<wui-icon name=${this.icon}></wui-icon>`;if(this.variant==="icon"&&this.icon&&this.iconVariant){const e=["blue","square-blue"].includes(this.iconVariant)?"accent-100":"fg-200",r=this.iconVariant==="square-blue"?"mdl":"md",n=this.iconSize?this.iconSize:r;return M`
- <wui-icon-box
- data-variant=${this.iconVariant}
- icon=${this.icon}
- iconSize=${n}
- background="transparent"
- iconColor=${e}
- backgroundColor=${e}
- size=${r}
- ></wui-icon-box>
- `}return null}loadingTemplate(){return this.loading?M`<wui-loading-spinner
- data-testid="wui-list-item-loading-spinner"
- color="fg-300"
- ></wui-loading-spinner>`:M``}chevronTemplate(){return this.chevron?M`<wui-icon size="inherit" color="fg-200" name="chevronRight"></wui-icon>`:null}};Ts.styles=[He,vt,Ixe];ia([q()],Ts.prototype,"icon",void 0);ia([q()],Ts.prototype,"iconSize",void 0);ia([q()],Ts.prototype,"tabIdx",void 0);ia([q()],Ts.prototype,"variant",void 0);ia([q()],Ts.prototype,"iconVariant",void 0);ia([q({type:Boolean})],Ts.prototype,"disabled",void 0);ia([q()],Ts.prototype,"imageSrc",void 0);ia([q()],Ts.prototype,"alt",void 0);ia([q({type:Boolean})],Ts.prototype,"chevron",void 0);ia([q({type:Boolean})],Ts.prototype,"loading",void 0);Ts=ia([te("wui-list-item")],Ts);const Pxe=de`
- :host > wui-grid {
- max-height: 360px;
- overflow: auto;
- }
- wui-flex {
- transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: opacity;
- }
- wui-grid::-webkit-scrollbar {
- display: none;
- }
- wui-flex.disabled {
- opacity: 0.3;
- pointer-events: none;
- user-select: none;
- }
- `;var u2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Td=class extends se{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=$t.state.paymentCurrency,this.currencies=$t.state.paymentCurrencies,this.currencyImages=er.state.currencyImages,this.checked=As.state.isLegalCheckboxChecked,this.unsubscribe.push($t.subscribe(e=>{this.selectedCurrency=e.paymentCurrency,this.currencies=e.paymentCurrencies}),er.subscribeKey("currencyImages",e=>this.currencyImages=e),As.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var a;const{termsConditionsUrl:e,privacyPolicyUrl:r}=oe.state,n=(a=oe.state.features)==null?void 0:a.legalCheckbox,o=!!(e||r)&&!!n&&!this.checked;return M`
- <w3m-legal-checkbox></w3m-legal-checkbox>
- <wui-flex
- flexDirection="column"
- .padding=${["0","s","s","s"]}
- gap="xs"
- class=${we(o?"disabled":void 0)}
- >
- ${this.currenciesTemplate(o)}
- </wui-flex>
- <w3m-legal-footer></w3m-legal-footer>
- `}currenciesTemplate(e=!1){return this.currencies.map(r=>{var n;return M`
- <wui-list-item
- imageSrc=${we((n=this.currencyImages)==null?void 0:n[r.id])}
- @click=${()=>this.selectCurrency(r)}
- variant="image"
- tabIdx=${we(e?-1:void 0)}
- >
- <wui-text variant="paragraph-500" color="fg-100">${r.id}</wui-text>
- </wui-list-item>
- `})}selectCurrency(e){e&&($t.setPaymentCurrency(e),We.close())}};Td.styles=Pxe;u2([G()],Td.prototype,"selectedCurrency",void 0);u2([G()],Td.prototype,"currencies",void 0);u2([G()],Td.prototype,"currencyImages",void 0);u2([G()],Td.prototype,"checked",void 0);Td=u2([te("w3m-onramp-fiat-select-view")],Td);const Oxe=Se`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
- <rect width="64" height="64" fill="#F7931A"/>
- <g clip-path="url(#clip0_1045_17)">
- <path d="M63.0394 39.7409C58.7654 56.8839 41.4024 67.3169 24.2574 63.0419C7.11937 58.7679 -3.31363 41.4039 0.962367 24.2619C5.23437 7.11686 22.5974 -3.31714 39.7374 0.956863C56.8814 5.23086 67.3134 22.5969 63.0394 39.7409Z" fill="#F7931A"/>
- <path d="M46.1092 27.4409C46.7462 23.1829 43.5042 20.8939 39.0712 19.3669L40.5092 13.5989L36.9982 12.7239L35.5982 18.3399C34.6752 18.1099 33.7272 17.8929 32.7852 17.6779L34.1952 12.0249L30.6862 11.1499L29.2472 16.9159C28.4832 16.7419 27.7332 16.5699 27.0052 16.3889L27.0092 16.3709L22.1672 15.1619L21.2332 18.9119C21.2332 18.9119 23.8382 19.5089 23.7832 19.5459C25.2052 19.9009 25.4622 20.8419 25.4192 21.5879L23.7812 28.1589C23.8792 28.1839 24.0062 28.2199 24.1462 28.2759C24.0292 28.2469 23.9042 28.2149 23.7752 28.1839L21.4792 37.3889C21.3052 37.8209 20.8642 38.4689 19.8702 38.2229C19.9052 38.2739 17.3182 37.5859 17.3182 37.5859L15.5752 41.6049L20.1442 42.7439C20.9942 42.9569 21.8272 43.1799 22.6472 43.3899L21.1942 49.2239L24.7012 50.0989L26.1402 44.3269C27.0982 44.5869 28.0282 44.8269 28.9382 45.0529L27.5042 50.7979L31.0152 51.6729L32.4682 45.8499C38.4552 46.9829 42.9572 46.5259 44.8522 41.1109C46.3792 36.7509 44.7762 34.2359 41.6262 32.5959C43.9202 32.0669 45.6482 30.5579 46.1092 27.4409ZM38.0872 38.6899C37.0022 43.0499 29.6612 40.6929 27.2812 40.1019L29.2092 32.3729C31.5892 32.9669 39.2212 34.1429 38.0872 38.6899ZM39.1732 27.3779C38.1832 31.3439 32.0732 29.3289 30.0912 28.8349L31.8392 21.8249C33.8212 22.3189 40.2042 23.2409 39.1732 27.3779Z" fill="white"/>
- </g>
- <defs>
- <clipPath id="clip0_1045_17">
- <rect width="64" height="64" fill="white"/>
- </clipPath>
- </defs>
- </svg>
- `,Rxe=Se`<svg fill="none" viewBox="0 0 60 60">
- <rect width="60" height="60" fill="#1DC956" rx="30" />
- <circle cx="30" cy="30" r="3" fill="#fff" />
- <path
- fill="#2BEE6C"
- stroke="#fff"
- stroke-width="2"
- d="m45.32 17.9-.88-.42.88.42.02-.05c.1-.2.21-.44.26-.7l-.82-.15.82.16a2 2 0 0 0-.24-1.4c-.13-.23-.32-.42-.47-.57a8.42 8.42 0 0 1-.04-.04l-.04-.04a2.9 2.9 0 0 0-.56-.47l-.51.86.5-.86a2 2 0 0 0-1.4-.24c-.26.05-.5.16-.69.26l-.05.02-15.05 7.25-.1.05c-1.14.55-1.85.89-2.46 1.37a7 7 0 0 0-1.13 1.14c-.5.6-.83 1.32-1.38 2.45l-.05.11-7.25 15.05-.02.05c-.1.2-.21.43-.26.69a2 2 0 0 0 .24 1.4l.85-.5-.85.5c.13.23.32.42.47.57l.04.04.04.04c.15.15.34.34.56.47a2 2 0 0 0 1.41.24l-.2-.98.2.98c.25-.05.5-.17.69-.26l.05-.02-.42-.87.42.87 15.05-7.25.1-.05c1.14-.55 1.85-.89 2.46-1.38a7 7 0 0 0 1.13-1.13 12.87 12.87 0 0 0 1.43-2.56l7.25-15.05Z"
- />
- <path
- fill="#1DC956"
- d="M33.38 32.72 30.7 29.3 15.86 44.14l.2.2a1 1 0 0 0 1.14.2l15.1-7.27a3 3 0 0 0 1.08-4.55Z"
- />
- <path
- fill="#86F999"
- d="m26.62 27.28 2.67 3.43 14.85-14.85-.2-.2a1 1 0 0 0-1.14-.2l-15.1 7.27a3 3 0 0 0-1.08 4.55Z"
- />
- <circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)" />
- <rect width="59" height="59" x=".5" y=".5" stroke="#062B2B" stroke-opacity=".1" rx="29.5" />
- </svg> `,kxe=Se`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
- <g clip-path="url(#clip0_187_29)">
- <path d="M1.18187e-05 15.8055C1.18187e-05 9.8015 -5.19442e-07 6.91338 1.69991e-08 0C4.5 3.72236e-05 9.62249 0 16.5 0L23.5 4.31399e-05C29.9349 4.31399e-05 35.5 0.000206332 40 3.73468e-05C40 2.77754 40 9.36708 40 15.8055V22.8364C40 29.2647 40 33.7962 40 40C31.5 40 29.8337 40 23.4 40H16.6C10.5092 40 6.50004 40 4.04289e-05 40C3.05176e-05 32.2453 1.18187e-05 29.6382 1.18187e-05 22.8364V15.8055Z" fill="#0052FF"/>
- <path d="M20.0236 26.5C16.4342 26.5 13.5236 23.5931 13.5236 20C13.5236 16.4069 16.4342 13.5 20.0236 13.5C23.2411 13.5 25.9134 15.8472 26.4261 18.9167H32.9731C32.4206 12.2433 26.8342 7 20.02 7C12.8411 7 7.02002 12.8211 7.02002 20C7.02002 27.1789 12.8411 33 20.02 33C26.8342 33 32.4206 27.7567 32.9731 21.0833H26.4225C25.9061 24.1528 23.2411 26.5 20.0236 26.5Z" fill="white"/>
- </g>
- <defs>
- <clipPath id="clip0_187_29">
- <rect width="40" height="40" fill="white"/>
- </clipPath>
- </defs>
- </svg>`,Nxe=Se`<svg viewBox="0 0 60 60" fill="none">
- <g clip-path="url(#clip0_7734_50402)">
- <path
- d="M0 24.9C0 15.6485 0 11.0228 1.97053 7.56812C3.3015 5.23468 5.23468 3.3015 7.56812 1.97053C11.0228 0 15.6485 0 24.9 0H35.1C44.3514 0 48.9772 0 52.4319 1.97053C54.7653 3.3015 56.6985 5.23468 58.0295 7.56812C60 11.0228 60 15.6485 60 24.9V35.1C60 44.3514 60 48.9772 58.0295 52.4319C56.6985 54.7653 54.7653 56.6985 52.4319 58.0295C48.9772 60 44.3514 60 35.1 60H24.9C15.6485 60 11.0228 60 7.56812 58.0295C5.23468 56.6985 3.3015 54.7653 1.97053 52.4319C0 48.9772 0 44.3514 0 35.1V24.9Z"
- fill="#EB8B47"
- />
- <path
- d="M0.5 24.9C0.5 20.2652 0.50047 16.8221 0.744315 14.105C0.987552 11.3946 1.46987 9.45504 2.40484 7.81585C3.69145 5.56019 5.56019 3.69145 7.81585 2.40484C9.45504 1.46987 11.3946 0.987552 14.105 0.744315C16.8221 0.50047 20.2652 0.5 24.9 0.5H35.1C39.7348 0.5 43.1779 0.50047 45.895 0.744315C48.6054 0.987552 50.545 1.46987 52.1841 2.40484C54.4398 3.69145 56.3086 5.56019 57.5952 7.81585C58.5301 9.45504 59.0124 11.3946 59.2557 14.105C59.4995 16.8221 59.5 20.2652 59.5 24.9V35.1C59.5 39.7348 59.4995 43.1779 59.2557 45.895C59.0124 48.6054 58.5301 50.545 57.5952 52.1841C56.3086 54.4398 54.4398 56.3086 52.1841 57.5952C50.545 58.5301 48.6054 59.0124 45.895 59.2557C43.1779 59.4995 39.7348 59.5 35.1 59.5H24.9C20.2652 59.5 16.8221 59.4995 14.105 59.2557C11.3946 59.0124 9.45504 58.5301 7.81585 57.5952C5.56019 56.3086 3.69145 54.4398 2.40484 52.1841C1.46987 50.545 0.987552 48.6054 0.744315 45.895C0.50047 43.1779 0.5 39.7348 0.5 35.1V24.9Z"
- stroke="#062B2B"
- stroke-opacity="0.1"
- />
- <path
- d="M19 52C24.5228 52 29 47.5228 29 42C29 36.4772 24.5228 32 19 32C13.4772 32 9 36.4772 9 42C9 47.5228 13.4772 52 19 52Z"
- fill="#FF974C"
- stroke="white"
- stroke-width="2"
- />
- <path
- fill-rule="evenodd"
- clip-rule="evenodd"
- d="M42.8437 8.3264C42.4507 7.70891 41.5493 7.70891 41.1564 8.32641L28.978 27.4638C28.5544 28.1295 29.0326 29.0007 29.8217 29.0007H54.1783C54.9674 29.0007 55.4456 28.1295 55.022 27.4638L42.8437 8.3264Z"
- fill="white"
- />
- <path
- fill-rule="evenodd"
- clip-rule="evenodd"
- d="M42.3348 11.6456C42.659 11.7608 42.9061 12.1492 43.4005 12.926L50.7332 24.4488C51.2952 25.332 51.5763 25.7737 51.5254 26.1382C51.4915 26.3808 51.3698 26.6026 51.1833 26.7614C50.9031 27 50.3796 27 49.3327 27H34.6673C33.6204 27 33.0969 27 32.8167 26.7614C32.6302 26.6026 32.5085 26.3808 32.4746 26.1382C32.4237 25.7737 32.7048 25.332 33.2669 24.4488L40.5995 12.926C41.0939 12.1492 41.341 11.7608 41.6652 11.6456C41.8818 11.5687 42.1182 11.5687 42.3348 11.6456ZM35.0001 26.999C38.8661 26.999 42.0001 23.865 42.0001 19.999C42.0001 23.865 45.1341 26.999 49.0001 26.999H35.0001Z"
- fill="#FF974C"
- />
- <path
- d="M10.1061 9.35712C9.9973 9.67775 9.99867 10.0388 9.99978 10.3323C9.99989 10.3611 10 10.3893 10 10.4167V25.5833C10 25.6107 9.99989 25.6389 9.99978 25.6677C9.99867 25.9612 9.9973 26.3222 10.1061 26.6429C10.306 27.2317 10.7683 27.694 11.3571 27.8939C11.6777 28.0027 12.0388 28.0013 12.3323 28.0002C12.3611 28.0001 12.3893 28 12.4167 28H19C24.5228 28 29 23.5228 29 18C29 12.4772 24.5228 8 19 8H12.4167C12.3893 8 12.3611 7.99989 12.3323 7.99978C12.0388 7.99867 11.6778 7.9973 11.3571 8.10614C10.7683 8.306 10.306 8.76834 10.1061 9.35712Z"
- fill="#FF974C"
- stroke="white"
- stroke-width="2"
- />
- <circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="white" stroke-width="2" />
- <circle cx="19" cy="42" r="4" fill="#EB8B47" stroke="white" stroke-width="2" />
- </g>
- <defs>
- <clipPath id="clip0_7734_50402">
- <rect width="60" height="60" fill="white" />
- </clipPath>
- </defs>
- </svg> `,$xe=Se`<svg fill="none" viewBox="0 0 60 60">
- <g clip-path="url(#a)">
- <path
- fill="#1DC956"
- d="M0 25.01c0-9.25 0-13.88 1.97-17.33a15 15 0 0 1 5.6-5.6C11.02.11 15.65.11 24.9.11h10.2c9.25 0 13.88 0 17.33 1.97a15 15 0 0 1 5.6 5.6C60 11.13 60 15.76 60 25v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6c-3.45 1.97-8.08 1.97-17.33 1.97H24.9c-9.25 0-13.88 0-17.33-1.97a15 15 0 0 1-5.6-5.6C0 49.1 0 44.46 0 35.21v-10.2Z"
- />
- <path
- fill="#2BEE6C"
- d="M16.1 60c-3.82-.18-6.4-.64-8.53-1.86a15 15 0 0 1-5.6-5.6C.55 50.06.16 46.97.04 41.98L4.2 40.6a4 4 0 0 0 2.48-2.39l4.65-12.4a2 2 0 0 1 2.5-1.2l2.53.84a2 2 0 0 0 2.43-1l2.96-5.94a2 2 0 0 1 3.7.32l3.78 12.58a2 2 0 0 0 3.03 1.09l3.34-2.23a2 2 0 0 0 .65-.7l5.3-9.72a2 2 0 0 1 1.42-1.01l4.14-.69a2 2 0 0 1 1.6.44l3.9 3.24a2 2 0 0 0 2.7-.12l4.62-4.63c.08 2.2.08 4.8.08 7.93v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6c-2.13 1.22-4.7 1.68-8.54 1.86H16.11Z"
- />
- <path
- fill="#fff"
- d="m.07 43.03-.05-2.1 3.85-1.28a3 3 0 0 0 1.86-1.79l4.66-12.4a3 3 0 0 1 3.75-1.8l2.53.84a1 1 0 0 0 1.21-.5l2.97-5.94a3 3 0 0 1 5.56.48l3.77 12.58a1 1 0 0 0 1.51.55l3.34-2.23a1 1 0 0 0 .33-.35l5.3-9.71a3 3 0 0 1 2.14-1.53l4.13-.69a3 3 0 0 1 2.41.66l3.9 3.24a1 1 0 0 0 1.34-.06l5.28-5.28c.05.85.08 1.75.1 2.73L56 22.41a3 3 0 0 1-4.04.19l-3.9-3.25a1 1 0 0 0-.8-.21l-4.13.69a1 1 0 0 0-.72.5l-5.3 9.72a3 3 0 0 1-.97 1.05l-3.34 2.23a3 3 0 0 1-4.53-1.63l-3.78-12.58a1 1 0 0 0-1.85-.16l-2.97 5.94a3 3 0 0 1-3.63 1.5l-2.53-.84a1 1 0 0 0-1.25.6l-4.65 12.4a5 5 0 0 1-3.1 3L.07 43.02Z"
- />
- <path
- fill="#fff"
- fill-rule="evenodd"
- d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"
- clip-rule="evenodd"
- />
- <path fill="#fff" d="M45 .28v59.66l-2 .1V.19c.7.02 1.37.05 2 .1Z" />
- <path fill="#2BEE6C" d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" />
- <path
- stroke="#fff"
- stroke-opacity=".1"
- d="M.5 25.01c0-4.63 0-8.08.24-10.8.25-2.7.73-4.64 1.66-6.28a14.5 14.5 0 0 1 5.42-5.41C9.46 1.58 11.39 1.1 14.1.85A133 133 0 0 1 24.9.61h10.2c4.63 0 8.08 0 10.8.24 2.7.25 4.65.73 6.28 1.67a14.5 14.5 0 0 1 5.42 5.4c.93 1.65 1.41 3.58 1.66 6.3.24 2.71.24 6.16.24 10.79v10.2c0 4.64 0 8.08-.24 10.8-.25 2.7-.73 4.65-1.66 6.28a14.5 14.5 0 0 1-5.42 5.42c-1.63.93-3.57 1.41-6.28 1.66-2.72.24-6.17.24-10.8.24H24.9c-4.63 0-8.08 0-10.8-.24-2.7-.25-4.64-.73-6.28-1.66a14.5 14.5 0 0 1-5.42-5.42C1.47 50.66 1 48.72.74 46.01A133 133 0 0 1 .5 35.2v-10.2Z"
- />
- </g>
- <defs>
- <clipPath id="a"><path fill="#fff" d="M0 0h60v60H0z" /></clipPath>
- </defs>
- </svg>`,jxe=Se`<svg fill="none" viewBox="0 0 60 60">
- <g clip-path="url(#a)">
- <rect width="60" height="60" fill="#C653C6" rx="30" />
- <path
- fill="#E87DE8"
- d="M57.98.01v19.5a4.09 4.09 0 0 0-2.63 2.29L50.7 34.2a2 2 0 0 1-2.5 1.2l-2.53-.84a2 2 0 0 0-2.42 1l-2.97 5.94a2 2 0 0 1-3.7-.32L32.8 28.6a2 2 0 0 0-3.02-1.09l-3.35 2.23a2 2 0 0 0-.64.7l-5.3 9.72a2 2 0 0 1-1.43 1.01l-4.13.69a2 2 0 0 1-1.61-.44l-3.9-3.24a2 2 0 0 0-2.69.12L2.1 42.93.02 43V.01h57.96Z"
- />
- <path
- fill="#fff"
- d="m61.95 16.94.05 2.1-3.85 1.28a3 3 0 0 0-1.86 1.79l-4.65 12.4a3 3 0 0 1-3.76 1.8l-2.53-.84a1 1 0 0 0-1.2.5l-2.98 5.94a3 3 0 0 1-5.55-.48l-3.78-12.58a1 1 0 0 0-1.5-.55l-3.35 2.23a1 1 0 0 0-.32.35l-5.3 9.72a3 3 0 0 1-2.14 1.52l-4.14.69a3 3 0 0 1-2.41-.66l-3.9-3.24a1 1 0 0 0-1.34.06l-5.28 5.28c-.05-.84-.08-1.75-.1-2.73l3.97-3.96a3 3 0 0 1 4.04-.19l3.89 3.25a1 1 0 0 0 .8.21l4.14-.68a1 1 0 0 0 .71-.51l5.3-9.71a3 3 0 0 1 .97-1.06l3.34-2.23a3 3 0 0 1 4.54 1.63l3.77 12.58a1 1 0 0 0 1.86.16l2.96-5.93a3 3 0 0 1 3.64-1.5l2.52.83a1 1 0 0 0 1.25-.6l4.66-12.4a5 5 0 0 1 3.1-2.99l4.43-1.48Z"
- />
- <path
- fill="#fff"
- fill-rule="evenodd"
- d="M35.5 27a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"
- clip-rule="evenodd"
- />
- <path fill="#fff" d="M31 0v60h-2V0h2Z" />
- <path fill="#E87DE8" d="M33.5 27a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" />
- </g>
- <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="29.5" />
- <defs>
- <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
- </defs>
- </svg> `,Bxe=Se`<svg fill="none" viewBox="0 0 60 60">
- <g clip-path="url(#a)">
- <rect width="60" height="60" fill="#987DE8" rx="30" />
- <path
- fill="#fff"
- fill-rule="evenodd"
- d="m15.48 28.37 11.97-19.3a3 3 0 0 1 5.1 0l11.97 19.3a6 6 0 0 1 .9 3.14v.03a6 6 0 0 1-1.16 3.56L33.23 50.2a4 4 0 0 1-6.46 0L15.73 35.1a6 6 0 0 1-1.15-3.54v-.03a6 6 0 0 1 .9-3.16Z"
- clip-rule="evenodd"
- />
- <path
- fill="#643CDD"
- d="M30.84 10.11a1 1 0 0 0-.84-.46V24.5l12.6 5.53a2 2 0 0 0-.28-1.4L30.84 10.11Z"
- />
- <path
- fill="#BDADEB"
- d="M30 9.65a1 1 0 0 0-.85.46L17.66 28.64a2 2 0 0 0-.26 1.39L30 24.5V9.65Z"
- />
- <path
- fill="#643CDD"
- d="M30 50.54a1 1 0 0 0 .8-.4l11.24-15.38c.3-.44-.2-1-.66-.73l-9.89 5.68a3 3 0 0 1-1.5.4v10.43Z"
- />
- <path
- fill="#BDADEB"
- d="m17.97 34.76 11.22 15.37c.2.28.5.41.8.41V40.11a3 3 0 0 1-1.49-.4l-9.88-5.68c-.47-.27-.97.3-.65.73Z"
- />
- <path
- fill="#401AB3"
- d="M42.6 30.03 30 24.5v13.14a3 3 0 0 0 1.5-.4l10.14-5.83a2 2 0 0 0 .95-1.38Z"
- />
- <path
- fill="#7C5AE2"
- d="M30 37.64V24.46l-12.6 5.57a2 2 0 0 0 .97 1.39l10.13 5.82a3 3 0 0 0 1.5.4Z"
- />
- </g>
- <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="29.5" />
- <defs>
- <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
- </defs>
- </svg> `,Dxe=Se`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
- <rect width="64" height="64" rx="30" fill="#1DC956"/>
- <rect x="0.5" y="0.5" width="63" height="63" rx="29.5" stroke="#141414" stroke-opacity="0.1"/>
- <path d="M32.4053 19.8031C35.3901 19.8031 38.0431 20.8349 40.1619 22.8247L45.9656 17.0211C42.4465 13.7416 37.8773 11.7333 32.4053 11.7333C24.4829 11.7333 17.6475 16.2841 14.3127 22.9168L21.056 28.1493C22.6589 23.359 27.136 19.8031 32.4053 19.8031Z" fill="#1DC956" stroke="white" stroke-width="2" stroke-linejoin="round"/>
- <path d="M32.4053 52.2667C37.8773 52.2667 42.465 50.4611 45.8182 47.3658L39.2407 42.2623C37.4351 43.4783 35.1321 44.2153 32.4053 44.2153C27.136 44.2153 22.6589 40.6594 21.056 35.8691L14.3127 41.1016C17.6475 47.7159 24.4829 52.2667 32.4053 52.2667Z" fill="#2BEE6C"/>
- <path d="M21.056 35.8507L19.5636 36.993L14.3127 41.0832M39.2407 42.2623L45.8182 47.3658C42.465 50.4611 37.8773 52.2667 32.4053 52.2667C24.4829 52.2667 17.6475 47.7159 14.3127 41.1016L21.056 35.8691C22.6589 40.6594 27.136 44.2153 32.4053 44.2153C35.1321 44.2153 37.4351 43.4783 39.2407 42.2623Z" stroke="white" stroke-width="2" stroke-linejoin="round"/>
- <path d="M51.8613 32.4606C51.8613 31.0235 51.7323 29.6417 51.4928 28.3151H32.4053V36.1638H43.3124C42.8334 38.688 41.3963 40.8252 39.2407 42.2623L45.8181 47.3658C49.6503 43.8283 51.8613 38.6327 51.8613 32.4606Z" fill="#1FAD7E" stroke="white" stroke-width="2" stroke-linejoin="round"/>
- <path d="M21.056 35.8507C20.6507 34.6347 20.4111 33.345 20.4111 32C20.4111 30.655 20.6507 29.3653 21.056 28.1493L14.3127 22.9169C12.9309 25.6437 12.1387 28.7205 12.1387 32C12.1387 35.2795 12.9309 38.3564 14.3127 41.0831L19.5636 36.993L21.056 35.8507Z" fill="#86F999"/>
- <path d="M21.056 35.8691L14.3127 41.1016M21.056 35.8507C20.6507 34.6347 20.4111 33.345 20.4111 32C20.4111 30.655 20.6507 29.3653 21.056 28.1493L14.3127 22.9169C12.9309 25.6437 12.1387 28.7205 12.1387 32C12.1387 35.2795 12.9309 38.3564 14.3127 41.0831L19.5636 36.993L21.056 35.8507Z" stroke="white" stroke-width="2" stroke-linejoin="round"/>
- </svg>
- `,Mxe=Se`<svg fill="none" viewBox="0 0 60 60">
- <rect width="60" height="60" fill="#1DC956" rx="3" />
- <path
- fill="#1FAD7E"
- stroke="#fff"
- stroke-width="2"
- d="m30.49 29.13-.49-.27-.49.27-12.77 7.1-.05.02c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45l-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-12.77-7.1Z"
- />
- <path
- fill="#2BEE6C"
- stroke="#fff"
- stroke-width="2"
- d="m30.49 19.13-.49-.27-.49.27-12.77 7.1-.05.02c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45l-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-12.77-7.1Z"
- />
- <path
- fill="#86F999"
- stroke="#fff"
- stroke-width="2"
- d="m46.69 21.06-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-6.32-3.51-.18-.1c-2.33-1.3-3.72-2.06-5.22-2.33a9 9 0 0 0-3.08 0c-1.5.27-2.9 1.04-5.22 2.33l-.17.1-6.33 3.51-.05.03c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45Z"
- />
- <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
- </svg>`,Lxe=Se`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
- <g clip-path="url(#clip0_241_31636)">
- <path d="M0 26.5595C0 16.6913 0 11.7572 2.1019 8.07217C3.5216 5.58318 5.58366 3.52111 8.07266 2.10141C11.7577 -0.000488281 16.6918 -0.000488281 26.56 -0.000488281H37.44C47.3082 -0.000488281 52.2423 -0.000488281 55.9273 2.10141C58.4163 3.52111 60.4784 5.58318 61.8981 8.07217C64 11.7572 64 16.6913 64 26.5595V37.4395C64 47.3077 64 52.2418 61.8981 55.9269C60.4784 58.4159 58.4163 60.4779 55.9273 61.8976C52.2423 63.9995 47.3082 63.9995 37.44 63.9995H26.56C16.6918 63.9995 11.7577 63.9995 8.07266 61.8976C5.58366 60.4779 3.5216 58.4159 2.1019 55.9269C0 52.2418 0 47.3077 0 37.4395V26.5595Z" fill="#794CFF"/>
- <path d="M0.5 26.5595C0.5 21.6163 0.50047 17.942 0.760736 15.0418C1.02039 12.1485 1.53555 10.0742 2.53621 8.3199C3.91155 5.90869 5.90917 3.91106 8.32039 2.53572C10.0747 1.53506 12.1489 1.01991 15.0423 0.760247C17.9425 0.499981 21.6168 0.499512 26.56 0.499512H37.44C42.3832 0.499512 46.0575 0.499981 48.9577 0.760247C51.8511 1.01991 53.9253 1.53506 55.6796 2.53572C58.0908 3.91106 60.0885 5.90869 61.4638 8.3199C62.4645 10.0742 62.9796 12.1485 63.2393 15.0418C63.4995 17.942 63.5 21.6163 63.5 26.5595V37.4395C63.5 42.3827 63.4995 46.057 63.2393 48.9572C62.9796 51.8506 62.4645 53.9248 61.4638 55.6791C60.0885 58.0903 58.0908 60.088 55.6796 61.4633C53.9253 62.464 51.8511 62.9791 48.9577 63.2388C46.0575 63.499 42.3832 63.4995 37.44 63.4995H26.56C21.6168 63.4995 17.9425 63.499 15.0423 63.2388C12.1489 62.9791 10.0747 62.464 8.32039 61.4633C5.90917 60.088 3.91155 58.0903 2.53621 55.6791C1.53555 53.9248 1.02039 51.8506 0.760736 48.9572C0.50047 46.057 0.5 42.3827 0.5 37.4395V26.5595Z" stroke="#141414" stroke-opacity="0.1"/>
- <path d="M40 39.4595C44.7824 36.693 48 31.5222 48 25.6C48 16.7634 40.8366 9.59998 32 9.59998C23.1634 9.59998 16 16.7634 16 25.6C16 31.5222 19.2176 36.693 24 39.4595V45.8144H40V39.4595Z" fill="#906EF7"/>
- <path d="M24 49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144H24V49.9689Z" fill="#906EF7"/>
- <path d="M24 45.8144V39.4595C19.2176 36.693 16 31.5222 16 25.6C16 16.7634 23.1634 9.59998 32 9.59998C40.8366 9.59998 48 16.7634 48 25.6C48 31.5222 44.7824 36.693 40 39.4595V45.8144M24 45.8144H40M24 45.8144V49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144" stroke="white" stroke-width="2" stroke-linejoin="round"/>
- <path d="M24 49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144H24V49.9689Z" fill="#643CDD" stroke="white" stroke-width="2" stroke-linejoin="round"/>
- <path d="M29.6735 26.9101V29.1109H34.0753V26.9101C34.0753 25.6945 35.0607 24.7092 36.2762 24.7092C37.4917 24.7092 38.4771 25.6945 38.4771 26.9101C38.4771 28.1256 37.4917 29.1109 36.2762 29.1109H34.0753H29.6735H27.4726C26.2571 29.1109 25.2717 28.1256 25.2717 26.9101C25.2717 25.6945 26.2571 24.7092 27.4726 24.7092C28.6881 24.7092 29.6735 25.6945 29.6735 26.9101Z" fill="#906EF7"/>
- <path d="M29.6735 45.3183V26.9101C29.6735 25.6945 28.6881 24.7092 27.4726 24.7092V24.7092C26.2571 24.7092 25.2717 25.6945 25.2717 26.9101V26.9101C25.2717 28.1256 26.2571 29.1109 27.4726 29.1109H36.2762C37.4917 29.1109 38.4771 28.1256 38.4771 26.9101V26.9101C38.4771 25.6945 37.4917 24.7092 36.2762 24.7092V24.7092C35.0607 24.7092 34.0753 25.6945 34.0753 26.9101V45.3183" stroke="white" stroke-width="2" stroke-linejoin="round"/>
- </g>
- <defs>
- <clipPath id="clip0_241_31636">
- <rect width="64" height="64" fill="white"/>
- </clipPath>
- </defs>
- </svg>
- `,Uxe=Se`<svg fill="none" viewBox="0 0 60 60">
- <rect width="60" height="60" fill="#C653C6" rx="3" />
- <path
- fill="#fff"
- d="M20.03 15.22C20 15.6 20 16.07 20 17v2.8c0 1.14 0 1.7-.2 2.12-.15.31-.3.5-.58.71-.37.28-1.06.42-2.43.7-.59.12-1.11.29-1.6.51a9 9 0 0 0-4.35 4.36C10 30 10 32.34 10 37c0 4.66 0 7 .84 8.8a9 9 0 0 0 4.36 4.36C17 51 19.34 51 24 51h12c4.66 0 7 0 8.8-.84a9 9 0 0 0 4.36-4.36C50 44 50 41.66 50 37c0-4.66 0-7-.84-8.8a9 9 0 0 0-4.36-4.36c-.48-.22-1-.39-1.6-.5-1.36-.29-2.05-.43-2.42-.7-.27-.22-.43-.4-.58-.72-.2-.42-.2-.98-.2-2.11V17c0-.93 0-1.4-.03-1.78a9 9 0 0 0-8.19-8.19C31.4 7 30.93 7 30 7s-1.4 0-1.78.03a9 9 0 0 0-8.19 8.19Z"
- />
- <path
- fill="#E87DE8"
- d="M22 17c0-.93 0-1.4.04-1.78a7 7 0 0 1 6.18-6.18C28.6 9 29.07 9 30 9s1.4 0 1.78.04a7 7 0 0 1 6.18 6.18c.04.39.04.85.04 1.78v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.4-.08-1.78a4 4 0 0 0-3.14-3.14C31.39 12 30.93 12 30 12s-1.4 0-1.78.08a4 4 0 0 0-3.14 3.14c-.08.39-.08.85-.08 1.78v4.5a1.5 1.5 0 0 1-3 0V17Z"
- />
- <path
- fill="#E87DE8"
- fill-rule="evenodd"
- d="M12 36.62c0-4.32 0-6.48.92-8.09a7 7 0 0 1 2.61-2.61C17.14 25 19.3 25 23.62 25h6.86c.46 0 .7 0 .9.02 2.73.22 4.37 2.43 4.62 4.98.27-2.7 2.11-5 5.02-5A6.98 6.98 0 0 1 48 31.98v5.4c0 4.32 0 6.48-.92 8.09a7 7 0 0 1-2.61 2.61c-1.61.92-3.77.92-8.09.92h-5.86c-.46 0-.7 0-.9-.02-2.73-.22-4.37-2.43-4.62-4.98-.26 2.58-1.94 4.82-4.71 4.99l-.7.01c-.55 0-.82 0-1.05-.02a7 7 0 0 1-6.52-6.52c-.02-.23-.02-.5-.02-1.05v-4.79Zm21.24-.27a4 4 0 1 0-6.48 0 31.28 31.28 0 0 1 1.57 2.23c.17.4.17.81.17 1.24V42.5a1.5 1.5 0 0 0 3 0V39.82c0-.43 0-.85.17-1.24.09-.2.58-.87 1.57-2.23Z"
- clip-rule="evenodd"
- />
- <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
- </svg>`,Fxe=Se`<svg fill="none" viewBox="0 0 60 60">
- <g clip-path="url(#a)">
- <path
- fill="#EB8B47"
- d="M0 24.9c0-9.25 0-13.88 1.97-17.33a15 15 0 0 1 5.6-5.6C11.02 0 15.65 0 24.9 0h10.2c9.25 0 13.88 0 17.33 1.97a15 15 0 0 1 5.6 5.6C60 11.02 60 15.65 60 24.9v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6C48.98 60 44.35 60 35.1 60H24.9c-9.25 0-13.88 0-17.33-1.97a15 15 0 0 1-5.6-5.6C0 48.98 0 44.35 0 35.1V24.9Z"
- />
- <path
- stroke="#062B2B"
- stroke-opacity=".1"
- d="M.5 24.9c0-4.64 0-8.08.24-10.8.25-2.7.73-4.65 1.66-6.28A14.5 14.5 0 0 1 7.82 2.4C9.46 1.47 11.39 1 14.1.74A133 133 0 0 1 24.9.5h10.2c4.63 0 8.08 0 10.8.24 2.7.25 4.65.73 6.28 1.66a14.5 14.5 0 0 1 5.42 5.42c.93 1.63 1.41 3.57 1.66 6.28.24 2.72.24 6.16.24 10.8v10.2c0 4.63 0 8.08-.24 10.8-.25 2.7-.73 4.64-1.66 6.28a14.5 14.5 0 0 1-5.42 5.41c-1.63.94-3.57 1.42-6.28 1.67-2.72.24-6.17.24-10.8.24H24.9c-4.63 0-8.08 0-10.8-.24-2.7-.25-4.64-.73-6.28-1.67a14.5 14.5 0 0 1-5.42-5.4C1.47 50.53 1 48.6.74 45.88A133 133 0 0 1 .5 35.1V24.9Z"
- />
- <path
- fill="#FF974C"
- stroke="#fff"
- stroke-width="2"
- d="M39.2 29.2a13 13 0 1 0-18.4 0l1.3 1.28a12.82 12.82 0 0 1 2.1 2.39 6 6 0 0 1 .6 1.47c.2.76.2 1.56.2 3.17v11.24c0 1.08 0 1.61.13 2.12a4 4 0 0 0 .41.98c.26.45.64.83 1.4 1.6l.3.29c.65.65.98.98 1.36 1.09.26.07.54.07.8 0 .38-.11.7-.44 1.36-1.1l3.48-3.47c.65-.65.98-.98 1.09-1.36a1.5 1.5 0 0 0 0-.8c-.1-.38-.44-.7-1.1-1.36l-.47-.48c-.65-.65-.98-.98-1.09-1.36a1.5 1.5 0 0 1 0-.8c.1-.38.44-.7 1.1-1.36l.47-.48c.65-.65.98-.98 1.09-1.36a1.5 1.5 0 0 0 0-.8c-.1-.38-.44-.7-1.1-1.36l-.48-.5c-.65-.64-.98-.97-1.08-1.35a1.5 1.5 0 0 1 0-.79c.1-.38.42-.7 1.06-1.36l5.46-5.55Z"
- />
- <circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2" />
- </g>
- <defs>
- <clipPath id="a"><path fill="#fff" d="M0 0h60v60H0z" /></clipPath>
- </defs>
- </svg> `,Hxe=Se`<svg width="40" height="42" viewBox="0 0 40 42" fill="none">
- <path opacity="0.7" d="M19.9526 41.9076L7.3877 34.655V26.1226L19.9526 33.3751V41.9076Z" fill="url(#paint0_linear_2113_32117)"/>
- <path opacity="0.7" d="M19.9521 41.9076L32.5171 34.655V26.1226L19.9521 33.3751V41.9076Z" fill="url(#paint1_linear_2113_32117)"/>
- <path opacity="0.7" d="M39.9095 7.34521V21.8562L32.5166 26.1225V11.6114L39.9095 7.34521Z" fill="url(#paint2_linear_2113_32117)"/>
- <path d="M39.9099 7.34536L27.345 0.0927734L19.9521 4.359L32.5171 11.6116L39.9099 7.34536Z" fill="url(#paint3_linear_2113_32117)"/>
- <path d="M0 7.34536L12.5649 0.0927734L19.9519 4.359L7.387 11.6116L0 7.34536Z" fill="#F969D3"/>
- <path opacity="0.7" d="M0 7.34521V21.8562L7.387 26.1225V11.6114L0 7.34521Z" fill="url(#paint4_linear_2113_32117)"/>
- <defs>
- <linearGradient id="paint0_linear_2113_32117" x1="18.6099" y1="41.8335" x2="7.73529" y2="8.31842" gradientUnits="userSpaceOnUse">
- <stop stop-color="#E98ADA"/>
- <stop offset="1" stop-color="#7E4DBD"/>
- </linearGradient>
- <linearGradient id="paint1_linear_2113_32117" x1="26.2346" y1="26.1226" x2="26.2346" y2="41.9076" gradientUnits="userSpaceOnUse">
- <stop stop-color="#719DED"/>
- <stop offset="1" stop-color="#2545BE"/>
- </linearGradient>
- <linearGradient id="paint2_linear_2113_32117" x1="36.213" y1="7.34521" x2="36.213" y2="26.1225" gradientUnits="userSpaceOnUse">
- <stop stop-color="#93EBFF"/>
- <stop offset="1" stop-color="#197DDB"/>
- </linearGradient>
- <linearGradient id="paint3_linear_2113_32117" x1="29.931" y1="0.0927734" x2="38.2156" y2="14.8448" gradientUnits="userSpaceOnUse">
- <stop stop-color="#F969D3"/>
- <stop offset="1" stop-color="#4F51C0"/>
- </linearGradient>
- <linearGradient id="paint4_linear_2113_32117" x1="18.1251" y1="44.2539" x2="-7.06792" y2="15.2763" gradientUnits="userSpaceOnUse">
- <stop stop-color="#E98ADA"/>
- <stop offset="1" stop-color="#7E4DBD"/>
- </linearGradient>
- </defs>
- </svg>`,qxe=Se`
- <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
- <g clip-path="url(#a)">
- <path
- d="M0 16.6c0-6.168 0-9.251 1.314-11.555a10 10 0 0 1 3.731-3.731C7.35 0 10.432 0 16.6 0h6.8c6.168 0 9.252 0 11.555 1.314a10 10 0 0 1 3.731 3.731C40 7.35 40 10.432 40 16.6v6.8c0 6.168 0 9.252-1.314 11.555a10 10 0 0 1-3.731 3.731C32.652 40 29.568 40 23.4 40h-6.8c-6.168 0-9.251 0-11.555-1.314a10 10 0 0 1-3.731-3.731C0 32.652 0 29.568 0 23.4v-6.8Z"
- fill="#7D00FF"
- />
- <path
- d="M.5 16.6c0-3.093 0-5.38.162-7.182.161-1.795.48-3.061 1.086-4.125a9.5 9.5 0 0 1 3.545-3.545C6.357 1.141 7.623.823 9.418.662 11.221.5 13.508.5 16.6.5h6.8c3.093 0 5.38 0 7.182.162 1.795.161 3.062.48 4.125 1.086a9.5 9.5 0 0 1 3.545 3.545c.607 1.064.925 2.33 1.086 4.125.161 1.803.162 4.09.162 7.182v6.8c0 3.093 0 5.38-.162 7.182-.161 1.795-.48 3.062-1.086 4.125a9.5 9.5 0 0 1-3.545 3.545c-1.063.607-2.33.925-4.125 1.086-1.803.161-4.09.162-7.182.162h-6.8c-3.093 0-5.38 0-7.182-.162-1.795-.161-3.061-.48-4.125-1.086a9.5 9.5 0 0 1-3.545-3.545c-.607-1.063-.925-2.33-1.086-4.125C.5 28.779.5 26.492.5 23.4v-6.8Z"
- stroke="#fff"
- stroke-opacity=".05"
- />
- <path
- d="M28.306 15.381a3.69 3.69 0 1 0 0-7.381 3.69 3.69 0 0 0 0 7.381ZM16.987 32a8.991 8.991 0 1 1 .016-17.983A8.991 8.991 0 0 1 16.988 32Z"
- fill="#fff"
- />
- </g>
- <defs>
- <clipPath id="a"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
- </defs>
- </svg>
- `,zxe=Se`<svg fill="none" viewBox="0 0 60 60">
- <g clip-path="url(#a)">
- <rect width="60" height="60" fill="#00ACE6" rx="30" />
- <circle cx="64" cy="39" r="50" fill="#1AC6FF" stroke="#fff" stroke-width="2" />
- <circle cx="78" cy="30" r="50" fill="#4DD2FF" stroke="#fff" stroke-width="2" />
- <circle cx="72" cy="15" r="35" fill="#80DFFF" stroke="#fff" stroke-width="2" />
- <circle cx="34" cy="-17" r="45" stroke="#fff" stroke-width="2" />
- <circle cx="34" cy="-5" r="50" stroke="#fff" stroke-width="2" />
- <circle cx="30" cy="45" r="4" fill="#4DD2FF" stroke="#fff" stroke-width="2" />
- <circle cx="39.5" cy="27.5" r="4" fill="#80DFFF" stroke="#fff" stroke-width="2" />
- <circle cx="16" cy="24" r="4" fill="#19C6FF" stroke="#fff" stroke-width="2" />
- </g>
- <rect width="59" height="59" x=".5" y=".5" stroke="#062B2B" stroke-opacity=".1" rx="29.5" />
- <defs>
- <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
- </defs>
- </svg>`,Wxe=Se`<svg fill="none" viewBox="0 0 60 60">
- <g clip-path="url(#a)">
- <rect width="60" height="60" fill="#C653C6" rx="3" />
- <path
- fill="#E87DE8"
- stroke="#fff"
- stroke-width="2"
- d="M52.1 47.34c0-4.24-1.44-9.55-5.9-12.4a2.86 2.86 0 0 0-1.6-3.89v-.82c0-1.19-.52-2.26-1.35-3a4.74 4.74 0 0 0-2.4-6.26v-5.5a11.31 11.31 0 1 0-22.63 0v2.15a3.34 3.34 0 0 0-1.18 5.05 4.74 4.74 0 0 0-.68 6.44A5.22 5.22 0 0 0 14 35.92c-3.06 4.13-6.1 8.3-6.1 15.64 0 2.67.37 4.86.74 6.39a20.3 20.3 0 0 0 .73 2.39l.02.04v.01l.92-.39-.92.4.26.6h38.26l.3-.49-.87-.51.86.5.02-.01.03-.07a16.32 16.32 0 0 0 .57-1.05c.36-.72.85-1.74 1.33-2.96a25.51 25.51 0 0 0 1.94-9.07Z"
- />
- <path
- fill="#fff"
- fill-rule="evenodd"
- d="M26.5 29.5c-3-.5-5.5-3-5.5-7v-7c0-.47 0-.7.03-.9a3 3 0 0 1 2.58-2.57c.2-.03.42-.03.89-.03 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.4 0 2.1 0 2.65.23a3 3 0 0 1 1.62 1.62c.23.55.23 1.25.23 2.65v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.5 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z"
- clip-rule="evenodd"
- />
- </g>
- <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
- <defs>
- <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="3" /></clipPath>
- </defs>
- </svg> `,Vxe=Se`<svg fill="none" viewBox="0 0 60 60">
- <rect width="60" height="60" fill="#794CFF" rx="3" />
- <path
- fill="#987DE8"
- stroke="#fff"
- stroke-width="2"
- d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"
- />
- <path fill="#fff" d="M37.5 25h10v10h-10z" />
- <path fill="#4019B2" d="M42.5 25h5v10h-5z" />
- <path fill="#fff" d="M19.5 25h10v10h-10z" />
- <path fill="#4019B2" d="M24.5 25h5v10h-5z" />
- <path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z" />
- <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
- </svg>`,Gxe=Se`<svg width="60" height="60" viewBox="0 0 60 60" fill="none">
- <g clip-path="url(#clip0_13859_31161)">
- <path d="M0 24.8995C0 15.6481 0 11.0223 1.97053 7.56763C3.3015 5.2342 5.23468 3.30101 7.56812 1.97004C11.0228 -0.000488281 15.6485 -0.000488281 24.9 -0.000488281H35.1C44.3514 -0.000488281 48.9772 -0.000488281 52.4319 1.97004C54.7653 3.30101 56.6985 5.2342 58.0295 7.56763C60 11.0223 60 15.6481 60 24.8995V35.0995C60 44.351 60 48.9767 58.0295 52.4314C56.6985 54.7648 54.7653 56.698 52.4319 58.029C48.9772 59.9995 44.3514 59.9995 35.1 59.9995H24.9C15.6485 59.9995 11.0228 59.9995 7.56812 58.029C5.23468 56.698 3.3015 54.7648 1.97053 52.4314C0 48.9767 0 44.351 0 35.0995V24.8995Z" fill="#EB8B47"/>
- <path d="M0.5 24.8995C0.5 20.2647 0.50047 16.8216 0.744315 14.1045C0.987552 11.3941 1.46987 9.45455 2.40484 7.81536C3.69145 5.55971 5.56019 3.69096 7.81585 2.40435C9.45504 1.46938 11.3946 0.987064 14.105 0.743826C16.8221 0.499981 20.2652 0.499512 24.9 0.499512H35.1C39.7348 0.499512 43.1779 0.499981 45.895 0.743826C48.6054 0.987064 50.545 1.46938 52.1841 2.40435C54.4398 3.69096 56.3086 5.55971 57.5952 7.81536C58.5301 9.45455 59.0124 11.3941 59.2557 14.1045C59.4995 16.8216 59.5 20.2647 59.5 24.8995V35.0995C59.5 39.7343 59.4995 43.1774 59.2557 45.8945C59.0124 48.6049 58.5301 50.5445 57.5952 52.1837C56.3086 54.4393 54.4398 56.3081 52.1841 57.5947C50.545 58.5296 48.6054 59.012 45.895 59.2552C43.1779 59.499 39.7348 59.4995 35.1 59.4995H24.9C20.2652 59.4995 16.8221 59.499 14.105 59.2552C11.3946 59.012 9.45504 58.5296 7.81585 57.5947C5.56019 56.3081 3.69145 54.4393 2.40484 52.1837C1.46987 50.5445 0.987552 48.6049 0.744315 45.8945C0.50047 43.1774 0.5 39.7343 0.5 35.0995V24.8995Z" stroke="#141414" stroke-opacity="0.1"/>
- <path d="M13 26.0335C13 21.7838 13 19.659 14.0822 18.1694C14.4318 17.6883 14.8548 17.2653 15.3359 16.9157C16.8255 15.8335 18.9503 15.8335 23.2 15.8335H36.8C41.0497 15.8335 43.1745 15.8335 44.6641 16.9157C45.1452 17.2653 45.5682 17.6883 45.9178 18.1694C47 19.659 47 21.7838 47 26.0335V33.9668C47 38.2165 47 40.3414 45.9178 41.831C45.5682 42.312 45.1452 42.7351 44.6641 43.0846C43.1745 44.1668 41.0497 44.1668 36.8 44.1668H23.2C18.9503 44.1668 16.8255 44.1668 15.3359 43.0846C14.8548 42.7351 14.4318 42.312 14.0822 41.831C13 40.3414 13 38.2165 13 33.9668V26.0335Z" fill="#FF974C" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M39.5 36.667H36.6666" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M45.2 23.0645H14.8C14.0501 23.0645 13.6751 23.0645 13.4122 23.2554C13.3273 23.3171 13.2527 23.3918 13.191 23.4767C13 23.7395 13 24.1145 13 24.8645V27.2645C13 28.0144 13 28.3894 13.191 28.6522C13.2527 28.7371 13.3273 28.8118 13.4122 28.8735C13.6751 29.0645 14.0501 29.0645 14.8 29.0645H45.2C45.9499 29.0645 46.3249 29.0645 46.5878 28.8735C46.6727 28.8118 46.7473 28.7371 46.809 28.6522C47 28.3894 47 28.0144 47 27.2645V24.8645C47 24.1145 47 23.7395 46.809 23.4767C46.7473 23.3918 46.6727 23.3171 46.5878 23.2554C46.3249 23.0645 45.9499 23.0645 45.2 23.0645Z" fill="white" fill-opacity="0.4" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
- </g>
- <defs>
- <clipPath id="clip0_13859_31161">
- <rect width="60" height="60" fill="white"/>
- </clipPath>
- </defs>
- </svg>`,Kxe=Se`
- <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
- <g clip-path="url(#a)">
- <path
- d="M0 16.6c0-6.168 0-9.251 1.314-11.555a10 10 0 0 1 3.731-3.731C7.35 0 10.432 0 16.6 0h6.8c6.168 0 9.252 0 11.555 1.314a10 10 0 0 1 3.731 3.731C40 7.35 40 10.432 40 16.6v6.8c0 6.168 0 9.252-1.314 11.555a10 10 0 0 1-3.731 3.731C32.652 40 29.568 40 23.4 40h-6.8c-6.168 0-9.251 0-11.555-1.314a10 10 0 0 1-3.731-3.731C0 32.652 0 29.568 0 23.4v-6.8Z"
- fill="#fff"
- />
- <path
- d="M.5 16.6c0-3.093 0-5.38.162-7.182.161-1.795.48-3.061 1.086-4.125a9.5 9.5 0 0 1 3.545-3.545C6.357 1.141 7.623.823 9.418.662 11.221.5 13.508.5 16.6.5h6.8c3.093 0 5.38 0 7.182.162 1.795.161 3.062.48 4.125 1.086a9.5 9.5 0 0 1 3.545 3.545c.607 1.064.925 2.33 1.086 4.125.161 1.803.162 4.09.162 7.182v6.8c0 3.093 0 5.38-.162 7.182-.161 1.795-.48 3.062-1.086 4.125a9.5 9.5 0 0 1-3.545 3.545c-1.063.607-2.33.925-4.125 1.086-1.803.161-4.09.162-7.182.162h-6.8c-3.093 0-5.38 0-7.182-.162-1.795-.161-3.061-.48-4.125-1.086a9.5 9.5 0 0 1-3.545-3.545c-.607-1.063-.925-2.33-1.086-4.125C.5 28.779.5 26.492.5 23.4v-6.8Z"
- stroke="#fff"
- stroke-opacity=".05"
- />
- <path
- d="M18.606 12.642a.781.781 0 0 0-.771.66l-1.281 8.125a.78.78 0 0 1 .77-.66h3.755a7.668 7.668 0 0 0 7.57-6.49 6.26 6.26 0 0 0 .075-.843c-.96-.504-2.089-.792-3.325-.792h-6.793Z"
- fill="#001C64"
- />
- <path
- d="M28.724 13.434c-.006.282-.03.564-.075.843a7.668 7.668 0 0 1-7.57 6.491h-3.754a.78.78 0 0 0-.771.66l-1.916 12.15a.634.634 0 0 0 .626.734h4.075a.781.781 0 0 0 .77-.66l1.074-6.807a.781.781 0 0 1 .772-.66h2.4a7.668 7.668 0 0 0 7.57-6.491c.415-2.651-.92-5.064-3.201-6.26Z"
- fill="#0070E0"
- />
- <path
- d="M13.977 7.226a.78.78 0 0 0-.771.658l-3.198 20.277a.634.634 0 0 0 .626.733h4.742l1.178-7.467 1.281-8.125a.782.782 0 0 1 .771-.66H25.4c1.237 0 2.364.289 3.325.792.065-3.4-2.74-6.208-6.599-6.208h-8.148Z"
- fill="#003087"
- />
- </g>
- <defs>
- <clipPath id="a"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
- </defs>
- </svg>
- `,Zxe=Se`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
- <g clip-path="url(#clip0_241_31635)">
- <path d="M0 26.5595C0 16.6913 0 11.7572 2.1019 8.07217C3.5216 5.58317 5.58366 3.52111 8.07266 2.10141C11.7577 -0.000488281 16.6918 -0.000488281 26.56 -0.000488281H37.44C47.3082 -0.000488281 52.2423 -0.000488281 55.9273 2.10141C58.4163 3.52111 60.4784 5.58317 61.8981 8.07217C64 11.7572 64 16.6913 64 26.5595V37.4395C64 47.3077 64 52.2418 61.8981 55.9268C60.4784 58.4158 58.4163 60.4779 55.9273 61.8976C52.2423 63.9995 47.3082 63.9995 37.44 63.9995H26.56C16.6918 63.9995 11.7577 63.9995 8.07266 61.8976C5.58366 60.4779 3.5216 58.4158 2.1019 55.9268C0 52.2418 0 47.3077 0 37.4395V26.5595Z" fill="#EB8B47"/>
- <path d="M0.5 26.5595C0.5 21.6163 0.50047 17.942 0.760736 15.0418C1.02039 12.1485 1.53555 10.0742 2.53621 8.3199C3.91155 5.90869 5.90917 3.91106 8.32039 2.53572C10.0747 1.53506 12.1489 1.01991 15.0423 0.760247C17.9425 0.499981 21.6168 0.499512 26.56 0.499512H37.44C42.3832 0.499512 46.0575 0.499981 48.9577 0.760247C51.8511 1.01991 53.9253 1.53506 55.6796 2.53572C58.0908 3.91106 60.0885 5.90869 61.4638 8.3199C62.4645 10.0742 62.9796 12.1485 63.2393 15.0418C63.4995 17.942 63.5 21.6163 63.5 26.5595V37.4395C63.5 42.3827 63.4995 46.057 63.2393 48.9572C62.9796 51.8506 62.4645 53.9248 61.4638 55.6791C60.0885 58.0903 58.0908 60.088 55.6796 61.4633C53.9253 62.464 51.8511 62.9791 48.9577 63.2388C46.0575 63.499 42.3832 63.4995 37.44 63.4995H26.56C21.6168 63.4995 17.9425 63.499 15.0423 63.2388C12.1489 62.9791 10.0747 62.464 8.32039 61.4633C5.90917 60.088 3.91155 58.0903 2.53621 55.6791C1.53555 53.9248 1.02039 51.8506 0.760736 48.9572C0.50047 46.057 0.5 42.3827 0.5 37.4395V26.5595Z" stroke="#141414" stroke-opacity="0.1"/>
- <path d="M28.1042 49.2329L13.1024 51.2077L15.0772 36.2059L37.1015 14.1815C39.2441 12.039 40.3154 10.9677 41.5718 10.624C42.4205 10.3918 43.3159 10.3918 44.1645 10.624C45.421 10.9677 46.4922 12.039 48.6348 14.1815L50.1286 15.6753C52.2711 17.8179 53.3424 18.8891 53.6861 20.1456C53.9183 20.9942 53.9183 21.8896 53.6861 22.7383C53.3424 23.9947 52.2711 25.066 50.1286 27.2086L28.1042 49.2329Z" fill="#FF974C" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M38.5962 20.5376L22.4199 36.7139" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M43.7727 25.714L27.5964 41.8903" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M22.3703 36.7635C19.3258 39.808 16.0198 36.6395 16.2616 35.0324" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M27.5466 41.9399C24.5034 44.9831 28.155 48.7098 29.2738 48.0475" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M27.5468 41.9398C23.428 46.0586 18.2516 40.8822 22.3704 36.7634" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M15.8191 50.5214C15.4711 49.5823 14.728 48.8392 13.7889 48.4912" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M49.2862 29.5805L34.7275 15.0219" stroke="#E4E7E7" stroke-width="2" stroke-linejoin="round"/>
- </g>
- <defs>
- <clipPath id="clip0_241_31635">
- <rect width="64" height="64" fill="white"/>
- </clipPath>
- </defs>
- </svg>
- `,Yxe=Se`<svg
- viewBox="0 0 60 60"
- fill="none"
- >
- <g clip-path="url(#1)">
- <rect width="60" height="60" rx="30" fill="#00ACE6" />
- <path
- d="M59 73C59 89.0163 46.0163 102 30 102C13.9837 102 1 89.0163 1 73C1 56.9837 12 44 30 44C48 44 59 56.9837 59 73Z"
- fill="#1AC6FF"
- stroke="white"
- stroke-width="2"
- />
- <path
- d="M18.6904 19.9015C19.6264 15.3286 23.3466 11.8445 27.9708 11.2096C29.3231 11.024 30.6751 11.0238 32.0289 11.2096C36.6532 11.8445 40.3733 15.3286 41.3094 19.9015C41.4868 20.7681 41.6309 21.6509 41.7492 22.5271C41.8811 23.5041 41.8811 24.4944 41.7492 25.4715C41.6309 26.3476 41.4868 27.2304 41.3094 28.097C40.3733 32.6699 36.6532 36.154 32.0289 36.7889C30.6772 36.9744 29.3216 36.9743 27.9708 36.7889C23.3466 36.154 19.6264 32.6699 18.6904 28.097C18.513 27.2304 18.3689 26.3476 18.2506 25.4715C18.1186 24.4944 18.1186 23.5041 18.2506 22.5271C18.3689 21.6509 18.513 20.7681 18.6904 19.9015Z"
- fill="#1AC6FF"
- stroke="white"
- stroke-width="2"
- />
- <circle cx="24.5" cy="23.5" r="1.5" fill="white" />
- <circle cx="35.5" cy="23.5" r="1.5" fill="white" />
- <path
- d="M31 20L28 28H32"
- stroke="white"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- />
- </g>
- <rect x="0.5" y="0.5" width="59" height="59" rx="29.5" stroke="white" stroke-opacity="0.1" />
- <defs>
- <clipPath id="1">
- <rect width="60" height="60" rx="30" fill="white" />
- </clipPath>
- </defs>
- </svg> `,Jxe=Se`<svg fill="none" viewBox="0 0 80 80">
- <g clip-path="url(#a)">
- <path fill="url(#b)" d="M40 80a40 40 0 1 0 0-80 40 40 0 0 0 0 80Z" />
- <path
- stroke="#fff"
- stroke-opacity=".1"
- d="M79.5 40a39.5 39.5 0 1 1-79 0 39.5 39.5 0 0 1 79 0Z"
- />
- <path
- fill="#fff"
- d="m62.62 51.54-7.54 7.91a1.75 1.75 0 0 1-1.29.55H18.02a.9.9 0 0 1-.8-.52.84.84 0 0 1 .16-.92l7.55-7.92a1.75 1.75 0 0 1 1.28-.55h35.77a.87.87 0 0 1 .8.52.84.84 0 0 1-.16.93Zm-7.54-15.95a1.75 1.75 0 0 0-1.29-.54H18.02a.89.89 0 0 0-.8.51.84.84 0 0 0 .16.93l7.55 7.92a1.75 1.75 0 0 0 1.28.54h35.77a.89.89 0 0 0 .8-.51.84.84 0 0 0-.16-.93l-7.54-7.92ZM18.02 29.9h35.77a1.79 1.79 0 0 0 1.29-.54l7.54-7.92a.85.85 0 0 0 .16-.93.87.87 0 0 0-.8-.51H26.21a1.79 1.79 0 0 0-1.28.54l-7.55 7.92a.85.85 0 0 0-.16.93.89.89 0 0 0 .8.52Z"
- />
- </g>
- <defs>
- <linearGradient id="b" x1="6.75" x2="80.68" y1="81.91" y2="7.37" gradientUnits="userSpaceOnUse">
- <stop offset=".08" stop-color="#9945FF" />
- <stop offset=".3" stop-color="#8752F3" />
- <stop offset=".5" stop-color="#5497D5" />
- <stop offset=".6" stop-color="#43B4CA" />
- <stop offset=".72" stop-color="#28E0B9" />
- <stop offset=".97" stop-color="#19FB9B" />
- </linearGradient>
- <clipPath id="a"><path fill="#fff" d="M0 0h80v80H0z" /></clipPath>
- </defs>
- </svg> `,Qxe=Se`
- <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
- <g clip-path="url(#a)">
- <path
- d="M0 16.6c0-6.168 0-9.251 1.314-11.555a10 10 0 0 1 3.731-3.731C7.35 0 10.432 0 16.6 0h6.8c6.168 0 9.252 0 11.555 1.314a10 10 0 0 1 3.731 3.731C40 7.35 40 10.432 40 16.6v6.8c0 6.168 0 9.252-1.314 11.555a10 10 0 0 1-3.731 3.731C32.652 40 29.568 40 23.4 40h-6.8c-6.168 0-9.251 0-11.555-1.314a10 10 0 0 1-3.731-3.731C0 32.652 0 29.568 0 23.4v-6.8Z"
- fill="#635BFF"
- />
- <path
- d="M.5 16.6c0-3.093 0-5.38.162-7.182.161-1.795.48-3.061 1.086-4.125a9.5 9.5 0 0 1 3.545-3.545C6.357 1.141 7.623.823 9.418.662 11.221.5 13.508.5 16.6.5h6.8c3.093 0 5.38 0 7.182.162 1.795.161 3.062.48 4.125 1.086a9.5 9.5 0 0 1 3.545 3.545c.607 1.064.925 2.33 1.086 4.125.161 1.803.162 4.09.162 7.182v6.8c0 3.093 0 5.38-.162 7.182-.161 1.795-.48 3.062-1.086 4.125a9.5 9.5 0 0 1-3.545 3.545c-1.063.607-2.33.925-4.125 1.086-1.803.161-4.09.162-7.182.162h-6.8c-3.093 0-5.38 0-7.182-.162-1.795-.161-3.061-.48-4.125-1.086a9.5 9.5 0 0 1-3.545-3.545c-.607-1.063-.925-2.33-1.086-4.125C.5 28.779.5 26.492.5 23.4v-6.8Z"
- stroke="#fff"
- stroke-opacity=".05"
- />
- <path
- fill-rule="evenodd"
- clip-rule="evenodd"
- d="M18.299 15.147c0-1.028.844-1.424 2.242-1.424 2.004 0 4.536.607 6.54 1.688V9.213C24.892 8.343 22.73 8 20.541 8c-5.354 0-8.915 2.796-8.915 7.464 0 7.279 10.022 6.118 10.022 9.257 0 1.213-1.055 1.609-2.531 1.609-2.19 0-4.985-.897-7.2-2.11v6.277a18.283 18.283 0 0 0 7.2 1.503c5.485 0 9.257-2.716 9.257-7.437-.027-7.86-10.075-6.462-10.075-9.416Z"
- fill="#fff"
- />
- </g>
- <defs>
- <clipPath id="a"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
- </defs>
- </svg>
- `,Xxe=Se`<svg viewBox="0 0 60 60" fill="none">
- <g clip-path="url(#1)">
- <path
- d="M0 24.9C0 15.6485 0 11.0228 1.97053 7.56812C3.3015 5.23468 5.23468 3.3015 7.56812 1.97053C11.0228 0 15.6485 0 24.9 0H35.1C44.3514 0 48.9772 0 52.4319 1.97053C54.7653 3.3015 56.6985 5.23468 58.0295 7.56812C60 11.0228 60 15.6485 60 24.9V35.1C60 44.3514 60 48.9772 58.0295 52.4319C56.6985 54.7653 54.7653 56.6985 52.4319 58.0295C48.9772 60 44.3514 60 35.1 60H24.9C15.6485 60 11.0228 60 7.56812 58.0295C5.23468 56.6985 3.3015 54.7653 1.97053 52.4319C0 48.9772 0 44.3514 0 35.1V24.9Z"
- fill="#794CFF"
- />
- <path
- d="M0.5 24.9C0.5 20.2652 0.50047 16.8221 0.744315 14.105C0.987552 11.3946 1.46987 9.45504 2.40484 7.81585C3.69145 5.56019 5.56019 3.69145 7.81585 2.40484C9.45504 1.46987 11.3946 0.987552 14.105 0.744315C16.8221 0.50047 20.2652 0.5 24.9 0.5H35.1C39.7348 0.5 43.1779 0.50047 45.895 0.744315C48.6054 0.987552 50.545 1.46987 52.1841 2.40484C54.4398 3.69145 56.3086 5.56019 57.5952 7.81585C58.5301 9.45504 59.0124 11.3946 59.2557 14.105C59.4995 16.8221 59.5 20.2652 59.5 24.9V35.1C59.5 39.7348 59.4995 43.1779 59.2557 45.895C59.0124 48.6054 58.5301 50.545 57.5952 52.1841C56.3086 54.4398 54.4398 56.3086 52.1841 57.5952C50.545 58.5301 48.6054 59.0124 45.895 59.2557C43.1779 59.4995 39.7348 59.5 35.1 59.5H24.9C20.2652 59.5 16.8221 59.4995 14.105 59.2557C11.3946 59.0124 9.45504 58.5301 7.81585 57.5952C5.56019 56.3086 3.69145 54.4398 2.40484 52.1841C1.46987 50.545 0.987552 48.6054 0.744315 45.895C0.50047 43.1779 0.5 39.7348 0.5 35.1V24.9Z"
- stroke="#062B2B"
- stroke-opacity="0.1"
- />
- <path
- d="M35.1403 31.5016C35.1193 30.9637 35.388 30.4558 35.8446 30.1707C36.1207 29.9982 36.4761 29.8473 36.7921 29.7685C37.3143 29.6382 37.8664 29.7977 38.2386 30.1864C38.8507 30.8257 39.3004 31.6836 39.8033 32.408C40.2796 33.0942 41.4695 33.2512 41.9687 32.5047C42.4839 31.7341 42.9405 30.8229 43.572 30.1399C43.9375 29.7447 44.4866 29.5756 45.0111 29.6967C45.3283 29.7701 45.6863 29.9147 45.9655 30.0823C46.4269 30.3595 46.7045 30.8626 46.6928 31.4008C46.6731 32.3083 46.3764 33.2571 46.2158 34.1473C46.061 35.0048 46.9045 35.8337 47.7592 35.664C48.6464 35.4878 49.5899 35.1747 50.497 35.1391C51.0348 35.1181 51.5427 35.3868 51.8279 35.8433C52.0004 36.1195 52.1513 36.4749 52.2301 36.7908C52.3604 37.3131 52.2009 37.8651 51.8121 38.2374C51.1729 38.8495 50.3151 39.2991 49.5908 39.8019C48.9046 40.2782 48.7473 41.4683 49.4939 41.9675C50.2644 42.4827 51.1757 42.9393 51.8587 43.5708C52.2539 43.9362 52.423 44.4854 52.3018 45.0099C52.2285 45.3271 52.0839 45.6851 51.9162 45.9642C51.6391 46.4257 51.1359 46.7032 50.5978 46.6916C49.6903 46.6719 48.7417 46.3753 47.8516 46.2146C46.9939 46.0598 46.1648 46.9035 46.3346 47.7583C46.5108 48.6454 46.8239 49.5888 46.8594 50.4958C46.8805 51.0336 46.6117 51.5415 46.1552 51.8267C45.879 51.9992 45.5236 52.15 45.2077 52.2289C44.6854 52.3592 44.1334 52.1997 43.7611 51.8109C43.1491 51.1718 42.6996 50.314 42.1968 49.5897C41.7203 48.9034 40.5301 48.7463 40.0309 49.493C39.5157 50.2634 39.0592 51.1746 38.4278 51.8574C38.0623 52.2527 37.5132 52.4218 36.9887 52.3006C36.6715 52.2273 36.3135 52.0826 36.0343 51.915C35.5729 51.6379 35.2953 51.1347 35.307 50.5966C35.3267 49.6891 35.6233 48.7405 35.7839 47.8505C35.9388 46.9928 35.0951 46.1636 34.2402 46.3334C33.3531 46.5096 32.4098 46.8227 31.5028 46.8582C30.9649 46.8793 30.457 46.6105 30.1719 46.154C29.9994 45.8778 29.8485 45.5224 29.7697 45.2065C29.6394 44.6842 29.7989 44.1322 30.1877 43.7599C30.8269 43.1479 31.6847 42.6982 32.4091 42.1954C33.0954 41.7189 33.2522 40.5289 32.5056 40.0297C31.7351 39.5145 30.824 39.058 30.1411 38.4265C29.7459 38.0611 29.5768 37.5119 29.698 36.9875C29.7713 36.6702 29.9159 36.3122 30.0836 36.0331C30.3607 35.5717 30.8638 35.2941 31.402 35.3058C32.3095 35.3255 33.2583 35.6221 34.1485 35.7828C35.006 35.9376 35.8349 35.094 35.6652 34.2393C35.489 33.3521 35.1759 32.4087 35.1403 31.5016Z"
- fill="#906EF7"
- stroke="white"
- stroke-width="2"
- />
- <path
- d="M20.7706 8.22357C20.9036 7.51411 21.5231 7 22.2449 7H23.7551C24.4769 7 25.0964 7.51411 25.2294 8.22357C25.5051 9.69403 25.4829 11.6321 27.1202 12.2606C27.3092 12.3331 27.4958 12.4105 27.6798 12.4926C29.2818 13.2072 30.6374 11.8199 31.8721 10.9752C32.4678 10.5676 33.2694 10.6421 33.7798 11.1525L34.8477 12.2204C35.3581 12.7308 35.4326 13.5323 35.025 14.128C34.1802 15.3627 32.7931 16.7183 33.5077 18.3202C33.5898 18.5043 33.6672 18.6909 33.7398 18.88C34.3683 20.5171 36.3061 20.4949 37.7764 20.7706C38.4859 20.9036 39 21.5231 39 22.2449V23.7551C39 24.4769 38.4859 25.0964 37.7764 25.2294C36.3061 25.5051 34.3685 25.483 33.7401 27.1201C33.6675 27.3093 33.59 27.4961 33.5079 27.6803C32.7934 29.282 34.1803 30.6374 35.025 31.8719C35.4326 32.4677 35.3581 33.2692 34.8477 33.7796L33.7798 34.8475C33.2694 35.3579 32.4678 35.4324 31.8721 35.0248C30.6376 34.1801 29.2823 32.7934 27.6806 33.508C27.4962 33.5903 27.3093 33.6678 27.12 33.7405C25.483 34.3688 25.5051 36.3062 25.2294 37.7764C25.0964 38.4859 24.4769 39 23.7551 39H22.2449C21.5231 39 20.9036 38.4859 20.7706 37.7764C20.4949 36.3062 20.517 34.3688 18.88 33.7405C18.6908 33.6678 18.5039 33.5903 18.3196 33.5081C16.7179 32.7936 15.3625 34.1804 14.1279 35.0251C13.5322 35.4327 12.7307 35.3582 12.2203 34.8478L11.1524 33.7799C10.642 33.2695 10.5675 32.4679 10.9751 31.8722C11.8198 30.6376 13.2067 29.2822 12.4922 27.6804C12.41 27.4962 12.3325 27.3093 12.2599 27.1201C11.6315 25.483 9.69392 25.5051 8.22357 25.2294C7.51411 25.0964 7 24.4769 7 23.7551V22.2449C7 21.5231 7.51411 20.9036 8.22357 20.7706C9.69394 20.4949 11.6317 20.5171 12.2602 18.88C12.3328 18.6909 12.4103 18.5042 12.4924 18.3201C13.207 16.7181 11.8198 15.3625 10.975 14.1278C10.5674 13.5321 10.6419 12.7305 11.1523 12.2201L12.2202 11.1522C12.7306 10.6418 13.5322 10.5673 14.1279 10.9749C15.3626 11.8197 16.7184 13.2071 18.3204 12.4925C18.5044 12.4105 18.6909 12.3331 18.8799 12.2606C20.5171 11.6321 20.4949 9.69403 20.7706 8.22357Z"
- fill="#906EF7"
- stroke="white"
- stroke-width="2"
- />
- <circle cx="23" cy="23" r="6" fill="#794CFF" stroke="white" stroke-width="2" />
- <circle cx="41" cy="41" r="4" fill="#794CFF" stroke="white" stroke-width="2" />
- </g>
- <defs>
- <clipPath id="1">
- <rect width="60" height="60" fill="white" />
- </clipPath>
- </defs>
- </svg> `,e8e=de`
- :host {
- display: block;
- width: var(--local-size);
- height: var(--local-size);
- }
- :host svg {
- width: 100%;
- height: 100%;
- }
- `;var W7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const t8e={browser:Rxe,dao:Nxe,defi:$xe,defiAlt:jxe,eth:Bxe,layers:Mxe,lock:Uxe,login:Fxe,network:zxe,nft:Wxe,noun:Vxe,profile:Yxe,system:Xxe,coinbase:kxe,meld:Hxe,onrampCard:Gxe,moonpay:qxe,stripe:Qxe,paypal:Kxe,google:Dxe,pencil:Zxe,lightbulb:Lxe,solana:Jxe,bitcoin:Oxe};let Fy=class extends se{constructor(){super(...arguments),this.name="browser",this.size="md"}render(){return this.style.cssText=`
- --local-size: var(--wui-visual-size-${this.size});
- `,M`${t8e[this.name]}`}};Fy.styles=[He,e8e];W7([q()],Fy.prototype,"name",void 0);W7([q()],Fy.prototype,"size",void 0);Fy=W7([te("wui-visual")],Fy);const r8e=de`
- button {
- padding: var(--wui-spacing-s);
- border-radius: var(--wui-border-radius-xs);
- border: none;
- outline: none;
- background-color: var(--wui-color-gray-glass-002);
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- gap: var(--wui-spacing-s);
- transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: background-color;
- }
- button:hover {
- background-color: var(--wui-color-gray-glass-005);
- }
- .provider-image {
- width: var(--wui-spacing-3xl);
- min-width: var(--wui-spacing-3xl);
- height: var(--wui-spacing-3xl);
- border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2));
- position: relative;
- overflow: hidden;
- }
- .provider-image::after {
- content: '';
- display: block;
- width: 100%;
- height: 100%;
- position: absolute;
- inset: 0;
- border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2));
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
- }
- .network-icon {
- width: var(--wui-spacing-m);
- height: var(--wui-spacing-m);
- border-radius: calc(var(--wui-spacing-m) / 2);
- overflow: hidden;
- box-shadow:
- 0 0 0 3px var(--wui-color-gray-glass-002),
- 0 0 0 3px var(--wui-color-modal-bg);
- transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: box-shadow;
- }
- button:hover .network-icon {
- box-shadow:
- 0 0 0 3px var(--wui-color-gray-glass-005),
- 0 0 0 3px var(--wui-color-modal-bg);
- }
- `;var Ud=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let ic=class extends se{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="",this.feeRange="",this.loading=!1,this.onClick=null}render(){return M`
- <button ?disabled=${this.disabled} @click=${this.onClick} ontouchstart>
- <wui-visual name=${we(this.name)} class="provider-image"></wui-visual>
- <wui-flex flexDirection="column" gap="4xs">
- <wui-text variant="paragraph-500" color="fg-100">${this.label}</wui-text>
- <wui-flex alignItems="center" justifyContent="flex-start" gap="l">
- <wui-text variant="tiny-500" color="fg-100">
- <wui-text variant="tiny-400" color="fg-200">Fees</wui-text>
- ${this.feeRange}
- </wui-text>
- <wui-flex gap="xxs">
- <wui-icon name="bank" size="xs" color="fg-150"></wui-icon>
- <wui-icon name="card" size="xs" color="fg-150"></wui-icon>
- </wui-flex>
- ${this.networksTemplate()}
- </wui-flex>
- </wui-flex>
- ${this.loading?M`<wui-loading-spinner color="fg-200" size="md"></wui-loading-spinner>`:M`<wui-icon name="chevronRight" color="fg-200" size="sm"></wui-icon>`}
- </button>
- `}networksTemplate(){var n;const e=F.getAllRequestedCaipNetworks(),r=(n=e==null?void 0:e.filter(i=>{var s;return(s=i==null?void 0:i.assets)==null?void 0:s.imageId}))==null?void 0:n.slice(0,5);return M`
- <wui-flex class="networks">
- ${r==null?void 0:r.map(i=>M`
- <wui-flex class="network-icon">
- <wui-image src=${we(pt.getNetworkImage(i))}></wui-image>
- </wui-flex>
- `)}
- </wui-flex>
- `}};ic.styles=[r8e];Ud([q({type:Boolean})],ic.prototype,"disabled",void 0);Ud([q()],ic.prototype,"color",void 0);Ud([q()],ic.prototype,"name",void 0);Ud([q()],ic.prototype,"label",void 0);Ud([q()],ic.prototype,"feeRange",void 0);Ud([q({type:Boolean})],ic.prototype,"loading",void 0);Ud([q()],ic.prototype,"onClick",void 0);ic=Ud([te("w3m-onramp-provider-item")],ic);const n8e=de`
- wui-flex {
- border-top: 1px solid var(--wui-color-gray-glass-005);
- }
- a {
- text-decoration: none;
- color: var(--wui-color-fg-175);
- font-weight: 500;
- display: flex;
- align-items: center;
- justify-content: center;
- gap: var(--wui-spacing-3xs);
- }
- `;var i8e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let MP=class extends se{render(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=oe.state;return!e&&!r?null:M`
- <wui-flex
- .padding=${["m","s","s","s"]}
- flexDirection="column"
- alignItems="center"
- justifyContent="center"
- gap="s"
- >
- <wui-text color="fg-250" variant="small-400" align="center">
- We work with the best providers to give you the lowest fees and best support. More options
- coming soon!
- </wui-text>
- ${this.howDoesItWorkTemplate()}
- </wui-flex>
- `}howDoesItWorkTemplate(){return M` <wui-link @click=${this.onWhatIsBuy.bind(this)}>
- <wui-icon size="xs" color="accent-100" slot="iconLeft" name="helpCircle"></wui-icon>
- How does it work?
- </wui-link>`}onWhatIsBuy(){var r;const e=F.state.activeChain;Re.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:((r=re.state.preferredAccountTypes)==null?void 0:r[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT}}),X.push("WhatIsABuy")}};MP.styles=[n8e];MP=i8e([te("w3m-onramp-providers-footer")],MP);var XJ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let h6=class extends se{constructor(){super(),this.unsubscribe=[],this.providers=$t.state.providers,this.unsubscribe.push($t.subscribeKey("providers",e=>{this.providers=e}))}firstUpdated(){const e=this.providers.map(async r=>r.name==="coinbase"?await this.getCoinbaseOnRampURL():Promise.resolve(r==null?void 0:r.url));Promise.all(e).then(r=>{this.providers=this.providers.map((n,i)=>({...n,url:r[i]||""}))})}render(){return M`
- <wui-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs">
- ${this.onRampProvidersTemplate()}
- </wui-flex>
- <w3m-onramp-providers-footer></w3m-onramp-providers-footer>
- `}onRampProvidersTemplate(){return this.providers.filter(e=>e.supportedChains.includes(F.state.activeChain??"eip155")).map(e=>M`
- <w3m-onramp-provider-item
- label=${e.label}
- name=${e.name}
- feeRange=${e.feeRange}
- @click=${()=>{this.onClickProvider(e)}}
- ?disabled=${!e.url}
- data-testid=${`onramp-provider-${e.name}`}
- ></w3m-onramp-provider-item>
- `)}onClickProvider(e){var n;const r=F.state.activeChain;$t.setSelectedProvider(e),X.push("BuyInProgress"),ue.openHref(e.url,"popupWindow","width=600,height=800,scrollbars=yes"),Re.sendEvent({type:"track",event:"SELECT_BUY_PROVIDER",properties:{provider:e.name,isSmartAccount:((n=re.state.preferredAccountTypes)==null?void 0:n[r])===bt.ACCOUNT_TYPES.SMART_ACCOUNT}})}async getCoinbaseOnRampURL(){const e=re.state.address,r=F.state.activeCaipNetwork;if(!e)throw new Error("No address found");if(!(r!=null&&r.name))throw new Error("No network found");const n=ct.WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP[r.name]??ct.WC_COINBASE_PAY_SDK_FALLBACK_CHAIN,i=$t.state.purchaseCurrency,s=i?[i.symbol]:$t.state.purchaseCurrencies.map(o=>o.symbol);return await Xe.generateOnRampURL({defaultNetwork:n,destinationWallets:[{address:e,blockchains:ct.WC_COINBASE_PAY_SDK_CHAINS,assets:s}],partnerUserId:e,purchaseAmount:$t.state.purchaseAmount})}};XJ([G()],h6.prototype,"providers",void 0);h6=XJ([te("w3m-onramp-providers-view")],h6);const s8e=de`
- :host > wui-grid {
- max-height: 360px;
- overflow: auto;
- }
- wui-flex {
- transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: opacity;
- }
- wui-grid::-webkit-scrollbar {
- display: none;
- }
- wui-flex.disabled {
- opacity: 0.3;
- pointer-events: none;
- user-select: none;
- }
- `;var l2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Id=class extends se{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=$t.state.purchaseCurrencies,this.tokens=$t.state.purchaseCurrencies,this.tokenImages=er.state.tokenImages,this.checked=As.state.isLegalCheckboxChecked,this.unsubscribe.push($t.subscribe(e=>{this.selectedCurrency=e.purchaseCurrencies,this.tokens=e.purchaseCurrencies}),er.subscribeKey("tokenImages",e=>this.tokenImages=e),As.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var a;const{termsConditionsUrl:e,privacyPolicyUrl:r}=oe.state,n=(a=oe.state.features)==null?void 0:a.legalCheckbox,o=!!(e||r)&&!!n&&!this.checked;return M`
- <w3m-legal-checkbox></w3m-legal-checkbox>
- <wui-flex
- flexDirection="column"
- .padding=${["0","s","s","s"]}
- gap="xs"
- class=${we(o?"disabled":void 0)}
- >
- ${this.currenciesTemplate(o)}
- </wui-flex>
- <w3m-legal-footer></w3m-legal-footer>
- `}currenciesTemplate(e=!1){return this.tokens.map(r=>{var n;return M`
- <wui-list-item
- imageSrc=${we((n=this.tokenImages)==null?void 0:n[r.symbol])}
- @click=${()=>this.selectToken(r)}
- variant="image"
- tabIdx=${we(e?-1:void 0)}
- >
- <wui-flex gap="3xs" alignItems="center">
- <wui-text variant="paragraph-500" color="fg-100">${r.name}</wui-text>
- <wui-text variant="small-400" color="fg-200">${r.symbol}</wui-text>
- </wui-flex>
- </wui-list-item>
- `})}selectToken(e){e&&($t.setPurchaseCurrency(e),We.close())}};Id.styles=s8e;l2([G()],Id.prototype,"selectedCurrency",void 0);l2([G()],Id.prototype,"tokens",void 0);l2([G()],Id.prototype,"tokenImages",void 0);l2([G()],Id.prototype,"checked",void 0);Id=l2([te("w3m-onramp-token-select-view")],Id);const o8e=de`
- @keyframes shake {
- 0% {
- transform: translateX(0);
- }
- 25% {
- transform: translateX(3px);
- }
- 50% {
- transform: translateX(-3px);
- }
- 75% {
- transform: translateX(3px);
- }
- 100% {
- transform: translateX(0);
- }
- }
- wui-flex:first-child:not(:only-child) {
- position: relative;
- }
- wui-loading-thumbnail {
- position: absolute;
- }
- wui-visual {
- width: var(--wui-wallet-image-size-lg);
- height: var(--wui-wallet-image-size-lg);
- border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
- position: relative;
- overflow: hidden;
- }
- wui-visual::after {
- content: '';
- display: block;
- width: 100%;
- height: 100%;
- position: absolute;
- inset: 0;
- border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
- }
- wui-icon-box {
- position: absolute;
- right: calc(var(--wui-spacing-3xs) * -1);
- bottom: calc(var(--wui-spacing-3xs) * -1);
- opacity: 0;
- transform: scale(0.5);
- transition:
- opacity var(--wui-ease-out-power-2) var(--wui-duration-lg),
- transform var(--wui-ease-out-power-2) var(--wui-duration-lg);
- will-change: opacity, transform;
- }
- wui-text[align='center'] {
- width: 100%;
- padding: 0px var(--wui-spacing-l);
- }
- [data-error='true'] wui-icon-box {
- opacity: 1;
- transform: scale(1);
- }
- [data-error='true'] > wui-flex:first-child {
- animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
- }
- [data-retry='false'] wui-link {
- display: none;
- }
- [data-retry='true'] wui-link {
- display: block;
- opacity: 1;
- }
- wui-link {
- padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs);
- }
- `;var sa=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Ji=class extends se{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=$t.state.selectedProvider,this.uri=xe.state.wcUri,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.error=!1,this.startTime=null,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push($t.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e})),this.watchTransactions()}disconnectedCallback(){this.intervalId&&clearInterval(this.intervalId)}render(){var n,i;let e="Continue in external window";this.error?e="Buy failed":this.selectedOnRampProvider&&(e=`Buy in ${(n=this.selectedOnRampProvider)==null?void 0:n.label}`);const r=this.error?"Buy can be declined from your side or due to and error on the provider app":"We’ll notify you once your Buy is processed";return M`
- <wui-flex
- data-error=${we(this.error)}
- data-retry=${this.showRetry}
- flexDirection="column"
- alignItems="center"
- .padding=${["3xl","xl","xl","xl"]}
- gap="xl"
- >
- <wui-flex justifyContent="center" alignItems="center">
- <wui-visual
- name=${we((i=this.selectedOnRampProvider)==null?void 0:i.name)}
- size="lg"
- class="provider-image"
- >
- </wui-visual>
- ${this.error?null:this.loaderTemplate()}
- <wui-icon-box
- backgroundColor="error-100"
- background="opaque"
- iconColor="error-100"
- icon="close"
- size="sm"
- border
- borderColor="wui-color-bg-125"
- ></wui-icon-box>
- </wui-flex>
- <wui-flex flexDirection="column" alignItems="center" gap="xs">
- <wui-text variant="paragraph-500" color=${this.error?"error-100":"fg-100"}>
- ${e}
- </wui-text>
- <wui-text align="center" variant="small-500" color="fg-200">${r}</wui-text>
- </wui-flex>
- ${this.error?this.tryAgainTemplate():null}
- </wui-flex>
- <wui-flex .padding=${["0","xl","xl","xl"]} justifyContent="center">
- <wui-link @click=${this.onCopyUri} color="fg-200">
- <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
- Copy link
- </wui-link>
- </wui-flex>
- `}watchTransactions(){if(this.selectedOnRampProvider)switch(this.selectedOnRampProvider.name){case"coinbase":this.startTime=Date.now(),this.initializeCoinbaseTransactions();break}}async initializeCoinbaseTransactions(){await this.watchCoinbaseTransactions(),this.intervalId=setInterval(()=>this.watchCoinbaseTransactions(),4e3)}async watchCoinbaseTransactions(){try{const e=re.state.address;if(!e)throw new Error("No address found");(await Xe.fetchTransactions({account:e,onramp:"coinbase"})).data.filter(i=>new Date(i.metadata.minedAt)>new Date(this.startTime)||i.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length?(clearInterval(this.intervalId),X.replace("OnRampActivity")):this.startTime&&Date.now()-this.startTime>=18e4&&(clearInterval(this.intervalId),this.error=!0)}catch(e){Fe.showError(e)}}onTryAgain(){this.selectedOnRampProvider&&(this.error=!1,ue.openHref(this.selectedOnRampProvider.url,"popupWindow","width=600,height=800,scrollbars=yes"))}tryAgainTemplate(){var e;return(e=this.selectedOnRampProvider)!=null&&e.url?M`<wui-button size="md" variant="accent" @click=${this.onTryAgain.bind(this)}>
- <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
- Try again
- </wui-button>`:null}loaderTemplate(){const e=ar.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return M`<wui-loading-thumbnail radius=${r*9}></wui-loading-thumbnail>`}onCopyUri(){var e;if(!((e=this.selectedOnRampProvider)!=null&&e.url)){Fe.showError("No link found"),X.goBack();return}try{ue.copyToClopboard(this.selectedOnRampProvider.url),Fe.showSuccess("Link copied")}catch{Fe.showError("Failed to copy")}}};Ji.styles=o8e;sa([G()],Ji.prototype,"intervalId",void 0);sa([G()],Ji.prototype,"selectedOnRampProvider",void 0);sa([G()],Ji.prototype,"uri",void 0);sa([G()],Ji.prototype,"ready",void 0);sa([G()],Ji.prototype,"showRetry",void 0);sa([G()],Ji.prototype,"buffering",void 0);sa([G()],Ji.prototype,"error",void 0);sa([G()],Ji.prototype,"startTime",void 0);sa([q({type:Boolean})],Ji.prototype,"isMobile",void 0);sa([q()],Ji.prototype,"onRetry",void 0);Ji=sa([te("w3m-buy-in-progress-view")],Ji);var a8e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let LP=class extends se{render(){return M`
- <wui-flex
- flexDirection="column"
- .padding=${["xxl","3xl","xl","3xl"]}
- alignItems="center"
- gap="xl"
- >
- <wui-visual name="onrampCard"></wui-visual>
- <wui-flex flexDirection="column" gap="xs" alignItems="center">
- <wui-text align="center" variant="paragraph-500" color="fg-100">
- Quickly and easily buy digital assets!
- </wui-text>
- <wui-text align="center" variant="small-400" color="fg-200">
- Simply select your preferred onramp provider and add digital assets to your account
- using your credit card or bank transfer
- </wui-text>
- </wui-flex>
- <wui-button @click=${X.goBack}>
- <wui-icon size="sm" color="inherit" name="add" slot="iconLeft"></wui-icon>
- Buy
- </wui-button>
- </wui-flex>
- `}};LP=a8e([te("w3m-what-is-a-buy-view")],LP);const c8e=de`
- :host {
- width: 100%;
- }
- wui-loading-spinner {
- position: absolute;
- top: 50%;
- right: 20px;
- transform: translateY(-50%);
- }
- .currency-container {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- right: var(--wui-spacing-1xs);
- height: 40px;
- padding: var(--wui-spacing-xs) var(--wui-spacing-1xs) var(--wui-spacing-xs)
- var(--wui-spacing-xs);
- min-width: 95px;
- border-radius: var(--FULL, 1000px);
- border: 1px solid var(--wui-color-gray-glass-002);
- background: var(--wui-color-gray-glass-002);
- cursor: pointer;
- }
- .currency-container > wui-image {
- height: 24px;
- width: 24px;
- border-radius: 50%;
- }
- `;var Op=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Mu=class extends se{constructor(){var e;super(),this.unsubscribe=[],this.type="Token",this.value=0,this.currencies=[],this.selectedCurrency=(e=this.currencies)==null?void 0:e[0],this.currencyImages=er.state.currencyImages,this.tokenImages=er.state.tokenImages,this.unsubscribe.push($t.subscribeKey("purchaseCurrency",r=>{!r||this.type==="Fiat"||(this.selectedCurrency=this.formatPurchaseCurrency(r))}),$t.subscribeKey("paymentCurrency",r=>{!r||this.type==="Token"||(this.selectedCurrency=this.formatPaymentCurrency(r))}),$t.subscribe(r=>{this.type==="Fiat"?this.currencies=r.purchaseCurrencies.map(this.formatPurchaseCurrency):this.currencies=r.paymentCurrencies.map(this.formatPaymentCurrency)}),er.subscribe(r=>{this.currencyImages={...r.currencyImages},this.tokenImages={...r.tokenImages}}))}firstUpdated(){$t.getAvailableCurrencies()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var n;const e=((n=this.selectedCurrency)==null?void 0:n.symbol)||"",r=this.currencyImages[e]||this.tokenImages[e];return M`<wui-input-text type="number" size="lg" value=${this.value}>
- ${this.selectedCurrency?M` <wui-flex
- class="currency-container"
- justifyContent="space-between"
- alignItems="center"
- gap="xxs"
- @click=${()=>We.open({view:`OnRamp${this.type}Select`})}
- >
- <wui-image src=${we(r)}></wui-image>
- <wui-text color="fg-100">${this.selectedCurrency.symbol}</wui-text>
- </wui-flex>`:M`<wui-loading-spinner></wui-loading-spinner>`}
- </wui-input-text>`}formatPaymentCurrency(e){return{name:e.id,symbol:e.id}}formatPurchaseCurrency(e){return{name:e.name,symbol:e.symbol}}};Mu.styles=c8e;Op([q({type:String})],Mu.prototype,"type",void 0);Op([q({type:Number})],Mu.prototype,"value",void 0);Op([G()],Mu.prototype,"currencies",void 0);Op([G()],Mu.prototype,"selectedCurrency",void 0);Op([G()],Mu.prototype,"currencyImages",void 0);Op([G()],Mu.prototype,"tokenImages",void 0);Mu=Op([te("w3m-onramp-input")],Mu);const u8e=de`
- :host > wui-flex {
- width: 100%;
- max-width: 360px;
- }
- :host > wui-flex > wui-flex {
- border-radius: var(--wui-border-radius-l);
- width: 100%;
- }
- .amounts-container {
- width: 100%;
- }
- `;var Fd=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const l8e={USD:"$",EUR:"€",GBP:"£"},d8e=[100,250,500,1e3];let Qo=class extends se{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.caipAddress=F.state.activeCaipAddress,this.loading=We.state.loading,this.paymentCurrency=$t.state.paymentCurrency,this.paymentAmount=$t.state.paymentAmount,this.purchaseAmount=$t.state.purchaseAmount,this.quoteLoading=$t.state.quotesLoading,this.unsubscribe.push(F.subscribeKey("activeCaipAddress",e=>this.caipAddress=e),We.subscribeKey("loading",e=>{this.loading=e}),$t.subscribe(e=>{this.paymentCurrency=e.paymentCurrency,this.paymentAmount=e.paymentAmount,this.purchaseAmount=e.purchaseAmount,this.quoteLoading=e.quotesLoading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return M`
- <wui-flex flexDirection="column" justifyContent="center" alignItems="center">
- <wui-flex flexDirection="column" alignItems="center" gap="xs">
- <w3m-onramp-input
- type="Fiat"
- @inputChange=${this.onPaymentAmountChange.bind(this)}
- .value=${this.paymentAmount||0}
- ></w3m-onramp-input>
- <w3m-onramp-input
- type="Token"
- .value=${this.purchaseAmount||0}
- .loading=${this.quoteLoading}
- ></w3m-onramp-input>
- <wui-flex justifyContent="space-evenly" class="amounts-container" gap="xs">
- ${d8e.map(e=>{var r;return M`<wui-button
- variant=${this.paymentAmount===e?"accent":"neutral"}
- size="md"
- textVariant="paragraph-600"
- fullWidth
- @click=${()=>this.selectPresetAmount(e)}
- >${`${l8e[((r=this.paymentCurrency)==null?void 0:r.id)||"USD"]} ${e}`}</wui-button
- >`})}
- </wui-flex>
- ${this.templateButton()}
- </wui-flex>
- </wui-flex>
- `}templateButton(){return this.caipAddress?M`<wui-button
- @click=${this.getQuotes.bind(this)}
- variant="main"
- fullWidth
- size="lg"
- borderRadius="xs"
- >
- Get quotes
- </wui-button>`:M`<wui-button
- @click=${this.openModal.bind(this)}
- variant="accent"
- fullWidth
- size="lg"
- borderRadius="xs"
- >
- Connect wallet
- </wui-button>`}getQuotes(){this.loading||We.open({view:"OnRampProviders"})}openModal(){We.open({view:"Connect"})}async onPaymentAmountChange(e){$t.setPaymentAmount(Number(e.detail)),await $t.getQuote()}async selectPresetAmount(e){$t.setPaymentAmount(e),await $t.getQuote()}};Qo.styles=u8e;Fd([q({type:Boolean})],Qo.prototype,"disabled",void 0);Fd([G()],Qo.prototype,"caipAddress",void 0);Fd([G()],Qo.prototype,"loading",void 0);Fd([G()],Qo.prototype,"paymentCurrency",void 0);Fd([G()],Qo.prototype,"paymentAmount",void 0);Fd([G()],Qo.prototype,"purchaseAmount",void 0);Fd([G()],Qo.prototype,"quoteLoading",void 0);Qo=Fd([te("w3m-onramp-widget")],Qo);const h8e=Object.freeze(Object.defineProperty({__proto__:null,get W3mBuyInProgressView(){return Ji},get W3mOnRampActivityView(){return Sd},get W3mOnRampProvidersView(){return h6},get W3mOnrampFiatSelectView(){return Td},get W3mOnrampTokensView(){return Id},get W3mOnrampWidget(){return Qo},get W3mWhatIsABuyView(){return LP}},Symbol.toStringTag,{value:"Module"}));var UP;(function(t){t.approve="approved",t.bought="bought",t.borrow="borrowed",t.burn="burnt",t.cancel="canceled",t.claim="claimed",t.deploy="deployed",t.deposit="deposited",t.execute="executed",t.mint="minted",t.receive="received",t.repay="repaid",t.send="sent",t.sell="sold",t.stake="staked",t.trade="swapped",t.unstake="unstaked",t.withdraw="withdrawn"})(UP||(UP={}));const f8e=de`
- :host > wui-flex {
- display: flex;
- justify-content: center;
- align-items: center;
- position: relative;
- width: 40px;
- height: 40px;
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
- background-color: var(--wui-color-gray-glass-005);
- }
- :host > wui-flex wui-image {
- display: block;
- }
- :host > wui-flex,
- :host > wui-flex wui-image,
- .swap-images-container,
- .swap-images-container.nft,
- wui-image.nft {
- border-top-left-radius: var(--local-left-border-radius);
- border-top-right-radius: var(--local-right-border-radius);
- border-bottom-left-radius: var(--local-left-border-radius);
- border-bottom-right-radius: var(--local-right-border-radius);
- }
- wui-icon {
- width: 20px;
- height: 20px;
- }
- wui-icon-box {
- position: absolute;
- right: 0;
- bottom: 0;
- transform: translate(20%, 20%);
- }
- .swap-images-container {
- position: relative;
- width: 40px;
- height: 40px;
- overflow: hidden;
- }
- .swap-images-container wui-image:first-child {
- position: absolute;
- width: 40px;
- height: 40px;
- top: 0;
- left: 0%;
- clip-path: inset(0px calc(50% + 2px) 0px 0%);
- }
- .swap-images-container wui-image:last-child {
- clip-path: inset(0px 0px 0px calc(50% + 2px));
- }
- `;var Rp=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Lu=class extends se{constructor(){super(...arguments),this.images=[],this.secondImage={type:void 0,url:""}}render(){const[e,r]=this.images,n=(e==null?void 0:e.type)==="NFT",i=r!=null&&r.url?r.type==="NFT":n,s=n?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)",o=i?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)";return this.style.cssText=`
- --local-left-border-radius: ${s};
- --local-right-border-radius: ${o};
- `,M`<wui-flex> ${this.templateVisual()} ${this.templateIcon()} </wui-flex>`}templateVisual(){const[e,r]=this.images,n=e==null?void 0:e.type;return this.images.length===2&&(e!=null&&e.url||r!=null&&r.url)?M`<div class="swap-images-container">
- ${e!=null&&e.url?M`<wui-image src=${e.url} alt="Transaction image"></wui-image>`:null}
- ${r!=null&&r.url?M`<wui-image src=${r.url} alt="Transaction image"></wui-image>`:null}
- </div>`:e!=null&&e.url?M`<wui-image src=${e.url} alt="Transaction image"></wui-image>`:n==="NFT"?M`<wui-icon size="inherit" color="fg-200" name="nftPlaceholder"></wui-icon>`:M`<wui-icon size="inherit" color="fg-200" name="coinPlaceholder"></wui-icon>`}templateIcon(){let e="accent-100",r;return r=this.getIcon(),this.status&&(e=this.getStatusColor()),r?M`
- <wui-icon-box
- size="xxs"
- iconColor=${e}
- backgroundColor=${e}
- background="opaque"
- icon=${r}
- ?border=${!0}
- borderColor="wui-color-bg-125"
- ></wui-icon-box>
- `:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():this.type==="trade"?"swapHorizontalBold":this.type==="approve"?"checkmark":this.type==="cancel"?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success-100";case"failed":return"error-100";case"pending":return"inverse-100";default:return"accent-100"}}};Lu.styles=[f8e];Rp([q()],Lu.prototype,"type",void 0);Rp([q()],Lu.prototype,"status",void 0);Rp([q()],Lu.prototype,"direction",void 0);Rp([q({type:Boolean})],Lu.prototype,"onlyDirectionIcon",void 0);Rp([q({type:Array})],Lu.prototype,"images",void 0);Rp([q({type:Object})],Lu.prototype,"secondImage",void 0);Lu=Rp([te("wui-transaction-visual")],Lu);const p8e=de`
- :host > wui-flex:first-child {
- align-items: center;
- column-gap: var(--wui-spacing-s);
- padding: 6.5px var(--wui-spacing-xs) 6.5px var(--wui-spacing-xs);
- width: 100%;
- }
- :host > wui-flex:first-child wui-text:nth-child(1) {
- text-transform: capitalize;
- }
- wui-transaction-visual {
- width: 40px;
- height: 40px;
- }
- wui-flex {
- flex: 1;
- }
- :host wui-flex wui-flex {
- overflow: hidden;
- }
- :host .description-container wui-text span {
- word-break: break-all;
- }
- :host .description-container wui-text {
- overflow: hidden;
- }
- :host .description-separator-icon {
- margin: 0px 6px;
- }
- :host wui-text > span {
- overflow: hidden;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 1;
- }
- `;var oa=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Is=class extends se{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[],this.price=[],this.amount=[],this.symbol=[]}render(){return M`
- <wui-flex>
- <wui-transaction-visual
- .status=${this.status}
- direction=${we(this.direction)}
- type=${this.type}
- onlyDirectionIcon=${we(this.onlyDirectionIcon)}
- .images=${this.images}
- ></wui-transaction-visual>
- <wui-flex flexDirection="column" gap="3xs">
- <wui-text variant="paragraph-600" color="fg-100">
- ${UP[this.type]||this.type}
- </wui-text>
- <wui-flex class="description-container">
- ${this.templateDescription()} ${this.templateSecondDescription()}
- </wui-flex>
- </wui-flex>
- <wui-text variant="micro-700" color="fg-300"><span>${this.date}</span></wui-text>
- </wui-flex>
- `}templateDescription(){var r;const e=(r=this.descriptions)==null?void 0:r[0];return e?M`
- <wui-text variant="small-500" color="fg-200">
- <span>${e}</span>
- </wui-text>
- `:null}templateSecondDescription(){var r;const e=(r=this.descriptions)==null?void 0:r[1];return e?M`
- <wui-icon class="description-separator-icon" size="xxs" name="arrowRight"></wui-icon>
- <wui-text variant="small-400" color="fg-200">
- <span>${e}</span>
- </wui-text>
- `:null}};Is.styles=[He,p8e];oa([q()],Is.prototype,"type",void 0);oa([q({type:Array})],Is.prototype,"descriptions",void 0);oa([q()],Is.prototype,"date",void 0);oa([q({type:Boolean})],Is.prototype,"onlyDirectionIcon",void 0);oa([q()],Is.prototype,"status",void 0);oa([q()],Is.prototype,"direction",void 0);oa([q({type:Array})],Is.prototype,"images",void 0);oa([q({type:Array})],Is.prototype,"price",void 0);oa([q({type:Array})],Is.prototype,"amount",void 0);oa([q({type:Array})],Is.prototype,"symbol",void 0);Is=oa([te("wui-transaction-list-item")],Is);const g8e=de`
- :host {
- min-height: 100%;
- }
- .group-container[last-group='true'] {
- padding-bottom: var(--wui-spacing-m);
- }
- .contentContainer {
- height: 280px;
- }
- .contentContainer > wui-icon-box {
- width: 40px;
- height: 40px;
- border-radius: var(--wui-border-radius-xxs);
- }
- .contentContainer > .textContent {
- width: 65%;
- }
- .emptyContainer {
- height: 100%;
- }
- `;var kp=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const O3="last-transaction",m8e=7;let Uu=class extends se{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.page="activity",this.caipAddress=F.state.activeCaipAddress,this.transactionsByYear=Dr.state.transactionsByYear,this.loading=Dr.state.loading,this.empty=Dr.state.empty,this.next=Dr.state.next,Dr.clearCursor(),this.unsubscribe.push(F.subscribeKey("activeCaipAddress",e=>{e&&this.caipAddress!==e&&(Dr.resetTransactions(),Dr.fetchTransactions(e)),this.caipAddress=e}),F.subscribeKey("activeCaipNetwork",()=>{this.updateTransactionView()}),Dr.subscribe(e=>{this.transactionsByYear=e.transactionsByYear,this.loading=e.loading,this.empty=e.empty,this.next=e.next}))}firstUpdated(){this.updateTransactionView(),this.createPaginationObserver()}updated(){this.setPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return M` ${this.empty?null:this.templateTransactionsByYear()}
- ${this.loading?this.templateLoading():null}
- ${!this.loading&&this.empty?this.templateEmpty():null}`}updateTransactionView(){var n;const e=(n=F.state.activeCaipNetwork)==null?void 0:n.caipNetworkId;Dr.state.lastNetworkInView!==e&&(Dr.resetTransactions(),this.caipAddress&&Dr.fetchTransactions(ue.getPlainAddress(this.caipAddress))),Dr.setLastNetworkInView(e)}templateTransactionsByYear(){return Object.keys(this.transactionsByYear).sort().reverse().map(r=>{const n=parseInt(r,10),i=new Array(12).fill(null).map((s,o)=>{var u;const a=Xh.getTransactionGroupTitle(n,o),c=(u=this.transactionsByYear[n])==null?void 0:u[o];return{groupTitle:a,transactions:c}}).filter(({transactions:s})=>s).reverse();return i.map(({groupTitle:s,transactions:o},a)=>{const c=a===i.length-1;return o?M`
- <wui-flex
- flexDirection="column"
- class="group-container"
- last-group="${c?"true":"false"}"
- data-testid="month-indexes"
- >
- <wui-flex
- alignItems="center"
- flexDirection="row"
- .padding=${["xs","s","s","s"]}
- >
- <wui-text variant="paragraph-500" color="fg-200" data-testid="group-title"
- >${s}</wui-text
- >
- </wui-flex>
- <wui-flex flexDirection="column" gap="xs">
- ${this.templateTransactions(o,c)}
- </wui-flex>
- </wui-flex>
- `:null})})}templateRenderTransaction(e,r){const{date:n,descriptions:i,direction:s,isAllNFT:o,images:a,status:c,transfers:u,type:l}=this.getTransactionListItemProps(e),d=(u==null?void 0:u.length)>1;return(u==null?void 0:u.length)===2&&!o?M`
- <wui-transaction-list-item
- date=${n}
- .direction=${s}
- id=${r&&this.next?O3:""}
- status=${c}
- type=${l}
- .images=${a}
- .descriptions=${i}
- ></wui-transaction-list-item>
- `:d?u.map((f,g)=>{const p=Xh.getTransferDescription(f),m=r&&g===u.length-1;return M` <wui-transaction-list-item
- date=${n}
- direction=${f.direction}
- id=${m&&this.next?O3:""}
- status=${c}
- type=${l}
- .onlyDirectionIcon=${!0}
- .images=${[a[g]]}
- .descriptions=${[p]}
- ></wui-transaction-list-item>`}):M`
- <wui-transaction-list-item
- date=${n}
- .direction=${s}
- id=${r&&this.next?O3:""}
- status=${c}
- type=${l}
- .images=${a}
- .descriptions=${i}
- ></wui-transaction-list-item>
- `}templateTransactions(e,r){return e.map((n,i)=>{const s=r&&i===e.length-1;return M`${this.templateRenderTransaction(n,s)}`})}emptyStateActivity(){return M`<wui-flex
- class="emptyContainer"
- flexGrow="1"
- flexDirection="column"
- justifyContent="center"
- alignItems="center"
- .padding=${["3xl","xl","3xl","xl"]}
- gap="xl"
- data-testid="empty-activity-state"
- >
- <wui-icon-box
- backgroundColor="gray-glass-005"
- background="gray"
- iconColor="fg-200"
- icon="wallet"
- size="lg"
- ?border=${!0}
- borderColor="wui-color-bg-125"
- ></wui-icon-box>
- <wui-flex flexDirection="column" alignItems="center" gap="xs">
- <wui-text align="center" variant="paragraph-500" color="fg-100"
- >No Transactions yet</wui-text
- >
- <wui-text align="center" variant="small-500" color="fg-200"
- >Start trading on dApps <br />
- to grow your wallet!</wui-text
- >
- </wui-flex>
- </wui-flex>`}emptyStateAccount(){return M`<wui-flex
- class="contentContainer"
- alignItems="center"
- justifyContent="center"
- flexDirection="column"
- gap="l"
- data-testid="empty-account-state"
- >
- <wui-icon-box
- icon="swapHorizontal"
- size="inherit"
- iconColor="fg-200"
- backgroundColor="fg-200"
- iconSize="lg"
- ></wui-icon-box>
- <wui-flex
- class="textContent"
- gap="xs"
- flexDirection="column"
- justifyContent="center"
- flexDirection="column"
- >
- <wui-text variant="paragraph-500" align="center" color="fg-100">No activity yet</wui-text>
- <wui-text variant="small-400" align="center" color="fg-200"
- >Your next transactions will appear here</wui-text
- >
- </wui-flex>
- <wui-link @click=${this.onReceiveClick.bind(this)}>Trade</wui-link>
- </wui-flex>`}templateEmpty(){return this.page==="account"?M`${this.emptyStateAccount()}`:M`${this.emptyStateActivity()}`}templateLoading(){return this.page==="activity"?Array(m8e).fill(M` <wui-transaction-list-item-loader></wui-transaction-list-item-loader> `).map(e=>e):null}onReceiveClick(){X.push("WalletReceive")}createPaginationObserver(){const e=F.state.activeChain,{projectId:r}=oe.state;this.paginationObserver=new IntersectionObserver(([n])=>{var i;n!=null&&n.isIntersecting&&!this.loading&&(Dr.fetchTransactions(ue.getPlainAddress(this.caipAddress)),Re.sendEvent({type:"track",event:"LOAD_MORE_TRANSACTIONS",properties:{address:ue.getPlainAddress(this.caipAddress),projectId:r,cursor:this.next,isSmartAccount:((i=re.state.preferredAccountTypes)==null?void 0:i[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT}}))},{}),this.setPaginationObserver()}setPaginationObserver(){var r,n,i;(r=this.paginationObserver)==null||r.disconnect();const e=(n=this.shadowRoot)==null?void 0:n.querySelector(`#${O3}`);e&&((i=this.paginationObserver)==null||i.observe(e))}getTransactionListItemProps(e){var c,u,l,d,h;const r=bC.formatDate((c=e==null?void 0:e.metadata)==null?void 0:c.minedAt),n=Xh.getTransactionDescriptions(e),i=e==null?void 0:e.transfers,s=(u=e==null?void 0:e.transfers)==null?void 0:u[0],o=!!s&&((l=e==null?void 0:e.transfers)==null?void 0:l.every(f=>!!f.nft_info)),a=Xh.getTransactionImages(i);return{date:r,direction:s==null?void 0:s.direction,descriptions:n,isAllNFT:o,images:a,status:(d=e.metadata)==null?void 0:d.status,transfers:i,type:(h=e.metadata)==null?void 0:h.operationType}}};Uu.styles=g8e;kp([q()],Uu.prototype,"page",void 0);kp([G()],Uu.prototype,"caipAddress",void 0);kp([G()],Uu.prototype,"transactionsByYear",void 0);kp([G()],Uu.prototype,"loading",void 0);kp([G()],Uu.prototype,"empty",void 0);kp([G()],Uu.prototype,"next",void 0);Uu=kp([te("w3m-activity-list")],Uu);const w8e=de`
- :host > wui-flex:first-child {
- height: 500px;
- overflow-y: auto;
- overflow-x: hidden;
- scrollbar-width: none;
- }
- :host > wui-flex:first-child::-webkit-scrollbar {
- display: none;
- }
- `;var b8e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let f6=class extends se{render(){return M`
- <wui-flex flexDirection="column" .padding=${["0","m","m","m"]} gap="s">
- <w3m-activity-list page="activity"></w3m-activity-list>
- </wui-flex>
- `}};f6.styles=w8e;f6=b8e([te("w3m-transactions-view")],f6);const y8e=Object.freeze(Object.defineProperty({__proto__:null,get W3mTransactionsView(){return f6}},Symbol.toStringTag,{value:"Module"})),v8e=de`
- :host {
- position: relative;
- }
- button {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 48px;
- width: 100%;
- background-color: var(--wui-color-accent-glass-010);
- border-radius: var(--wui-border-radius-xs);
- border: 1px solid var(--wui-color-accent-glass-010);
- transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: background-color;
- }
- wui-tooltip {
- padding: 7px var(--wui-spacing-s) 8px var(--wui-spacing-s);
- position: absolute;
- top: -8px;
- left: 50%;
- transform: translate(-50%, -100%);
- opacity: 0;
- display: none;
- }
- @media (hover: hover) and (pointer: fine) {
- button:hover:enabled {
- background-color: var(--wui-color-accent-glass-015);
- }
- button:active:enabled {
- background-color: var(--wui-color-accent-glass-020);
- }
- }
- `;var V7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Hy=class extends se{constructor(){super(...arguments),this.text="",this.icon="card"}render(){return M`<button>
- <wui-icon color="accent-100" name=${this.icon} size="lg"></wui-icon>
- </button>`}};Hy.styles=[He,vt,v8e];V7([q()],Hy.prototype,"text",void 0);V7([q()],Hy.prototype,"icon",void 0);Hy=V7([te("wui-icon-button")],Hy);const _8e=Se`<svg width="86" height="96" fill="none">
- <path
- d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z"
- />
- </svg>`,eQ=Se`<svg viewBox="0 0 48 54" fill="none">
- <path
- d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z"
- />
- </svg>`,E8e=Se`
- <svg fill="none" viewBox="0 0 36 40">
- <path
- d="M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z"
- />
- </svg>
- `,C8e=de`
- :host {
- position: relative;
- border-radius: inherit;
- display: flex;
- justify-content: center;
- align-items: center;
- width: var(--local-width);
- height: var(--local-height);
- }
- :host([data-round='true']) {
- background: var(--wui-color-gray-glass-002);
- border-radius: 100%;
- outline: 1px solid var(--wui-color-gray-glass-005);
- }
- svg {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 1;
- fill: var(--wui-color-gray-glass-002);
- }
- svg > path {
- stroke: var(--local-stroke);
- }
- wui-image {
- width: 100%;
- height: 100%;
- -webkit-clip-path: var(--local-path);
- clip-path: var(--local-path);
- background: var(--wui-color-gray-glass-002);
- }
- wui-icon {
- transform: translateY(-5%);
- width: var(--local-icon-size);
- height: var(--local-icon-size);
- }
- `;var Np=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Fu=class extends se{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:E8e,md:eQ,lg:_8e},this.selected=!1,this.round=!1}render(){return this.round?(this.dataset.round="true",this.style.cssText=`
- --local-width: var(--wui-spacing-3xl);
- --local-height: var(--wui-spacing-3xl);
- --local-icon-size: var(--wui-spacing-l);
- `):this.style.cssText=`
- --local-path: var(--wui-path-network-${this.size});
- --local-width: var(--wui-width-network-${this.size});
- --local-height: var(--wui-height-network-${this.size});
- --local-icon-size: var(--wui-icon-size-network-${this.size});
- `,M`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?M`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:M`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`}};Fu.styles=[He,C8e];Np([q()],Fu.prototype,"size",void 0);Np([q()],Fu.prototype,"name",void 0);Np([q({type:Object})],Fu.prototype,"networkImagesBySize",void 0);Np([q()],Fu.prototype,"imageSrc",void 0);Np([q({type:Boolean})],Fu.prototype,"selected",void 0);Np([q({type:Boolean})],Fu.prototype,"round",void 0);Fu=Np([te("wui-network-image")],Fu);const A8e=de`
- :host {
- position: relative;
- background-color: var(--wui-color-gray-glass-002);
- display: flex;
- justify-content: center;
- align-items: center;
- width: var(--local-size);
- height: var(--local-size);
- border-radius: inherit;
- border-radius: var(--local-border-radius);
- }
- :host > wui-flex {
- overflow: hidden;
- border-radius: inherit;
- border-radius: var(--local-border-radius);
- }
- :host::after {
- content: '';
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- border-radius: inherit;
- border: 1px solid var(--wui-color-gray-glass-010);
- pointer-events: none;
- }
- :host([name='Extension'])::after {
- border: 1px solid var(--wui-color-accent-glass-010);
- }
- :host([data-wallet-icon='allWallets']) {
- background-color: var(--wui-all-wallets-bg-100);
- }
- :host([data-wallet-icon='allWallets'])::after {
- border: 1px solid var(--wui-color-accent-glass-010);
- }
- wui-icon[data-parent-size='inherit'] {
- width: 75%;
- height: 75%;
- align-items: center;
- }
- wui-icon[data-parent-size='sm'] {
- width: 18px;
- height: 18px;
- }
- wui-icon[data-parent-size='md'] {
- width: 24px;
- height: 24px;
- }
- wui-icon[data-parent-size='lg'] {
- width: 42px;
- height: 42px;
- }
- wui-icon[data-parent-size='full'] {
- width: 100%;
- height: 100%;
- }
- :host > wui-icon-box {
- position: absolute;
- overflow: hidden;
- right: -1px;
- bottom: -2px;
- z-index: 1;
- border: 2px solid var(--wui-color-bg-150, #1e1f1f);
- padding: 1px;
- }
- `;var $p=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Hu=class extends se{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="xxs";return this.size==="lg"?e="m":this.size==="md"?e="xs":e="xxs",this.style.cssText=`
- --local-border-radius: var(--wui-border-radius-${e});
- --local-size: var(--wui-wallet-image-size-${this.size});
- `,this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),M`
- <wui-flex justifyContent="center" alignItems="center"> ${this.templateVisual()} </wui-flex>
- `}templateVisual(){return this.imageSrc?M`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:this.walletIcon?M`<wui-icon
- data-parent-size="md"
- size="md"
- color="inherit"
- name=${this.walletIcon}
- ></wui-icon>`:M`<wui-icon
- data-parent-size=${this.size}
- size="inherit"
- color="inherit"
- name="walletPlaceholder"
- ></wui-icon>`}};Hu.styles=[vt,He,A8e];$p([q()],Hu.prototype,"size",void 0);$p([q()],Hu.prototype,"name",void 0);$p([q()],Hu.prototype,"imageSrc",void 0);$p([q()],Hu.prototype,"walletIcon",void 0);$p([q({type:Boolean})],Hu.prototype,"installed",void 0);$p([q()],Hu.prototype,"badgeSize",void 0);Hu=$p([te("wui-wallet-image")],Hu);const It={INVALID_PAYMENT_CONFIG:"INVALID_PAYMENT_CONFIG",INVALID_RECIPIENT:"INVALID_RECIPIENT",INVALID_ASSET:"INVALID_ASSET",INVALID_AMOUNT:"INVALID_AMOUNT",UNKNOWN_ERROR:"UNKNOWN_ERROR",UNABLE_TO_INITIATE_PAYMENT:"UNABLE_TO_INITIATE_PAYMENT",INVALID_CHAIN_NAMESPACE:"INVALID_CHAIN_NAMESPACE",GENERIC_PAYMENT_ERROR:"GENERIC_PAYMENT_ERROR",UNABLE_TO_GET_EXCHANGES:"UNABLE_TO_GET_EXCHANGES",ASSET_NOT_SUPPORTED:"ASSET_NOT_SUPPORTED",UNABLE_TO_GET_PAY_URL:"UNABLE_TO_GET_PAY_URL",UNABLE_TO_GET_BUY_STATUS:"UNABLE_TO_GET_BUY_STATUS"},X0={[It.INVALID_PAYMENT_CONFIG]:"Invalid payment configuration",[It.INVALID_RECIPIENT]:"Invalid recipient address",[It.INVALID_ASSET]:"Invalid asset specified",[It.INVALID_AMOUNT]:"Invalid payment amount",[It.UNKNOWN_ERROR]:"Unknown payment error occurred",[It.UNABLE_TO_INITIATE_PAYMENT]:"Unable to initiate payment",[It.INVALID_CHAIN_NAMESPACE]:"Invalid chain namespace",[It.GENERIC_PAYMENT_ERROR]:"Unable to process payment",[It.UNABLE_TO_GET_EXCHANGES]:"Unable to get exchanges",[It.ASSET_NOT_SUPPORTED]:"Asset not supported by the selected exchange",[It.UNABLE_TO_GET_PAY_URL]:"Unable to get payment URL",[It.UNABLE_TO_GET_BUY_STATUS]:"Unable to get buy status"};class Qt extends Error{get message(){return X0[this.code]}constructor(e,r){super(X0[e]),this.name="AppKitPayError",this.code=e,this.details=r,Error.captureStackTrace&&Error.captureStackTrace(this,Qt)}}const x8e="https://rpc.walletconnect.org/v1/json-rpc";class S8e extends Error{}function T8e(){const t=oe.getSnapshot().projectId;return`${x8e}?projectId=${t}`}async function G7(t,e){const r=T8e(),s=await(await fetch(r,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:t,params:e}),headers:{"Content-Type":"application/json"}})).json();if(s.error)throw new S8e(s.error.message);return s}async function AD(t){return(await G7("reown_getExchanges",t)).result}async function I8e(t){return(await G7("reown_getExchangePayUrl",t)).result}async function P8e(t){return(await G7("reown_getExchangeBuyStatus",t)).result}const O8e=["eip155"],R8e={eip155:{native:{assetNamespace:"slip44",assetReference:"60"},defaultTokenNamespace:"erc20"},solana:{native:{assetNamespace:"slip44",assetReference:"501"},defaultTokenNamespace:"token"}};function iT(t,e){const{chainNamespace:r,chainId:n}=bs.parseCaipNetworkId(t),i=R8e[r];if(!i)throw new Error(`Unsupported chain namespace for CAIP-19 formatting: ${r}`);let s=i.native.assetNamespace,o=i.native.assetReference;return e!=="native"&&(s=i.defaultTokenNamespace,o=e),`${`${r}:${n}`}/${s}:${o}`}function k8e(t){const{chainNamespace:e}=bs.parseCaipNetworkId(t);return O8e.includes(e)}async function N8e(t){const{paymentAssetNetwork:e,activeCaipNetwork:r,approvedCaipNetworkIds:n,requestedCaipNetworks:i}=t,o=ue.sortRequestedNetworks(n,i).find(u=>u.caipNetworkId===e);if(!o)throw new Qt(It.INVALID_PAYMENT_CONFIG);if(o.caipNetworkId===r.caipNetworkId)return;const a=F.getNetworkProp("supportsAllNetworks",o.chainNamespace);if(!((n==null?void 0:n.includes(o.caipNetworkId))||a))throw new Qt(It.INVALID_PAYMENT_CONFIG);try{await F.switchActiveNetwork(o)}catch(u){throw new Qt(It.GENERIC_PAYMENT_ERROR,u)}}async function $8e(t,e,r){var a;if(e!==_e.CHAIN.EVM)throw new Qt(It.INVALID_CHAIN_NAMESPACE);if(!r.fromAddress)throw new Qt(It.INVALID_PAYMENT_CONFIG,"fromAddress is required for native EVM payments.");const n=typeof r.amount=="string"?parseFloat(r.amount):r.amount;if(isNaN(n))throw new Qt(It.INVALID_PAYMENT_CONFIG);const i=((a=t.metadata)==null?void 0:a.decimals)??18,s=xe.parseUnits(n.toString(),i);if(typeof s!="bigint")throw new Qt(It.GENERIC_PAYMENT_ERROR);return await xe.sendTransaction({chainNamespace:e,to:r.recipient,address:r.fromAddress,value:s,data:"0x"})??void 0}async function j8e(t,e){if(!e.fromAddress)throw new Qt(It.INVALID_PAYMENT_CONFIG,"fromAddress is required for ERC20 EVM payments.");const r=t.asset,n=e.recipient,i=Number(t.metadata.decimals),s=xe.parseUnits(e.amount.toString(),i);if(s===void 0)throw new Qt(It.GENERIC_PAYMENT_ERROR);return await xe.writeContract({fromAddress:e.fromAddress,tokenAddress:r,args:[n,s],method:"transfer",abi:TV.getERC20Abi(r),chainNamespace:_e.CHAIN.EVM})??void 0}const xD=0,sT="unknown",Oe=rr({paymentAsset:{network:"eip155:1",asset:"0x0",metadata:{name:"0x0",symbol:"0x0",decimals:0}},recipient:"0x0",amount:0,isConfigured:!1,error:null,isPaymentInProgress:!1,exchanges:[],isLoading:!1,openInNewTab:!0,redirectUrl:void 0,payWithExchange:void 0,currentPayment:void 0,analyticsSet:!1,paymentId:void 0}),Or={state:Oe,subscribe(t){return ln(Oe,()=>t(Oe))},subscribeKey(t,e){return dn(Oe,t,e)},async handleOpenPay(t){this.resetState(),this.setPaymentConfig(t),this.subscribeEvents(),this.initializeAnalytics(),Oe.isConfigured=!0,Re.sendEvent({type:"track",event:"PAY_MODAL_OPEN",properties:{exchanges:Oe.exchanges,configuration:{network:Oe.paymentAsset.network,asset:Oe.paymentAsset.asset,recipient:Oe.recipient,amount:Oe.amount}}}),await We.open({view:"Pay"})},resetState(){Oe.paymentAsset={network:"eip155:1",asset:"0x0",metadata:{name:"0x0",symbol:"0x0",decimals:0}},Oe.recipient="0x0",Oe.amount=0,Oe.isConfigured=!1,Oe.error=null,Oe.isPaymentInProgress=!1,Oe.isLoading=!1,Oe.currentPayment=void 0},setPaymentConfig(t){if(!t.paymentAsset)throw new Qt(It.INVALID_PAYMENT_CONFIG);try{Oe.paymentAsset=t.paymentAsset,Oe.recipient=t.recipient,Oe.amount=t.amount,Oe.openInNewTab=t.openInNewTab??!0,Oe.redirectUrl=t.redirectUrl,Oe.payWithExchange=t.payWithExchange,Oe.error=null}catch(e){throw new Qt(It.INVALID_PAYMENT_CONFIG,e.message)}},getPaymentAsset(){return Oe.paymentAsset},getExchanges(){return Oe.exchanges},async fetchExchanges(){try{Oe.isLoading=!0;const t=await AD({page:xD,asset:iT(Oe.paymentAsset.network,Oe.paymentAsset.asset),amount:Oe.amount.toString()});Oe.exchanges=t.exchanges.slice(0,2)}catch{throw Fe.showError(X0.UNABLE_TO_GET_EXCHANGES),new Qt(It.UNABLE_TO_GET_EXCHANGES)}finally{Oe.isLoading=!1}},async getAvailableExchanges(t){var e;try{const r=t!=null&&t.asset&&(t!=null&&t.network)?iT(t.network,t.asset):void 0;return await AD({page:(t==null?void 0:t.page)??xD,asset:r,amount:(e=t==null?void 0:t.amount)==null?void 0:e.toString()})}catch{throw new Qt(It.UNABLE_TO_GET_EXCHANGES)}},async getPayUrl(t,e,r=!1){try{const n=Number(e.amount),i=await I8e({exchangeId:t,asset:iT(e.network,e.asset),amount:n.toString(),recipient:`${e.network}:${e.recipient}`});return Re.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:e.network,asset:e.asset,recipient:e.recipient,amount:n},currentPayment:{type:"exchange",exchangeId:t},headless:r}}),r&&(this.initiatePayment(),Re.sendEvent({type:"track",event:"PAY_INITIATED",properties:{paymentId:Oe.paymentId||sT,configuration:{network:e.network,asset:e.asset,recipient:e.recipient,amount:n},currentPayment:{type:"exchange",exchangeId:t}}})),i}catch(n){throw n instanceof Error&&n.message.includes("is not supported")?new Qt(It.ASSET_NOT_SUPPORTED):new Error(n.message)}},async openPayUrl(t,e,r=!1){try{const n=await this.getPayUrl(t.exchangeId,e,r);if(!n)throw new Qt(It.UNABLE_TO_GET_PAY_URL);const s=t.openInNewTab??!0?"_blank":"_self";return ue.openHref(n.url,s),n}catch(n){throw n instanceof Qt?Oe.error=n.message:Oe.error=X0.GENERIC_PAYMENT_ERROR,new Qt(It.UNABLE_TO_GET_PAY_URL)}},subscribeEvents(){Oe.isConfigured||(kt.subscribeProviders(async t=>{const e=F.state.activeChain;kt.getProvider(e)&&await this.handlePayment()}),re.subscribeKey("caipAddress",async t=>{t&&await this.handlePayment()}))},async handlePayment(){Oe.currentPayment={type:"wallet",status:"IN_PROGRESS"};const t=re.state.caipAddress;if(!t)return;const{chainId:e,address:r}=bs.parseCaipAddress(t),n=F.state.activeChain;if(!r||!e||!n||!kt.getProvider(n))return;const s=F.state.activeCaipNetwork;if(s&&!Oe.isPaymentInProgress)try{this.initiatePayment();const o=F.getAllRequestedCaipNetworks(),a=F.getAllApprovedCaipNetworkIds();switch(await N8e({paymentAssetNetwork:Oe.paymentAsset.network,activeCaipNetwork:s,approvedCaipNetworkIds:a,requestedCaipNetworks:o}),await We.open({view:"PayLoading"}),n){case _e.CHAIN.EVM:Oe.paymentAsset.asset==="native"&&(Oe.currentPayment.result=await $8e(Oe.paymentAsset,n,{recipient:Oe.recipient,amount:Oe.amount,fromAddress:r})),Oe.paymentAsset.asset.startsWith("0x")&&(Oe.currentPayment.result=await j8e(Oe.paymentAsset,{recipient:Oe.recipient,amount:Oe.amount,fromAddress:r})),Oe.currentPayment.status="SUCCESS";break;default:throw new Qt(It.INVALID_CHAIN_NAMESPACE)}}catch(o){o instanceof Qt?Oe.error=o.message:Oe.error=X0.GENERIC_PAYMENT_ERROR,Oe.currentPayment.status="FAILED",Fe.showError(Oe.error)}finally{Oe.isPaymentInProgress=!1}},getExchangeById(t){return Oe.exchanges.find(e=>e.id===t)},validatePayConfig(t){const{paymentAsset:e,recipient:r,amount:n}=t;if(!e)throw new Qt(It.INVALID_PAYMENT_CONFIG);if(!r)throw new Qt(It.INVALID_RECIPIENT);if(!e.asset)throw new Qt(It.INVALID_ASSET);if(n==null||n<=0)throw new Qt(It.INVALID_AMOUNT)},handlePayWithWallet(){const t=re.state.caipAddress;if(!t){X.push("Connect");return}const{chainId:e,address:r}=bs.parseCaipAddress(t),n=F.state.activeChain;if(!r||!e||!n){X.push("Connect");return}this.handlePayment()},async handlePayWithExchange(t){try{Oe.currentPayment={type:"exchange",exchangeId:t};const{network:e,asset:r}=Oe.paymentAsset,n={network:e,asset:r,amount:Oe.amount,recipient:Oe.recipient},i=await this.getPayUrl(t,n);if(!i)throw new Qt(It.UNABLE_TO_INITIATE_PAYMENT);return Oe.currentPayment.sessionId=i.sessionId,Oe.currentPayment.status="IN_PROGRESS",Oe.currentPayment.exchangeId=t,this.initiatePayment(),{url:i.url,openInNewTab:Oe.openInNewTab}}catch(e){return e instanceof Qt?Oe.error=e.message:Oe.error=X0.GENERIC_PAYMENT_ERROR,Oe.isPaymentInProgress=!1,Fe.showError(Oe.error),null}},async getBuyStatus(t,e){var r,n;try{const i=await P8e({sessionId:e,exchangeId:t});return(i.status==="SUCCESS"||i.status==="FAILED")&&Re.sendEvent({type:"track",event:i.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{paymentId:Oe.paymentId||sT,configuration:{network:Oe.paymentAsset.network,asset:Oe.paymentAsset.asset,recipient:Oe.recipient,amount:Oe.amount},currentPayment:{type:"exchange",exchangeId:(r=Oe.currentPayment)==null?void 0:r.exchangeId,sessionId:(n=Oe.currentPayment)==null?void 0:n.sessionId,result:i.txHash}}}),i}catch{throw new Qt(It.UNABLE_TO_GET_BUY_STATUS)}},async updateBuyStatus(t,e){try{const r=await this.getBuyStatus(t,e);Oe.currentPayment&&(Oe.currentPayment.status=r.status,Oe.currentPayment.result=r.txHash),(r.status==="SUCCESS"||r.status==="FAILED")&&(Oe.isPaymentInProgress=!1)}catch{throw new Qt(It.UNABLE_TO_GET_BUY_STATUS)}},initiatePayment(){Oe.isPaymentInProgress=!0,Oe.paymentId=crypto.randomUUID()},initializeAnalytics(){Oe.analyticsSet||(Oe.analyticsSet=!0,this.subscribeKey("isPaymentInProgress",t=>{var e;if((e=Oe.currentPayment)!=null&&e.status&&Oe.currentPayment.status!=="UNKNOWN"){const r={IN_PROGRESS:"PAY_INITIATED",SUCCESS:"PAY_SUCCESS",FAILED:"PAY_ERROR"}[Oe.currentPayment.status];Re.sendEvent({type:"track",event:r,properties:{paymentId:Oe.paymentId||sT,configuration:{network:Oe.paymentAsset.network,asset:Oe.paymentAsset.asset,recipient:Oe.recipient,amount:Oe.amount},currentPayment:{type:Oe.currentPayment.type,exchangeId:Oe.currentPayment.exchangeId,sessionId:Oe.currentPayment.sessionId,result:Oe.currentPayment.result}}})}}))}},B8e=de`
- wui-separator {
- margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
- calc(var(--wui-spacing-m) * -1);
- width: calc(100% + var(--wui-spacing-s) * 2);
- }
- .token-display {
- padding: var(--wui-spacing-s) var(--wui-spacing-m);
- border-radius: var(--wui-border-radius-s);
- background-color: var(--wui-color-bg-125);
- margin-top: var(--wui-spacing-s);
- margin-bottom: var(--wui-spacing-s);
- }
- .token-display wui-text {
- text-transform: none;
- }
- wui-loading-spinner {
- padding: var(--wui-spacing-xs);
- }
- `;var Hd=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Xo=class extends se{constructor(){super(),this.unsubscribe=[],this.amount="",this.tokenSymbol="",this.networkName="",this.exchanges=Or.state.exchanges,this.isLoading=Or.state.isLoading,this.loadingExchangeId=null,this.connectedWalletInfo=re.state.connectedWalletInfo,this.initializePaymentDetails(),this.unsubscribe.push(Or.subscribeKey("exchanges",e=>this.exchanges=e)),this.unsubscribe.push(Or.subscribeKey("isLoading",e=>this.isLoading=e)),this.unsubscribe.push(re.subscribe(e=>this.connectedWalletInfo=e.connectedWalletInfo)),Or.fetchExchanges()}get isWalletConnected(){return re.state.status==="connected"}render(){return M`
- <wui-flex flexDirection="column">
- <wui-flex flexDirection="column" .padding=${["0","l","l","l"]} gap="s">
- ${this.renderPaymentHeader()}
- <wui-flex flexDirection="column" gap="s">
- ${this.renderPayWithWallet()} ${this.renderExchangeOptions()}
- </wui-flex>
- </wui-flex>
- </wui-flex>
- `}initializePaymentDetails(){const e=Or.getPaymentAsset();this.networkName=e.network,this.tokenSymbol=e.metadata.symbol,this.amount=Or.state.amount.toString()}renderPayWithWallet(){return k8e(this.networkName)?M`<wui-flex flexDirection="column" gap="s">
- ${this.isWalletConnected?this.renderConnectedView():this.renderDisconnectedView()}
- </wui-flex>
- <wui-separator text="or"></wui-separator>`:M``}renderPaymentHeader(){let e=this.networkName;if(this.networkName){const n=F.getAllRequestedCaipNetworks().find(i=>i.caipNetworkId===this.networkName);n&&(e=n.name)}return M`
- <wui-flex flexDirection="column" alignItems="center">
- <wui-flex alignItems="center" gap="xs">
- <wui-text variant="large-700" color="fg-100">${this.amount||"0.0000"}</wui-text>
- <wui-flex class="token-display" alignItems="center" gap="xxs">
- <wui-text variant="paragraph-600" color="fg-100">
- ${this.tokenSymbol||"Unknown Asset"}
- </wui-text>
- ${e?M`
- <wui-text variant="small-500" color="fg-200"> on ${e} </wui-text>
- `:""}
- </wui-flex>
- </wui-flex>
- </wui-flex>
- `}renderConnectedView(){var r,n,i;const e=((r=this.connectedWalletInfo)==null?void 0:r.name)||"connected wallet";return M`
- <wui-list-item
- @click=${this.onWalletPayment}
- ?chevron=${!0}
- data-testid="wallet-payment-option"
- >
- <wui-flex alignItems="center" gap="s">
- <wui-wallet-image
- size="sm"
- imageSrc=${we((n=this.connectedWalletInfo)==null?void 0:n.icon)}
- name=${we((i=this.connectedWalletInfo)==null?void 0:i.name)}
- ></wui-wallet-image>
- <wui-text variant="paragraph-500" color="inherit">Pay with ${e}</wui-text>
- </wui-flex>
- </wui-list-item>
- <wui-list-item
- variant="icon"
- iconVariant="overlay"
- icon="disconnect"
- @click=${this.onDisconnect}
- data-testid="disconnect-button"
- ?chevron=${!1}
- >
- <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text>
- </wui-list-item>
- `}renderDisconnectedView(){return M`<wui-list-item
- variant="icon"
- iconVariant="overlay"
- icon="walletPlaceholder"
- @click=${this.onWalletPayment}
- ?chevron=${!0}
- data-testid="wallet-payment-option"
- >
- <wui-text variant="paragraph-500" color="inherit">Pay from wallet</wui-text>
- </wui-list-item>`}renderExchangeOptions(){return this.isLoading?M`<wui-flex justifyContent="center" alignItems="center">
- <wui-spinner size="md"></wui-spinner>
- </wui-flex>`:this.exchanges.length===0?M`<wui-flex justifyContent="center" alignItems="center">
- <wui-text variant="paragraph-500" color="fg-100">No exchanges available</wui-text>
- </wui-flex>`:this.exchanges.map(e=>M`
- <wui-list-item
- @click=${()=>this.onExchangePayment(e.id)}
- data-testid="exchange-option-${e.id}"
- ?chevron=${!0}
- ?disabled=${this.loadingExchangeId!==null}
- >
- <wui-flex alignItems="center" gap="s">
- ${this.loadingExchangeId===e.id?M`<wui-loading-spinner color="accent-100" size="md"></wui-loading-spinner>`:M`<wui-wallet-image
- size="sm"
- imageSrc=${we(e.imageUrl)}
- name=${e.name}
- ></wui-wallet-image>`}
- <wui-text flexGrow="1" variant="paragraph-500" color="inherit"
- >Pay with ${e.name} <wui-spinner size="sm" color="fg-200"></wui-spinner
- ></wui-text>
- </wui-flex>
- </wui-list-item>
- `)}onWalletPayment(){Or.handlePayWithWallet()}async onExchangePayment(e){try{this.loadingExchangeId=e;const r=await Or.handlePayWithExchange(e);r&&(await We.open({view:"PayLoading"}),ue.openHref(r.url,r.openInNewTab?"_blank":"_self"))}catch(r){console.error("Failed to pay with exchange",r),Fe.showError("Failed to pay with exchange")}finally{this.loadingExchangeId=null}}async onDisconnect(e){e.stopPropagation();try{await xe.disconnect(),We.close()}catch{console.error("Failed to disconnect"),Fe.showError("Failed to disconnect")}}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}};Xo.styles=B8e;Hd([G()],Xo.prototype,"amount",void 0);Hd([G()],Xo.prototype,"tokenSymbol",void 0);Hd([G()],Xo.prototype,"networkName",void 0);Hd([G()],Xo.prototype,"exchanges",void 0);Hd([G()],Xo.prototype,"isLoading",void 0);Hd([G()],Xo.prototype,"loadingExchangeId",void 0);Hd([G()],Xo.prototype,"connectedWalletInfo",void 0);Xo=Hd([te("w3m-pay-view")],Xo);const D8e=de`
- :host {
- display: block;
- height: 100%;
- width: 100%;
- }
- `;var kA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const M8e=4e3;let op=class extends se{constructor(){super(),this.loadingMessage="",this.subMessage="",this.paymentState="in-progress",this.paymentState=Or.state.isPaymentInProgress?"in-progress":"completed",this.updateMessages(),this.setupSubscription(),this.setupExchangeSubscription()}disconnectedCallback(){clearInterval(this.exchangeSubscription)}render(){return M`
- <wui-flex
- flexDirection="column"
- alignItems="center"
- .padding=${["xl","xl","xl","xl"]}
- gap="xl"
- >
- <wui-flex justifyContent="center" alignItems="center"> ${this.getStateIcon()} </wui-flex>
- <wui-flex flexDirection="column" alignItems="center" gap="xs">
- <wui-text align="center" variant="paragraph-500" color="fg-100">
- ${this.loadingMessage}
- </wui-text>
- <wui-text align="center" variant="small-400" color="fg-200">
- ${this.subMessage}
- </wui-text>
- </wui-flex>
- </wui-flex>
- `}updateMessages(){var e;switch(this.paymentState){case"completed":this.loadingMessage="Payment completed",this.subMessage="Your transaction has been successfully processed";break;case"error":this.loadingMessage="Payment failed",this.subMessage="There was an error processing your transaction";break;case"in-progress":default:((e=Or.state.currentPayment)==null?void 0:e.type)==="exchange"?(this.loadingMessage="Payment initiated",this.subMessage="Please complete the payment on the exchange"):(this.loadingMessage="Awaiting payment confirmation",this.subMessage="Please confirm the payment transaction in your wallet");break}}getStateIcon(){switch(this.paymentState){case"completed":return this.successTemplate();case"error":return this.errorTemplate();case"in-progress":default:return this.loaderTemplate()}}setupExchangeSubscription(){var e;((e=Or.state.currentPayment)==null?void 0:e.type)==="exchange"&&(this.exchangeSubscription=setInterval(async()=>{var i,s,o;const r=(i=Or.state.currentPayment)==null?void 0:i.exchangeId,n=(s=Or.state.currentPayment)==null?void 0:s.sessionId;r&&n&&(await Or.updateBuyStatus(r,n),((o=Or.state.currentPayment)==null?void 0:o.status)==="SUCCESS"&&clearInterval(this.exchangeSubscription))},M8e))}setupSubscription(){Or.subscribeKey("isPaymentInProgress",e=>{var r;!e&&this.paymentState==="in-progress"&&(Or.state.error||!((r=Or.state.currentPayment)!=null&&r.result)?this.paymentState="error":this.paymentState="completed",this.updateMessages(),setTimeout(()=>{xe.state.status!=="disconnected"&&We.close()},3e3))}),Or.subscribeKey("error",e=>{e&&this.paymentState==="in-progress"&&(this.paymentState="error",this.updateMessages())})}loaderTemplate(){const e=ar.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return M`<wui-loading-thumbnail radius=${r*9}></wui-loading-thumbnail>`}successTemplate(){return M`<wui-icon size="xl" color="success-100" name="checkmark"></wui-icon>`}errorTemplate(){return M`<wui-icon size="xl" color="error-100" name="close"></wui-icon>`}};op.styles=D8e;kA([G()],op.prototype,"loadingMessage",void 0);kA([G()],op.prototype,"subMessage",void 0);kA([G()],op.prototype,"paymentState",void 0);op=kA([te("w3m-pay-loading-view")],op);async function L8e(t){return Or.handleOpenPay(t)}function U8e(){return Or.getExchanges()}function F8e(){var t;return(t=Or.state.currentPayment)==null?void 0:t.result}function H8e(){return Or.state.error}function q8e(){return Or.state.isPaymentInProgress}const z8e={network:"eip155:8453",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},W8e={network:"eip155:8453",asset:"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},V8e={network:"eip155:84532",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},G8e=Object.freeze(Object.defineProperty({__proto__:null,get W3mPayLoadingView(){return op},get W3mPayView(){return Xo},baseETH:z8e,baseSepoliaETH:V8e,baseUSDC:W8e,getExchanges:U8e,getIsPaymentInProgress:q8e,getPayError:H8e,getPayResult:F8e,openPay:L8e},Symbol.toStringTag,{value:"Module"})),K8e=de`
- :host {
- display: block;
- }
- button {
- border-radius: var(--wui-border-radius-3xl);
- background: var(--wui-color-gray-glass-002);
- display: flex;
- gap: var(--wui-spacing-xs);
- padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) var(--wui-spacing-3xs)
- var(--wui-spacing-xs);
- border: 1px solid var(--wui-color-gray-glass-005);
- }
- button:disabled {
- background: var(--wui-color-gray-glass-015);
- }
- button:disabled > wui-text {
- color: var(--wui-color-gray-glass-015);
- }
- button:disabled > wui-flex > wui-text {
- color: var(--wui-color-gray-glass-015);
- }
- button:disabled > wui-image,
- button:disabled > wui-flex > wui-avatar {
- filter: grayscale(1);
- }
- button:has(wui-image) {
- padding: var(--wui-spacing-3xs) var(--wui-spacing-3xs) var(--wui-spacing-3xs)
- var(--wui-spacing-xs);
- }
- wui-text {
- color: var(--wui-color-fg-100);
- }
- wui-flex > wui-text {
- color: var(--wui-color-fg-200);
- }
- wui-image,
- wui-icon-box {
- border-radius: var(--wui-border-radius-3xl);
- width: 24px;
- height: 24px;
- box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
- }
- wui-flex {
- border-radius: var(--wui-border-radius-3xl);
- border: 1px solid var(--wui-color-gray-glass-005);
- background: var(--wui-color-gray-glass-005);
- padding: 4px var(--wui-spacing-m) 4px var(--wui-spacing-xxs);
- }
- button.local-no-balance {
- border-radius: 0px;
- border: none;
- background: transparent;
- }
- wui-avatar {
- width: 20px;
- height: 20px;
- box-shadow: 0 0 0 2px var(--wui-color-accent-glass-010);
- }
- @media (max-width: 500px) {
- button {
- gap: 0px;
- padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) !important;
- height: 32px;
- }
- wui-image,
- wui-icon-box,
- button > wui-text {
- visibility: hidden;
- width: 0px;
- height: 0px;
- }
- button {
- border-radius: 0px;
- border: none;
- background: transparent;
- padding: 0px;
- }
- }
- @media (hover: hover) and (pointer: fine) {
- button:hover:enabled > wui-flex > wui-text {
- color: var(--wui-color-fg-175);
- }
- button:active:enabled > wui-flex > wui-text {
- color: var(--wui-color-fg-175);
- }
- }
- `;var aa=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Ps=class extends se{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.loading=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return M`
- <button
- ?disabled=${this.disabled}
- class=${we(this.balance?void 0:"local-no-balance")}
- >
- ${this.balanceTemplate()}
- <wui-flex gap="xxs" alignItems="center">
- <wui-avatar
- .imageSrc=${this.avatarSrc}
- alt=${this.address}
- address=${this.address}
- ></wui-avatar>
- <wui-text variant="paragraph-600" color="inherit">
- ${this.address?nt.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"}):null}
- </wui-text>
- </wui-flex>
- </button>
- `}balanceTemplate(){if(this.isUnsupportedChain)return M` <wui-icon-box
- size="sm"
- iconColor="error-100"
- backgroundColor="error-100"
- icon="warningCircle"
- ></wui-icon-box>
- <wui-text variant="paragraph-600" color="inherit"> Switch Network</wui-text>`;if(this.balance){const e=this.networkSrc?M`<wui-image src=${this.networkSrc}></wui-image>`:M`
- <wui-icon-box
- size="sm"
- iconColor="fg-200"
- backgroundColor="fg-300"
- icon="networkPlaceholder"
- ></wui-icon-box>
- `,r=this.loading?M`<wui-loading-spinner size="md" color="fg-200"></wui-loading-spinner>`:M`<wui-text variant="paragraph-600" color="inherit"> ${this.balance}</wui-text>`;return M`${e} ${r}`}return null}};Ps.styles=[He,vt,K8e];aa([q()],Ps.prototype,"networkSrc",void 0);aa([q()],Ps.prototype,"avatarSrc",void 0);aa([q()],Ps.prototype,"balance",void 0);aa([q({type:Boolean})],Ps.prototype,"isUnsupportedChain",void 0);aa([q({type:Boolean})],Ps.prototype,"disabled",void 0);aa([q({type:Boolean})],Ps.prototype,"loading",void 0);aa([q()],Ps.prototype,"address",void 0);aa([q()],Ps.prototype,"profileName",void 0);aa([q()],Ps.prototype,"charsStart",void 0);aa([q()],Ps.prototype,"charsEnd",void 0);Ps=aa([te("wui-account-button")],Ps);var Oi=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};class Ri extends se{constructor(){var e,r,n,i,s,o;super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.namespace=void 0,this.caipAddress=(e=F.getAccountData(this.namespace))==null?void 0:e.caipAddress,this.balanceVal=(r=F.getAccountData(this.namespace))==null?void 0:r.balance,this.balanceSymbol=(n=F.getAccountData(this.namespace))==null?void 0:n.balanceSymbol,this.profileName=(i=F.getAccountData(this.namespace))==null?void 0:i.profileName,this.profileImage=(s=F.getAccountData(this.namespace))==null?void 0:s.profileImage,this.network=(o=F.getNetworkData(this.namespace))==null?void 0:o.caipNetwork,this.networkImage=pt.getNetworkImage(this.network),this.isSupported=oe.state.allowUnsupportedChain?!0:F.state.activeChain?F.checkIfSupportedNetwork(F.state.activeChain):!0}firstUpdated(){const e=this.namespace;e?this.unsubscribe.push(F.subscribeChainProp("accountState",r=>{this.caipAddress=r==null?void 0:r.caipAddress,this.balanceVal=r==null?void 0:r.balance,this.balanceSymbol=r==null?void 0:r.balanceSymbol,this.profileName=r==null?void 0:r.profileName,this.profileImage=r==null?void 0:r.profileImage},e),F.subscribeChainProp("networkState",r=>{this.network=r==null?void 0:r.caipNetwork,this.isSupported=F.checkIfSupportedNetwork(e,r==null?void 0:r.caipNetwork),this.networkImage=pt.getNetworkImage(r==null?void 0:r.caipNetwork)},e)):this.unsubscribe.push(er.subscribeNetworkImages(()=>{this.networkImage=pt.getNetworkImage(this.network)}),F.subscribeKey("activeCaipAddress",r=>{this.caipAddress=r}),re.subscribeKey("balance",r=>this.balanceVal=r),re.subscribeKey("balanceSymbol",r=>this.balanceSymbol=r),re.subscribeKey("profileName",r=>this.profileName=r),re.subscribeKey("profileImage",r=>this.profileImage=r),F.subscribeKey("activeCaipNetwork",r=>{this.network=r,this.networkImage=pt.getNetworkImage(r),this.isSupported=r!=null&&r.chainNamespace?F.checkIfSupportedNetwork(r==null?void 0:r.chainNamespace):!0,this.fetchNetworkImage(r)}))}updated(){this.fetchNetworkImage(this.network)}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!F.state.activeChain)return null;const e=this.balance==="show",r=typeof this.balanceVal!="string";return M`
- <wui-account-button
- .disabled=${!!this.disabled}
- .isUnsupportedChain=${oe.state.allowUnsupportedChain?!1:!this.isSupported}
- address=${we(ue.getPlainAddress(this.caipAddress))}
- profileName=${we(this.profileName)}
- networkSrc=${we(this.networkImage)}
- avatarSrc=${we(this.profileImage)}
- balance=${e?ue.formatBalance(this.balanceVal,this.balanceSymbol):""}
- @click=${this.onClick.bind(this)}
- data-testid=${`account-button${this.namespace?`-${this.namespace}`:""}`}
- .charsStart=${this.charsStart}
- .charsEnd=${this.charsEnd}
- ?loading=${r}
- >
- </wui-account-button>
- `}onClick(){this.isSupported||oe.state.allowUnsupportedChain?We.open({namespace:this.namespace}):We.open({view:"UnsupportedChain"})}async fetchNetworkImage(e){var r,n;(r=e==null?void 0:e.assets)!=null&&r.imageId&&(this.networkImage=await pt.fetchNetworkImage((n=e==null?void 0:e.assets)==null?void 0:n.imageId))}}Oi([q({type:Boolean})],Ri.prototype,"disabled",void 0);Oi([q()],Ri.prototype,"balance",void 0);Oi([q()],Ri.prototype,"charsStart",void 0);Oi([q()],Ri.prototype,"charsEnd",void 0);Oi([q()],Ri.prototype,"namespace",void 0);Oi([G()],Ri.prototype,"caipAddress",void 0);Oi([G()],Ri.prototype,"balanceVal",void 0);Oi([G()],Ri.prototype,"balanceSymbol",void 0);Oi([G()],Ri.prototype,"profileName",void 0);Oi([G()],Ri.prototype,"profileImage",void 0);Oi([G()],Ri.prototype,"network",void 0);Oi([G()],Ri.prototype,"networkImage",void 0);Oi([G()],Ri.prototype,"isSupported",void 0);let FP=class extends Ri{};FP=Oi([te("w3m-account-button")],FP);let HP=class extends Ri{};HP=Oi([te("appkit-account-button")],HP);const Z8e=de`
- :host {
- display: block;
- width: max-content;
- }
- `;var ca=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};class ho extends se{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.namespace=void 0,this.caipAddress=F.state.activeCaipAddress}firstUpdated(){this.namespace?this.unsubscribe.push(F.subscribeChainProp("accountState",e=>{this.caipAddress=e==null?void 0:e.caipAddress},this.namespace)):this.unsubscribe.push(F.subscribeKey("activeCaipAddress",e=>this.caipAddress=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.caipAddress?M`
- <appkit-account-button
- .disabled=${!!this.disabled}
- balance=${we(this.balance)}
- .charsStart=${we(this.charsStart)}
- .charsEnd=${we(this.charsEnd)}
- namespace=${we(this.namespace)}
- >
- </appkit-account-button>
- `:M`
- <appkit-connect-button
- size=${we(this.size)}
- label=${we(this.label)}
- loadingLabel=${we(this.loadingLabel)}
- namespace=${we(this.namespace)}
- ></appkit-connect-button>
- `}}ho.styles=Z8e;ca([q({type:Boolean})],ho.prototype,"disabled",void 0);ca([q()],ho.prototype,"balance",void 0);ca([q()],ho.prototype,"size",void 0);ca([q()],ho.prototype,"label",void 0);ca([q()],ho.prototype,"loadingLabel",void 0);ca([q()],ho.prototype,"charsStart",void 0);ca([q()],ho.prototype,"charsEnd",void 0);ca([q()],ho.prototype,"namespace",void 0);ca([G()],ho.prototype,"caipAddress",void 0);let qP=class extends ho{};qP=ca([te("w3m-button")],qP);let zP=class extends ho{};zP=ca([te("appkit-button")],zP);const Y8e=de`
- :host {
- position: relative;
- display: block;
- }
- button {
- background: var(--wui-color-accent-100);
- border: 1px solid var(--wui-color-gray-glass-010);
- border-radius: var(--wui-border-radius-m);
- gap: var(--wui-spacing-xs);
- }
- button.loading {
- background: var(--wui-color-gray-glass-010);
- border: 1px solid var(--wui-color-gray-glass-010);
- pointer-events: none;
- }
- button:disabled {
- background-color: var(--wui-color-gray-glass-015);
- border: 1px solid var(--wui-color-gray-glass-010);
- }
- button:disabled > wui-text {
- color: var(--wui-color-gray-glass-015);
- }
- @media (hover: hover) and (pointer: fine) {
- button:hover:enabled {
- background-color: var(--wui-color-accent-090);
- }
- button:active:enabled {
- background-color: var(--wui-color-accent-080);
- }
- }
- button:focus-visible {
- border: 1px solid var(--wui-color-gray-glass-010);
- background-color: var(--wui-color-accent-090);
- -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
- -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
- box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
- }
- button[data-size='sm'] {
- padding: 6.75px 10px 7.25px;
- }
- ::slotted(*) {
- transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: opacity;
- opacity: var(--local-opacity-100);
- }
- button > wui-text {
- transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: opacity;
- opacity: var(--local-opacity-100);
- color: var(--wui-color-inverse-100);
- }
- button[data-size='md'] {
- padding: 9px var(--wui-spacing-l) 9px var(--wui-spacing-l);
- }
- button[data-size='md'] + wui-text {
- padding-left: var(--wui-spacing-3xs);
- }
- @media (max-width: 500px) {
- button[data-size='md'] {
- height: 32px;
- padding: 5px 12px;
- }
- button[data-size='md'] > wui-text > slot {
- font-size: 14px !important;
- }
- }
- wui-loading-spinner {
- width: 14px;
- height: 14px;
- }
- wui-loading-spinner::slotted(svg) {
- width: 10px !important;
- height: 10px !important;
- }
- button[data-size='sm'] > wui-loading-spinner {
- width: 12px;
- height: 12px;
- }
- `;var K7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let qy=class extends se{constructor(){super(...arguments),this.size="md",this.loading=!1}render(){const e=this.size==="md"?"paragraph-600":"small-600";return M`
- <button data-size=${this.size} ?disabled=${this.loading}>
- ${this.loadingTemplate()}
- <wui-text variant=${e} color=${this.loading?"accent-100":"inherit"}>
- <slot></slot>
- </wui-text>
- </button>
- `}loadingTemplate(){return this.loading?M`<wui-loading-spinner size=${this.size} color="accent-100"></wui-loading-spinner>`:null}};qy.styles=[He,vt,Y8e];K7([q()],qy.prototype,"size",void 0);K7([q({type:Boolean})],qy.prototype,"loading",void 0);qy=K7([te("wui-connect-button")],qy);var qd=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};class zd extends se{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=We.state.open,this.loading=this.namespace?We.state.loadingNamespaceMap.get(this.namespace):We.state.loading,this.unsubscribe.push(We.subscribe(e=>{this.open=e.open,this.loading=this.namespace?e.loadingNamespaceMap.get(this.namespace):e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return M`
- <wui-connect-button
- size=${we(this.size)}
- .loading=${this.loading}
- @click=${this.onClick.bind(this)}
- data-testid=${`connect-button${this.namespace?`-${this.namespace}`:""}`}
- >
- ${this.loading?this.loadingLabel:this.label}
- </wui-connect-button>
- `}onClick(){this.open?We.close():this.loading||We.open({view:"Connect",namespace:this.namespace})}}qd([q()],zd.prototype,"size",void 0);qd([q()],zd.prototype,"label",void 0);qd([q()],zd.prototype,"loadingLabel",void 0);qd([q()],zd.prototype,"namespace",void 0);qd([G()],zd.prototype,"open",void 0);qd([G()],zd.prototype,"loading",void 0);let WP=class extends zd{};WP=qd([te("w3m-connect-button")],WP);let VP=class extends zd{};VP=qd([te("appkit-connect-button")],VP);const J8e=de`
- :host {
- display: block;
- }
- button {
- border-radius: var(--wui-border-radius-3xl);
- display: flex;
- gap: var(--wui-spacing-xs);
- padding: var(--wui-spacing-2xs) var(--wui-spacing-s) var(--wui-spacing-2xs)
- var(--wui-spacing-xs);
- border: 1px solid var(--wui-color-gray-glass-010);
- background-color: var(--wui-color-gray-glass-005);
- color: var(--wui-color-fg-100);
- }
- button:disabled {
- border: 1px solid var(--wui-color-gray-glass-005);
- background-color: var(--wui-color-gray-glass-015);
- color: var(--wui-color-gray-glass-015);
- }
- @media (hover: hover) and (pointer: fine) {
- button:hover:enabled {
- background-color: var(--wui-color-gray-glass-010);
- }
- button:active:enabled {
- background-color: var(--wui-color-gray-glass-015);
- }
- }
- wui-image,
- wui-icon-box {
- border-radius: var(--wui-border-radius-3xl);
- width: 24px;
- height: 24px;
- box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
- }
- `;var NA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Dm=class extends se{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1}render(){return M`
- <button data-testid="wui-network-button" ?disabled=${this.disabled}>
- ${this.visualTemplate()}
- <wui-text variant="paragraph-600" color="inherit">
- <slot></slot>
- </wui-text>
- </button>
- `}visualTemplate(){return this.isUnsupportedChain?M`
- <wui-icon-box
- size="sm"
- iconColor="error-100"
- backgroundColor="error-100"
- icon="warningCircle"
- ></wui-icon-box>
- `:this.imageSrc?M`<wui-image src=${this.imageSrc}></wui-image>`:M`
- <wui-icon-box
- size="sm"
- iconColor="inverse-100"
- backgroundColor="fg-100"
- icon="networkPlaceholder"
- ></wui-icon-box>
- `}};Dm.styles=[He,vt,J8e];NA([q()],Dm.prototype,"imageSrc",void 0);NA([q({type:Boolean})],Dm.prototype,"isUnsupportedChain",void 0);NA([q({type:Boolean})],Dm.prototype,"disabled",void 0);Dm=NA([te("wui-network-button")],Dm);const Q8e=de`
- :host {
- display: block;
- width: max-content;
- }
- `;var Qu=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};class dc extends se{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=F.state.activeCaipNetwork,this.networkImage=pt.getNetworkImage(this.network),this.caipAddress=F.state.activeCaipAddress,this.loading=We.state.loading,this.isSupported=oe.state.allowUnsupportedChain?!0:F.state.activeChain?F.checkIfSupportedNetwork(F.state.activeChain):!0,this.unsubscribe.push(er.subscribeNetworkImages(()=>{this.networkImage=pt.getNetworkImage(this.network)}),F.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),F.subscribeKey("activeCaipNetwork",e=>{var r;this.network=e,this.networkImage=pt.getNetworkImage(e),this.isSupported=e!=null&&e.chainNamespace?F.checkIfSupportedNetwork(e.chainNamespace):!0,pt.fetchNetworkImage((r=e==null?void 0:e.assets)==null?void 0:r.imageId)}),We.subscribeKey("loading",e=>this.loading=e))}firstUpdated(){var e,r;pt.fetchNetworkImage((r=(e=this.network)==null?void 0:e.assets)==null?void 0:r.imageId)}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.network?F.checkIfSupportedNetwork(this.network.chainNamespace):!0;return M`
- <wui-network-button
- .disabled=${!!(this.disabled||this.loading)}
- .isUnsupportedChain=${oe.state.allowUnsupportedChain?!1:!e}
- imageSrc=${we(this.networkImage)}
- @click=${this.onClick.bind(this)}
- data-testid="w3m-network-button"
- >
- ${this.getLabel()}
- <slot></slot>
- </wui-network-button>
- `}getLabel(){return this.network?!this.isSupported&&!oe.state.allowUnsupportedChain?"Switch Network":this.network.name:this.label?this.label:this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(Re.sendEvent({type:"track",event:"CLICK_NETWORKS"}),We.open({view:"Networks"}))}}dc.styles=Q8e;Qu([q({type:Boolean})],dc.prototype,"disabled",void 0);Qu([q({type:String})],dc.prototype,"label",void 0);Qu([G()],dc.prototype,"network",void 0);Qu([G()],dc.prototype,"networkImage",void 0);Qu([G()],dc.prototype,"caipAddress",void 0);Qu([G()],dc.prototype,"loading",void 0);Qu([G()],dc.prototype,"isSupported",void 0);let GP=class extends dc{};GP=Qu([te("w3m-network-button")],GP);let KP=class extends dc{};KP=Qu([te("appkit-network-button")],KP);const X8e=de`
- :host {
- --prev-height: 0px;
- --new-height: 0px;
- display: block;
- }
- div.w3m-router-container {
- transform: translateY(0);
- opacity: 1;
- }
- div.w3m-router-container[view-direction='prev'] {
- animation:
- slide-left-out 150ms forwards ease,
- slide-left-in 150ms forwards ease;
- animation-delay: 0ms, 200ms;
- }
- div.w3m-router-container[view-direction='next'] {
- animation:
- slide-right-out 150ms forwards ease,
- slide-right-in 150ms forwards ease;
- animation-delay: 0ms, 200ms;
- }
- @keyframes slide-left-out {
- from {
- transform: translateX(0px);
- opacity: 1;
- }
- to {
- transform: translateX(10px);
- opacity: 0;
- }
- }
- @keyframes slide-left-in {
- from {
- transform: translateX(-10px);
- opacity: 0;
- }
- to {
- transform: translateX(0);
- opacity: 1;
- }
- }
- @keyframes slide-right-out {
- from {
- transform: translateX(0px);
- opacity: 1;
- }
- to {
- transform: translateX(-10px);
- opacity: 0;
- }
- }
- @keyframes slide-right-in {
- from {
- transform: translateX(10px);
- opacity: 0;
- }
- to {
- transform: translateX(0);
- opacity: 1;
- }
- }
- `;var Z7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Mm=class extends se{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=X.state.view,this.viewDirection="",this.unsubscribe.push(X.subscribeKey("view",e=>this.onViewChange(e)))}firstUpdated(){var e;this.resizeObserver=new ResizeObserver(([r])=>{const n=`${r==null?void 0:r.contentRect.height}px`;this.prevHeight!=="0px"&&(this.style.setProperty("--prev-height",this.prevHeight),this.style.setProperty("--new-height",n),this.style.animation="w3m-view-height 150ms forwards ease",this.style.height="auto"),setTimeout(()=>{this.prevHeight=n,this.style.animation="unset"},Fo.ANIMATION_DURATIONS.ModalHeight)}),(e=this.resizeObserver)==null||e.observe(this.getWrapper())}disconnectedCallback(){var e;(e=this.resizeObserver)==null||e.unobserve(this.getWrapper()),this.unsubscribe.forEach(r=>r())}render(){return M`<div class="w3m-router-container" view-direction="${this.viewDirection}">
- ${this.viewTemplate()}
- </div>`}viewTemplate(){switch(this.view){case"AccountSettings":return M`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return M`<w3m-account-view></w3m-account-view>`;case"AllWallets":return M`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return M`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return M`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return M`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":return M`<w3m-connect-view></w3m-connect-view>`;case"Create":return M`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return M`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return M`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;case"ConnectingExternal":return M`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return M`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return M`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return M`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return M`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"Downloads":return M`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return M`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return M`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return M`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return M`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return M`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return M`<w3m-network-switch-view></w3m-network-switch-view>`;case"Profile":return M`<w3m-profile-view></w3m-profile-view>`;case"SwitchAddress":return M`<w3m-switch-address-view></w3m-switch-address-view>`;case"Transactions":return M`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return M`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampActivity":return M`<w3m-onramp-activity-view></w3m-onramp-activity-view>`;case"OnRampTokenSelect":return M`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return M`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return M`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return M`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return M`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return M`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return M`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return M`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return M`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return M`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return M`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return M`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return M`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WhatIsABuy":return M`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return M`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return M`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return M`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return M`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return M`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return M`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return M`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return M`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return M`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return M`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return M`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return M`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return M`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return M`<w3m-pay-loading-view></w3m-pay-loading-view>`;default:return M`<w3m-connect-view></w3m-connect-view>`}}onViewChange(e){_s.hide();let r=Fo.VIEW_DIRECTION.Next;const{history:n}=X.state;n.length<this.prevHistoryLength&&(r=Fo.VIEW_DIRECTION.Prev),this.prevHistoryLength=n.length,this.viewDirection=r,setTimeout(()=>{this.view=e},Fo.ANIMATION_DURATIONS.ViewTransition)}getWrapper(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("div")}};Mm.styles=X8e;Z7([G()],Mm.prototype,"view",void 0);Z7([G()],Mm.prototype,"viewDirection",void 0);Mm=Z7([te("w3m-router")],Mm);const eSe=de`
- :host {
- display: block;
- }
- button {
- width: 100%;
- display: block;
- padding-top: var(--wui-spacing-l);
- padding-bottom: var(--wui-spacing-l);
- padding-left: var(--wui-spacing-s);
- padding-right: var(--wui-spacing-2l);
- border-radius: var(--wui-border-radius-s);
- background-color: var(--wui-color-accent-glass-010);
- }
- button:hover {
- background-color: var(--wui-color-accent-glass-015) !important;
- }
- button:active {
- background-color: var(--wui-color-accent-glass-020) !important;
- }
- `;var $A=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Lm=class extends se{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return M`
- <button>
- <wui-flex gap="m" alignItems="center" justifyContent="space-between">
- <wui-icon-box
- size="lg"
- iconcolor="accent-100"
- backgroundcolor="accent-100"
- icon=${this.icon}
- background="transparent"
- ></wui-icon-box>
- <wui-flex flexDirection="column" gap="3xs">
- <wui-text variant="paragraph-500" color="fg-100">${this.label}</wui-text>
- <wui-text variant="small-400" color="fg-200">${this.description}</wui-text>
- </wui-flex>
- <wui-icon size="md" color="fg-200" name="chevronRight"></wui-icon>
- </wui-flex>
- </button>
- `}};Lm.styles=[He,vt,eSe];$A([q()],Lm.prototype,"label",void 0);$A([q()],Lm.prototype,"description",void 0);$A([q()],Lm.prototype,"icon",void 0);Lm=$A([te("wui-notice-card")],Lm);var tQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let ZP=class extends se{constructor(){super(),this.unsubscribe=[],this.socialProvider=Le.getConnectedSocialProvider(),this.socialUsername=Le.getConnectedSocialUsername(),this.namespace=F.state.activeChain,this.unsubscribe.push(F.subscribeKey("activeChain",e=>{this.namespace=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=ge.getConnectorId(this.namespace),r=ge.getAuthConnector();if(!r||e!==_e.CONNECTOR_ID.AUTH)return this.style.cssText="display: none",null;const n=r.provider.getEmail()??"";return!n&&!this.socialUsername?(this.style.cssText="display: none",null):M`
- <wui-list-item
- variant="icon"
- iconVariant="overlay"
- icon=${this.socialProvider??"mail"}
- iconSize=${this.socialProvider?"xxl":"sm"}
- data-testid="w3m-account-email-update"
- ?chevron=${!this.socialProvider}
- @click=${()=>{this.onGoToUpdateEmail(n,this.socialProvider)}}
- >
- <wui-text variant="paragraph-500" color="fg-100">${this.getAuthName(n)}</wui-text>
- </wui-list-item>
- `}onGoToUpdateEmail(e,r){r||X.push("UpdateEmailWallet",{email:e,redirectView:"Account"})}getAuthName(e){return this.socialUsername?this.socialProvider==="discord"&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:e.length>30?`${e.slice(0,-3)}...`:e}};tQ([G()],ZP.prototype,"namespace",void 0);ZP=tQ([te("w3m-account-auth-button")],ZP);var hc=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let oo=class extends se{constructor(){super(),this.usubscribe=[],this.networkImages=er.state.networkImages,this.address=re.state.address,this.profileImage=re.state.profileImage,this.profileName=re.state.profileName,this.network=F.state.activeCaipNetwork,this.preferredAccountTypes=re.state.preferredAccountTypes,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.usubscribe.push(re.subscribe(e=>{e.address&&(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.preferredAccountTypes=e.preferredAccountTypes)}),re.subscribeKey("preferredAccountTypes",e=>this.preferredAccountTypes=e),F.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){var r,n,i;if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const e=this.networkImages[((n=(r=this.network)==null?void 0:r.assets)==null?void 0:n.imageId)??""];return M`
- <wui-flex
- flexDirection="column"
- alignItems="center"
- gap="l"
- .padding=${["0","xl","m","xl"]}
- >
- <wui-avatar
- alt=${this.address}
- address=${this.address}
- imageSrc=${we(this.profileImage)}
- size="2lg"
- ></wui-avatar>
- <wui-flex flexDirection="column" alignItems="center">
- <wui-flex gap="3xs" alignItems="center" justifyContent="center">
- <wui-text variant="title-6-600" color="fg-100" data-testid="account-settings-address">
- ${nt.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
- </wui-text>
- <wui-icon-link
- size="md"
- icon="copy"
- iconColor="fg-200"
- @click=${this.onCopyAddress}
- ></wui-icon-link>
- </wui-flex>
- </wui-flex>
- </wui-flex>
- <wui-flex flexDirection="column" gap="m">
- <wui-flex flexDirection="column" gap="xs" .padding=${["0","l","m","l"]}>
- ${this.authCardTemplate()}
- <w3m-account-auth-button></w3m-account-auth-button>
- <wui-list-item
- .variant=${e?"image":"icon"}
- iconVariant="overlay"
- icon="networkPlaceholder"
- imageSrc=${we(e)}
- ?chevron=${this.isAllowedNetworkSwitch()}
- @click=${this.onNetworks.bind(this)}
- data-testid="account-switch-network-button"
- >
- <wui-text variant="paragraph-500" color="fg-100">
- ${((i=this.network)==null?void 0:i.name)??"Unknown"}
- </wui-text>
- </wui-list-item>
- ${this.togglePreferredAccountBtnTemplate()} ${this.chooseNameButtonTemplate()}
- <wui-list-item
- variant="icon"
- iconVariant="overlay"
- icon="disconnect"
- ?chevron=${!1}
- .loading=${this.disconnecting}
- @click=${this.onDisconnect.bind(this)}
- data-testid="disconnect-button"
- >
- <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text>
- </wui-list-item>
- </wui-flex>
- </wui-flex>
- `}chooseNameButtonTemplate(){var s;const e=(s=this.network)==null?void 0:s.chainNamespace,r=ge.getConnectorId(e),n=ge.getAuthConnector();return!F.checkIfNamesSupported()||!n||r!==_e.CONNECTOR_ID.AUTH||this.profileName?null:M`
- <wui-list-item
- variant="icon"
- iconVariant="overlay"
- icon="id"
- iconSize="sm"
- ?chevron=${!0}
- @click=${this.onChooseName.bind(this)}
- data-testid="account-choose-name-button"
- >
- <wui-text variant="paragraph-500" color="fg-100">Choose account name </wui-text>
- </wui-list-item>
- `}authCardTemplate(){var s;const e=(s=this.network)==null?void 0:s.chainNamespace,r=ge.getConnectorId(e),n=ge.getAuthConnector(),{origin:i}=location;return!n||r!==_e.CONNECTOR_ID.AUTH||i.includes(ct.SECURE_SITE)?null:M`
- <wui-notice-card
- @click=${this.onGoToUpgradeView.bind(this)}
- label="Upgrade your wallet"
- description="Transition to a self-custodial wallet"
- icon="wallet"
- data-testid="w3m-wallet-upgrade-card"
- ></wui-notice-card>
- `}isAllowedNetworkSwitch(){const e=F.getAllRequestedCaipNetworks(),r=e?e.length>1:!1,n=e==null?void 0:e.find(({id:i})=>{var s;return i===((s=this.network)==null?void 0:s.id)});return r||!n}onCopyAddress(){try{this.address&&(ue.copyToClopboard(this.address),Fe.showSuccess("Address copied"))}catch{Fe.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){var s,o;const e=(s=this.network)==null?void 0:s.chainNamespace,r=F.checkIfSmartAccountEnabled(),n=ge.getConnectorId(e);return!ge.getAuthConnector()||n!==_e.CONNECTOR_ID.AUTH||!r?null:(this.switched||(this.text=((o=this.preferredAccountTypes)==null?void 0:o[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account"),M`
- <wui-list-item
- variant="icon"
- iconVariant="overlay"
- icon="swapHorizontalBold"
- iconSize="sm"
- ?chevron=${!0}
- ?loading=${this.loading}
- @click=${this.changePreferredAccountType.bind(this)}
- data-testid="account-toggle-preferred-account-type"
- >
- <wui-text variant="paragraph-500" color="fg-100">${this.text}</wui-text>
- </wui-list-item>
- `)}onChooseName(){X.push("ChooseAccountName")}async changePreferredAccountType(){var s,o;const e=(s=this.network)==null?void 0:s.chainNamespace,r=F.checkIfSmartAccountEnabled(),n=((o=this.preferredAccountTypes)==null?void 0:o[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT||!r?bt.ACCOUNT_TYPES.EOA:bt.ACCOUNT_TYPES.SMART_ACCOUNT;ge.getAuthConnector()&&(this.loading=!0,await xe.setPreferredAccountType(n,e),this.text=n===bt.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account",this.switched=!0,Qe.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&X.push("Networks")}async onDisconnect(){try{this.disconnecting=!0,await xe.disconnect(),We.close()}catch{Re.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),Fe.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){Re.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),X.push("UpgradeEmailWallet")}};hc([G()],oo.prototype,"address",void 0);hc([G()],oo.prototype,"profileImage",void 0);hc([G()],oo.prototype,"profileName",void 0);hc([G()],oo.prototype,"network",void 0);hc([G()],oo.prototype,"preferredAccountTypes",void 0);hc([G()],oo.prototype,"disconnecting",void 0);hc([G()],oo.prototype,"loading",void 0);hc([G()],oo.prototype,"switched",void 0);hc([G()],oo.prototype,"text",void 0);oo=hc([te("w3m-account-settings-view")],oo);const tSe=de`
- button {
- background-color: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-3xl);
- border: 1px solid var(--wui-color-gray-glass-002);
- padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs);
- position: relative;
- }
- wui-avatar {
- width: 32px;
- height: 32px;
- box-shadow: 0 0 0 0;
- outline: 3px solid var(--wui-color-gray-glass-005);
- }
- wui-icon-box,
- wui-image {
- width: 16px;
- height: 16px;
- border-radius: var(--wui-border-radius-3xl);
- position: absolute;
- left: 26px;
- top: 24px;
- }
- wui-image {
- outline: 2px solid var(--wui-color-bg-125);
- }
- wui-icon-box {
- outline: 2px solid var(--wui-color-bg-200);
- background-color: var(--wui-color-bg-250);
- }
- `;var jp=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let qu=class extends se{constructor(){super(...arguments),this.avatarSrc=void 0,this.profileName="",this.address="",this.icon="mail"}render(){const e=F.state.activeChain,n=ge.getConnectorId(e)===_e.CONNECTOR_ID.AUTH;return M`<button data-testid="wui-profile-button" @click=${this.handleClick}>
- <wui-flex gap="xs" alignItems="center">
- <wui-avatar
- .imageSrc=${this.avatarSrc}
- alt=${this.address}
- address=${this.address}
- ></wui-avatar>
- ${n?this.getIconTemplate(this.icon):""}
- <wui-flex gap="xs" alignItems="center">
- <wui-text variant="large-600" color="fg-100">
- ${nt.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
- </wui-text>
- <wui-icon size="sm" color="fg-200" name="copy" id="copy-address"></wui-icon>
- </wui-flex>
- </wui-flex>
- </button>`}handleClick(e){var r,n;if(e.target instanceof HTMLElement&&e.target.id==="copy-address"){(r=this.onCopyClick)==null||r.call(this,e);return}(n=this.onProfileClick)==null||n.call(this,e)}getIconTemplate(e){return M`
- <wui-icon-box
- size="xxs"
- iconColor="fg-200"
- backgroundColor="bg-100"
- icon="${e||"networkPlaceholder"}"
- ></wui-icon-box>
- `}};qu.styles=[He,vt,tSe];jp([q()],qu.prototype,"avatarSrc",void 0);jp([q()],qu.prototype,"profileName",void 0);jp([q()],qu.prototype,"address",void 0);jp([q()],qu.prototype,"icon",void 0);jp([q()],qu.prototype,"onProfileClick",void 0);jp([q()],qu.prototype,"onCopyClick",void 0);qu=jp([te("wui-profile-button-v2")],qu);const rSe=de`
- :host {
- display: inline-flex;
- background-color: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-3xl);
- padding: var(--wui-spacing-3xs);
- position: relative;
- height: 36px;
- min-height: 36px;
- overflow: hidden;
- }
- :host::before {
- content: '';
- position: absolute;
- pointer-events: none;
- top: 4px;
- left: 4px;
- display: block;
- width: var(--local-tab-width);
- height: 28px;
- border-radius: var(--wui-border-radius-3xl);
- background-color: var(--wui-color-gray-glass-002);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
- transform: translateX(calc(var(--local-tab) * var(--local-tab-width)));
- transition: transform var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: background-color, opacity;
- }
- :host([data-type='flex'])::before {
- left: 3px;
- transform: translateX(calc((var(--local-tab) * 34px) + (var(--local-tab) * 4px)));
- }
- :host([data-type='flex']) {
- display: flex;
- padding: 0px 0px 0px 12px;
- gap: 4px;
- }
- :host([data-type='flex']) > button > wui-text {
- position: absolute;
- left: 18px;
- opacity: 0;
- }
- button[data-active='true'] > wui-icon,
- button[data-active='true'] > wui-text {
- color: var(--wui-color-fg-100);
- }
- button[data-active='false'] > wui-icon,
- button[data-active='false'] > wui-text {
- color: var(--wui-color-fg-200);
- }
- button[data-active='true']:disabled,
- button[data-active='false']:disabled {
- background-color: transparent;
- opacity: 0.5;
- cursor: not-allowed;
- }
- button[data-active='true']:disabled > wui-text {
- color: var(--wui-color-fg-200);
- }
- button[data-active='false']:disabled > wui-text {
- color: var(--wui-color-fg-300);
- }
- button > wui-icon,
- button > wui-text {
- pointer-events: none;
- transition: color var(--wui-e ase-out-power-1) var(--wui-duration-md);
- will-change: color;
- }
- button {
- width: var(--local-tab-width);
- transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: background-color;
- }
- :host([data-type='flex']) > button {
- width: 34px;
- position: relative;
- display: flex;
- justify-content: flex-start;
- }
- button:hover:enabled,
- button:active:enabled {
- background-color: transparent !important;
- }
- button:hover:enabled > wui-icon,
- button:active:enabled > wui-icon {
- transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg);
- color: var(--wui-color-fg-125);
- }
- button:hover:enabled > wui-text,
- button:active:enabled > wui-text {
- transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg);
- color: var(--wui-color-fg-125);
- }
- button {
- border-radius: var(--wui-border-radius-3xl);
- }
- `;var Wd=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let sc=class extends se{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.buttons=[],this.disabled=!1,this.localTabWidth="100px",this.activeTab=0,this.isDense=!1}render(){return this.isDense=this.tabs.length>3,this.style.cssText=`
- --local-tab: ${this.activeTab};
- --local-tab-width: ${this.localTabWidth};
- `,this.dataset.type=this.isDense?"flex":"block",this.tabs.map((e,r)=>{var i;const n=r===this.activeTab;return M`
- <button
- ?disabled=${this.disabled}
- @click=${()=>this.onTabClick(r)}
- data-active=${n}
- data-testid="tab-${(i=e.label)==null?void 0:i.toLowerCase()}"
- >
- ${this.iconTemplate(e)}
- <wui-text variant="small-600" color="inherit"> ${e.label} </wui-text>
- </button>
- `})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(e){return e.icon?M`<wui-icon size="xs" color="inherit" name=${e.icon}></wui-icon>`:null}onTabClick(e){this.buttons&&this.animateTabs(e,!1),this.activeTab=e,this.onTabChange(e)}animateTabs(e,r){const n=this.buttons[this.activeTab],i=this.buttons[e],s=n==null?void 0:n.querySelector("wui-text"),o=i==null?void 0:i.querySelector("wui-text"),a=i==null?void 0:i.getBoundingClientRect(),c=o==null?void 0:o.getBoundingClientRect();n&&s&&!r&&e!==this.activeTab&&(s.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),n.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),i&&a&&c&&o&&(e!==this.activeTab||r)&&(this.localTabWidth=`${Math.round(a.width+c.width)+6}px`,i.animate([{width:`${a.width+c.width}px`}],{duration:r?0:500,fill:"forwards",easing:"ease"}),o.animate([{opacity:1}],{duration:r?0:125,delay:r?0:200,fill:"forwards",easing:"ease"}))}};sc.styles=[He,vt,rSe];Wd([q({type:Array})],sc.prototype,"tabs",void 0);Wd([q()],sc.prototype,"onTabChange",void 0);Wd([q({type:Array})],sc.prototype,"buttons",void 0);Wd([q({type:Boolean})],sc.prototype,"disabled",void 0);Wd([q()],sc.prototype,"localTabWidth",void 0);Wd([G()],sc.prototype,"activeTab",void 0);Wd([G()],sc.prototype,"isDense",void 0);sc=Wd([te("wui-tabs")],sc);const nSe=de`
- wui-flex {
- width: 100%;
- }
- :host > wui-flex:first-child {
- transform: translateY(calc(var(--wui-spacing-xxs) * -1));
- }
- wui-icon-link {
- margin-right: calc(var(--wui-icon-box-size-md) * -1);
- }
- wui-notice-card {
- margin-bottom: var(--wui-spacing-3xs);
- }
- wui-list-item > wui-text {
- flex: 1;
- }
- w3m-transactions-view {
- max-height: 200px;
- }
- .tab-content-container {
- height: 300px;
- overflow-y: auto;
- overflow-x: hidden;
- scrollbar-width: none;
- }
- .tab-content-container::-webkit-scrollbar {
- display: none;
- }
- .account-button {
- width: auto;
- border: none;
- display: flex;
- align-items: center;
- justify-content: center;
- gap: var(--wui-spacing-s);
- height: 48px;
- padding: var(--wui-spacing-xs);
- padding-right: var(--wui-spacing-s);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
- background-color: var(--wui-color-gray-glass-002);
- border-radius: 24px;
- transition: background-color 0.2s linear;
- }
- .account-button:hover {
- background-color: var(--wui-color-gray-glass-005);
- }
- .avatar-container {
- position: relative;
- }
- wui-avatar.avatar {
- width: 32px;
- height: 32px;
- box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
- }
- wui-avatar.network-avatar {
- width: 16px;
- height: 16px;
- position: absolute;
- left: 100%;
- top: 100%;
- transform: translate(-75%, -75%);
- box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
- }
- .account-links {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .account-links wui-flex {
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- flex: 1;
- background: red;
- align-items: center;
- justify-content: center;
- height: 48px;
- padding: 10px;
- flex: 1 0 0;
- border-radius: var(--XS, 16px);
- border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
- background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
- transition:
- background-color var(--wui-ease-out-power-1) var(--wui-duration-md),
- opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: background-color, opacity;
- }
- .account-links wui-flex:hover {
- background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
- }
- .account-links wui-flex wui-icon {
- width: var(--S, 20px);
- height: var(--S, 20px);
- }
- .account-links wui-flex wui-icon svg path {
- stroke: #667dff;
- }
- `;var $s=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Ti=class extends se{constructor(){var e;super(),this.unsubscribe=[],this.caipAddress=re.state.caipAddress,this.address=ue.getPlainAddress(re.state.caipAddress),this.allAccounts=re.state.allAccounts,this.profileImage=re.state.profileImage,this.profileName=re.state.profileName,this.disconnecting=!1,this.balance=re.state.balance,this.balanceSymbol=re.state.balanceSymbol,this.features=oe.state.features,this.remoteFeatures=oe.state.remoteFeatures,this.namespace=F.state.activeChain,this.chainId=(e=F.state.activeCaipNetwork)==null?void 0:e.id,this.unsubscribe.push(re.subscribeKey("caipAddress",r=>{this.address=ue.getPlainAddress(r),this.caipAddress=r}),re.subscribeKey("balance",r=>this.balance=r),re.subscribeKey("balanceSymbol",r=>this.balanceSymbol=r),re.subscribeKey("profileName",r=>this.profileName=r),re.subscribeKey("profileImage",r=>this.profileImage=r),oe.subscribeKey("features",r=>this.features=r),oe.subscribeKey("remoteFeatures",r=>this.remoteFeatures=r),re.subscribeKey("allAccounts",r=>{this.allAccounts=r}),oe.subscribeKey("remoteFeatures",r=>this.remoteFeatures=r),F.subscribeKey("activeChain",r=>this.namespace=r),F.subscribeKey("activeCaipNetwork",r=>{var n;if(r){const[i,s]=((n=r==null?void 0:r.caipNetworkId)==null?void 0:n.split(":"))||[];i&&s&&(this.namespace=i,this.chainId=s)}}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.caipAddress)return null;const e=F.state.activeChain!==_e.CHAIN.SOLANA&&this.allAccounts.length>1;return M`<wui-flex
- flexDirection="column"
- .padding=${["0","xl","m","xl"]}
- alignItems="center"
- gap="l"
- >
- ${e?this.multiAccountTemplate():this.singleAccountTemplate()}
- <wui-flex flexDirection="column" alignItems="center">
- <wui-text variant="paragraph-500" color="fg-200">
- ${ue.formatBalance(this.balance,this.balanceSymbol)}
- </wui-text>
- </wui-flex>
- ${this.explorerBtnTemplate()}
- </wui-flex>
- <wui-flex flexDirection="column" gap="xs" .padding=${["0","s","s","s"]}>
- ${this.authCardTemplate()} <w3m-account-auth-button></w3m-account-auth-button>
- ${this.orderedFeaturesTemplate()} ${this.activityTemplate()}
- <wui-list-item
- variant="icon"
- iconVariant="overlay"
- icon="disconnect"
- ?chevron=${!1}
- .loading=${this.disconnecting}
- @click=${this.onDisconnect.bind(this)}
- data-testid="disconnect-button"
- >
- <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text>
- </wui-list-item>
- </wui-flex>`}onrampTemplate(){var n;if(!this.namespace)return null;const e=(n=this.remoteFeatures)==null?void 0:n.onramp,r=ct.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace);return!e||!r?null:M`
- <wui-list-item
- data-testid="w3m-account-default-onramp-button"
- iconVariant="blue"
- icon="card"
- ?chevron=${!0}
- @click=${this.handleClickPay.bind(this)}
- >
- <wui-text variant="paragraph-500" color="fg-100">Buy crypto</wui-text>
- </wui-list-item>
- `}orderedFeaturesTemplate(){var r;return(((r=this.features)==null?void 0:r.walletFeaturesOrder)||ct.DEFAULT_FEATURES.walletFeaturesOrder).map(n=>{switch(n){case"onramp":return this.onrampTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})}activityTemplate(){var r;return this.namespace&&((r=this.remoteFeatures)==null?void 0:r.activity)&&ct.ACTIVITY_ENABLED_CHAIN_NAMESPACES.includes(this.namespace)?M` <wui-list-item
- iconVariant="blue"
- icon="clock"
- iconSize="sm"
- ?chevron=${!0}
- @click=${this.onTransactions.bind(this)}
- data-testid="w3m-account-default-activity-button"
- >
- <wui-text variant="paragraph-500" color="fg-100">Activity</wui-text>
- </wui-list-item>`:null}swapsTemplate(){var n;const e=(n=this.remoteFeatures)==null?void 0:n.swaps,r=F.state.activeChain===_e.CHAIN.EVM;return!e||!r?null:M`
- <wui-list-item
- iconVariant="blue"
- icon="recycleHorizontal"
- ?chevron=${!0}
- @click=${this.handleClickSwap.bind(this)}
- data-testid="w3m-account-default-swaps-button"
- >
- <wui-text variant="paragraph-500" color="fg-100">Swap</wui-text>
- </wui-list-item>
- `}sendTemplate(){var i;const e=(i=this.features)==null?void 0:i.send,r=F.state.activeChain,n=ct.SEND_SUPPORTED_NAMESPACES.includes(r);return!e||!n?null:M`
- <wui-list-item
- iconVariant="blue"
- icon="send"
- ?chevron=${!0}
- @click=${this.handleClickSend.bind(this)}
- data-testid="w3m-account-default-send-button"
- >
- <wui-text variant="paragraph-500" color="fg-100">Send</wui-text>
- </wui-list-item>
- `}authCardTemplate(){const e=F.state.activeChain,r=ge.getConnectorId(e),n=ge.getAuthConnector(),{origin:i}=location;return!n||r!==_e.CONNECTOR_ID.AUTH||i.includes(ct.SECURE_SITE)?null:M`
- <wui-notice-card
- @click=${this.onGoToUpgradeView.bind(this)}
- label="Upgrade your wallet"
- description="Transition to a self-custodial wallet"
- icon="wallet"
- data-testid="w3m-wallet-upgrade-card"
- ></wui-notice-card>
- `}handleSwitchAccountsView(){X.push("SwitchAddress")}handleClickPay(){X.push("OnRampProviders")}handleClickSwap(){X.push("Swap")}handleClickSend(){X.push("WalletSend")}explorerBtnTemplate(){return re.state.addressExplorerUrl?M`
- <wui-button size="md" variant="neutral" @click=${this.onExplorer.bind(this)}>
- <wui-icon size="sm" color="inherit" slot="iconLeft" name="compass"></wui-icon>
- Block Explorer
- <wui-icon size="sm" color="inherit" slot="iconRight" name="externalLink"></wui-icon>
- </wui-button>
- `:null}singleAccountTemplate(){return M`
- <wui-avatar
- alt=${we(this.caipAddress)}
- address=${we(ue.getPlainAddress(this.caipAddress))}
- imageSrc=${we(this.profileImage===null?void 0:this.profileImage)}
- data-testid="single-account-avatar"
- ></wui-avatar>
- <wui-flex flexDirection="column" alignItems="center">
- <wui-flex gap="3xs" alignItems="center" justifyContent="center">
- <wui-text variant="large-600" color="fg-100">
- ${this.profileName?nt.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):nt.getTruncateString({string:this.address||"",charsStart:4,charsEnd:4,truncate:"middle"})}
- </wui-text>
- <wui-icon-link
- size="md"
- icon="copy"
- iconColor="fg-200"
- @click=${this.onCopyAddress}
- ></wui-icon-link> </wui-flex
- ></wui-flex>
- `}multiAccountTemplate(){if(!this.address)throw new Error("w3m-account-view: No account provided");const e=this.allAccounts.find(n=>n.address===this.address),r=re.state.addressLabels.get(this.address);return this.namespace==="bip122"?this.btcAccountsTemplate():M`
- <wui-profile-button-v2
- .onProfileClick=${this.handleSwitchAccountsView.bind(this)}
- address=${we(this.address)}
- icon="${(e==null?void 0:e.type)===bt.ACCOUNT_TYPES.SMART_ACCOUNT&&F.state.activeChain===_e.CHAIN.EVM?"lightbulb":"mail"}"
- avatarSrc=${we(this.profileImage?this.profileImage:void 0)}
- profileName=${we(r||this.profileName)}
- .onCopyClick=${this.onCopyAddress.bind(this)}
- ></wui-profile-button-v2>
- `}btcAccountsTemplate(){return M`<wui-flex gap="m" alignItems="center" flexDirection="column">
- <wui-avatar
- .imageSrc=${we(this.profileImage?this.profileImage:void 0)}
- alt=${this.address}
- address=${this.address}
- ></wui-avatar>
- <wui-tabs
- .tabs=${[{label:"Payment"},{label:"Ordinals"}]}
- .onTabChange=${e=>{var r;return re.setCaipAddress(`bip122:${this.chainId}:${((r=this.allAccounts[e])==null?void 0:r.address)||""}`,this.namespace)}}
- ></wui-tabs>
- <wui-flex gap="xs" alignItems="center" justifyContent="center">
- <wui-text variant="large-600" color="fg-100">
- ${nt.getTruncateString({string:this.profileName||this.address||"",charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
- </wui-text>
- <wui-icon-link
- size="md"
- icon="copy"
- iconColor="fg-200"
- @click=${this.onCopyAddress}
- ></wui-icon-link>
- </wui-flex>
- </wui-flex>`}onCopyAddress(){try{this.address&&(ue.copyToClopboard(this.address),Fe.showSuccess("Address copied"))}catch{Fe.showError("Failed to copy")}}onTransactions(){var r;const e=F.state.activeChain;Re.sendEvent({type:"track",event:"CLICK_TRANSACTIONS",properties:{isSmartAccount:((r=re.state.preferredAccountTypes)==null?void 0:r[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT}}),X.push("Transactions")}async onDisconnect(){try{this.disconnecting=!0,await xe.disconnect(),We.close()}catch{Re.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),Fe.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){const e=re.state.addressExplorerUrl;e&&ue.openHref(e,"_blank")}onGoToUpgradeView(){Re.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),X.push("UpgradeEmailWallet")}};Ti.styles=nSe;$s([G()],Ti.prototype,"caipAddress",void 0);$s([G()],Ti.prototype,"address",void 0);$s([G()],Ti.prototype,"allAccounts",void 0);$s([G()],Ti.prototype,"profileImage",void 0);$s([G()],Ti.prototype,"profileName",void 0);$s([G()],Ti.prototype,"disconnecting",void 0);$s([G()],Ti.prototype,"balance",void 0);$s([G()],Ti.prototype,"balanceSymbol",void 0);$s([G()],Ti.prototype,"features",void 0);$s([G()],Ti.prototype,"remoteFeatures",void 0);$s([G()],Ti.prototype,"namespace",void 0);$s([G()],Ti.prototype,"chainId",void 0);Ti=$s([te("w3m-account-default-widget")],Ti);const iSe=de`
- span {
- font-weight: 500;
- font-size: 40px;
- color: var(--wui-color-fg-100);
- line-height: 130%; /* 52px */
- letter-spacing: -1.6px;
- text-align: center;
- }
- .pennies {
- color: var(--wui-color-fg-200);
- }
- `;var Y7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let zy=class extends se{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return M`<span>$${this.dollars}<span class="pennies">.${this.pennies}</span></span>`}};zy.styles=[He,iSe];Y7([q()],zy.prototype,"dollars",void 0);Y7([q()],zy.prototype,"pennies",void 0);zy=Y7([te("wui-balance")],zy);const sSe=de`
- button {
- background-color: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-3xl);
- border: 1px solid var(--wui-color-gray-glass-002);
- padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs);
- position: relative;
- }
- wui-avatar {
- width: 32px;
- height: 32px;
- box-shadow: 0 0 0 0;
- outline: 3px solid var(--wui-color-gray-glass-005);
- }
- wui-icon-box,
- wui-image {
- width: 16px;
- height: 16px;
- border-radius: var(--wui-border-radius-3xl);
- position: absolute;
- left: 26px;
- top: 24px;
- }
- wui-image {
- outline: 2px solid var(--wui-color-bg-125);
- }
- wui-icon-box {
- outline: 2px solid var(--wui-color-bg-200);
- background-color: var(--wui-color-bg-250);
- }
- `;var d1=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Pd=class extends se{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.profileName="",this.address="",this.icon="chevronBottom"}render(){return M`<button data-testid="wui-profile-button">
- <wui-flex gap="xs" alignItems="center">
- <wui-avatar
- .imageSrc=${this.avatarSrc}
- alt=${this.address}
- address=${this.address}
- ></wui-avatar>
- ${this.networkImageTemplate()}
- <wui-flex gap="xs" alignItems="center">
- <wui-text variant="large-600" color="fg-100">
- ${nt.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
- </wui-text>
- <wui-icon size="sm" color="fg-200" name=${this.icon}></wui-icon>
- </wui-flex>
- </wui-flex>
- </button>`}networkImageTemplate(){return this.networkSrc?M`<wui-image src=${this.networkSrc}></wui-image>`:M`
- <wui-icon-box
- size="xxs"
- iconColor="fg-200"
- backgroundColor="bg-100"
- icon="networkPlaceholder"
- ></wui-icon-box>
- `}};Pd.styles=[He,vt,sSe];d1([q()],Pd.prototype,"networkSrc",void 0);d1([q()],Pd.prototype,"avatarSrc",void 0);d1([q()],Pd.prototype,"profileName",void 0);d1([q()],Pd.prototype,"address",void 0);d1([q()],Pd.prototype,"icon",void 0);Pd=d1([te("wui-profile-button")],Pd);const oSe=de`
- :host {
- display: block;
- padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s);
- border-radius: var(--wui-border-radius-xxs);
- color: var(--wui-color-bg-100);
- position: relative;
- }
- :host([data-variant='shade']) {
- background-color: var(--wui-color-bg-150);
- border: 1px solid var(--wui-color-gray-glass-005);
- }
- :host([data-variant='shade']) > wui-text {
- color: var(--wui-color-fg-150);
- }
- :host([data-variant='fill']) {
- background-color: var(--wui-color-fg-100);
- border: none;
- }
- wui-icon {
- position: absolute;
- width: 12px !important;
- height: 4px !important;
- }
- wui-icon[data-placement='top'] {
- bottom: 0px;
- left: 50%;
- transform: translate(-50%, 95%);
- }
- wui-icon[data-placement='bottom'] {
- top: 0;
- left: 50%;
- transform: translate(-50%, -95%) rotate(180deg);
- }
- wui-icon[data-placement='right'] {
- top: 50%;
- left: 0;
- transform: translate(-65%, -50%) rotate(90deg);
- }
- wui-icon[data-placement='left'] {
- top: 50%;
- right: 0%;
- transform: translate(65%, -50%) rotate(270deg);
- }
- `;var jA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Um=class extends se{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.message=""}render(){return this.dataset.variant=this.variant,M`<wui-icon
- data-placement=${this.placement}
- color="fg-100"
- size="inherit"
- name=${this.variant==="fill"?"cursor":"cursorTransparent"}
- ></wui-icon>
- <wui-text color="inherit" variant="small-500">${this.message}</wui-text>`}};Um.styles=[He,vt,oSe];jA([q()],Um.prototype,"placement",void 0);jA([q()],Um.prototype,"variant",void 0);jA([q()],Um.prototype,"message",void 0);Um=jA([te("wui-tooltip")],Um);const aSe={getTabsByNamespace(t){var r;return!!t&&t===_e.CHAIN.EVM?((r=oe.state.remoteFeatures)==null?void 0:r.activity)===!1?Fo.ACCOUNT_TABS.filter(n=>n.label!=="Activity"):Fo.ACCOUNT_TABS:[]}},cSe=de`
- :host {
- width: 100%;
- max-height: 280px;
- overflow: scroll;
- scrollbar-width: none;
- }
- :host::-webkit-scrollbar {
- display: none;
- }
- `;var uSe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let YP=class extends se{render(){return M`<w3m-activity-list page="account"></w3m-activity-list>`}};YP.styles=cSe;YP=uSe([te("w3m-account-activity-widget")],YP);const lSe=de`
- .contentContainer {
- height: 280px;
- }
- .contentContainer > wui-icon-box {
- width: 40px;
- height: 40px;
- border-radius: var(--wui-border-radius-xxs);
- }
- .contentContainer > .textContent {
- width: 65%;
- }
- `;var dSe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let JP=class extends se{render(){return M`${this.nftTemplate()}`}nftTemplate(){return M` <wui-flex
- class="contentContainer"
- alignItems="center"
- justifyContent="center"
- flexDirection="column"
- gap="l"
- >
- <wui-icon-box
- icon="wallet"
- size="inherit"
- iconColor="fg-200"
- backgroundColor="fg-200"
- iconSize="lg"
- ></wui-icon-box>
- <wui-flex
- class="textContent"
- gap="xs"
- flexDirection="column"
- justifyContent="center"
- flexDirection="column"
- >
- <wui-text
- variant="paragraph-500"
- align="center"
- color="fg-100"
- data-testid="nft-template-title"
- >Coming soon</wui-text
- >
- <wui-text
- variant="small-400"
- align="center"
- color="fg-200"
- data-testid="nft-template-description"
- >Stay tuned for our upcoming NFT feature</wui-text
- >
- </wui-flex>
- <wui-link @click=${this.onReceiveClick.bind(this)} data-testid="link-receive-funds"
- >Receive funds</wui-link
- >
- </wui-flex>`}onReceiveClick(){X.push("WalletReceive")}};JP.styles=lSe;JP=dSe([te("w3m-account-nfts-widget")],JP);const hSe=de`
- button {
- width: 100%;
- display: flex;
- gap: var(--wui-spacing-s);
- align-items: center;
- justify-content: flex-start;
- padding: var(--wui-spacing-s) var(--wui-spacing-m) var(--wui-spacing-s) var(--wui-spacing-s);
- background-color: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xs);
- }
- wui-icon-box {
- width: var(--wui-spacing-2xl);
- height: var(--wui-spacing-2xl);
- }
- wui-flex {
- width: auto;
- }
- `;var Vd=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let oc=class extends se{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.iconBackgroundColor="accent-100",this.iconColor="accent-100",this.disabled=!1}render(){return M`
- <button ?disabled=${this.disabled}>
- <wui-icon-box
- iconColor=${this.iconColor}
- backgroundColor=${this.iconBackgroundColor}
- size="inherit"
- icon=${this.icon}
- iconSize="md"
- ></wui-icon-box>
- <wui-flex flexDirection="column" justifyContent="spaceBetween">
- ${this.titleTemplate()}
- <wui-text variant="small-400" color="fg-200"> ${this.description}</wui-text></wui-flex
- >
- </button>
- `}titleTemplate(){return this.tag?M` <wui-flex alignItems="center" gap="xxs"
- ><wui-text variant="paragraph-500" color="fg-100">${this.text}</wui-text
- ><wui-tag tagType="main" size="md">${this.tag}</wui-tag>
- </wui-flex>`:M`<wui-text variant="paragraph-500" color="fg-100">${this.text}</wui-text>`}};oc.styles=[He,vt,hSe];Vd([q()],oc.prototype,"icon",void 0);Vd([q()],oc.prototype,"text",void 0);Vd([q()],oc.prototype,"description",void 0);Vd([q()],oc.prototype,"tag",void 0);Vd([q()],oc.prototype,"iconBackgroundColor",void 0);Vd([q()],oc.prototype,"iconColor",void 0);Vd([q({type:Boolean})],oc.prototype,"disabled",void 0);oc=Vd([te("wui-list-description")],oc);const fSe=de`
- :host {
- width: 100%;
- }
- wui-flex {
- width: 100%;
- }
- .contentContainer {
- max-height: 280px;
- overflow: scroll;
- scrollbar-width: none;
- }
- .contentContainer::-webkit-scrollbar {
- display: none;
- }
- `;var J7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Wy=class extends se{constructor(){super(),this.unsubscribe=[],this.tokenBalance=re.state.tokenBalance,this.remoteFeatures=oe.state.remoteFeatures,this.unsubscribe.push(re.subscribe(e=>{this.tokenBalance=e.tokenBalance}),oe.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return M`${this.tokenTemplate()}`}tokenTemplate(){var e;return this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>0?M`<wui-flex class="contentContainer" flexDirection="column" gap="xs">
- ${this.tokenItemTemplate()}
- </wui-flex>`:M` <wui-flex flexDirection="column" gap="xs"
- >${this.onRampTemplate()}
- <wui-list-description
- @click=${this.onReceiveClick.bind(this)}
- text="Receive funds"
- description="Transfer tokens on your wallet"
- icon="arrowBottomCircle"
- iconColor="fg-200"
- iconBackgroundColor="fg-200"
- data-testid="receive-funds"
- ></wui-list-description
- ></wui-flex>`}onRampTemplate(){var e;return(e=this.remoteFeatures)!=null&&e.onramp?M`<wui-list-description
- @click=${this.onBuyClick.bind(this)}
- text="Buy Crypto"
- description="Easy with card or bank account"
- icon="card"
- iconColor="success-100"
- iconBackgroundColor="success-100"
- tag="popular"
- data-testid="buy-crypto"
- ></wui-list-description>`:M``}tokenItemTemplate(){var e;return(e=this.tokenBalance)==null?void 0:e.map(r=>M`<wui-list-token
- tokenName=${r.name}
- tokenImageUrl=${r.iconUrl}
- tokenAmount=${r.quantity.numeric}
- tokenValue=${r.value}
- tokenCurrency=${r.symbol}
- ></wui-list-token>`)}onReceiveClick(){X.push("WalletReceive")}onBuyClick(){var r;const e=F.state.activeChain;Re.sendEvent({type:"track",event:"SELECT_BUY_CRYPTO",properties:{isSmartAccount:((r=re.state.preferredAccountTypes)==null?void 0:r[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT}}),X.push("OnRampProviders")}};Wy.styles=fSe;J7([G()],Wy.prototype,"tokenBalance",void 0);J7([G()],Wy.prototype,"remoteFeatures",void 0);Wy=J7([te("w3m-account-tokens-widget")],Wy);const pSe=de`
- wui-flex {
- width: 100%;
- }
- wui-promo {
- position: absolute;
- top: -32px;
- }
- wui-profile-button {
- margin-top: calc(-1 * var(--wui-spacing-2l));
- }
- wui-promo + wui-profile-button {
- margin-top: var(--wui-spacing-2l);
- }
- wui-tabs {
- width: 100%;
- }
- .contentContainer {
- height: 280px;
- }
- .contentContainer > wui-icon-box {
- width: 40px;
- height: 40px;
- border-radius: var(--wui-border-radius-xxs);
- }
- .contentContainer > .textContent {
- width: 65%;
- }
- `;var ua=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const gSe=48,mSe=430;let Os=class extends se{constructor(){super(),this.unsubscribe=[],this.address=re.state.address,this.profileImage=re.state.profileImage,this.profileName=re.state.profileName,this.network=F.state.activeCaipNetwork,this.currentTab=re.state.currentTab,this.tokenBalance=re.state.tokenBalance,this.features=oe.state.features,this.remoteFeatures=oe.state.remoteFeatures,this.networkImage=pt.getNetworkImage(this.network),this.unsubscribe.push(er.subscribeNetworkImages(()=>{this.networkImage=pt.getNetworkImage(this.network)}),re.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance):We.close()}),F.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=pt.getNetworkImage(this.network)}),oe.subscribeKey("features",e=>this.features=e),oe.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e)),this.watchSwapValues()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearInterval(this.watchTokenBalance)}firstUpdated(){re.fetchTokenBalance()}render(){if(!this.address)throw new Error("w3m-account-view: No account provided");return M`<wui-flex
- flexDirection="column"
- .padding=${["0","xl","m","xl"]}
- alignItems="center"
- gap="m"
- data-testid="w3m-account-wallet-features-widget"
- >
- <wui-profile-button
- @click=${this.onProfileButtonClick.bind(this)}
- address=${we(this.address)}
- networkSrc=${we(this.networkImage)}
- icon="chevronBottom"
- avatarSrc=${we(this.profileImage?this.profileImage:void 0)}
- profileName=${we(this.profileName??void 0)}
- data-testid="w3m-profile-button"
- ></wui-profile-button>
- ${this.tokenBalanceTemplate()} ${this.orderedWalletFeatures()} ${this.tabsTemplate()}
- ${this.listContentTemplate()}
- </wui-flex>`}orderedWalletFeatures(){var n;const e=((n=this.features)==null?void 0:n.walletFeaturesOrder)||ct.DEFAULT_FEATURES.walletFeaturesOrder;return e.every(i=>{var s,o;return i==="send"||i==="receive"?!((s=this.features)!=null&&s[i]):i==="swaps"||i==="onramp"?!((o=this.remoteFeatures)!=null&&o[i]):!0})?null:M`<wui-flex gap="s">
- ${e.map(i=>{switch(i){case"onramp":return this.onrampTemplate();case"swaps":return this.swapsTemplate();case"receive":return this.receiveTemplate();case"send":return this.sendTemplate();default:return null}})}
- </wui-flex>`}onrampTemplate(){var r;return((r=this.remoteFeatures)==null?void 0:r.onramp)?M`
- <w3m-tooltip-trigger text="Buy">
- <wui-icon-button
- data-testid="wallet-features-onramp-button"
- @click=${this.onBuyClick.bind(this)}
- icon="card"
- ></wui-icon-button>
- </w3m-tooltip-trigger>
- `:null}swapsTemplate(){var n;const e=(n=this.remoteFeatures)==null?void 0:n.swaps,r=F.state.activeChain===_e.CHAIN.EVM;return!e||!r?null:M`
- <w3m-tooltip-trigger text="Swap">
- <wui-icon-button
- data-testid="wallet-features-swaps-button"
- @click=${this.onSwapClick.bind(this)}
- icon="recycleHorizontal"
- >
- </wui-icon-button>
- </w3m-tooltip-trigger>
- `}receiveTemplate(){var r;return((r=this.features)==null?void 0:r.receive)?M`
- <w3m-tooltip-trigger text="Receive">
- <wui-icon-button
- data-testid="wallet-features-receive-button"
- @click=${this.onReceiveClick.bind(this)}
- icon="arrowBottomCircle"
- >
- </wui-icon-button>
- </w3m-tooltip-trigger>
- `:null}sendTemplate(){var i;const e=(i=this.features)==null?void 0:i.send,r=F.state.activeChain,n=ct.SEND_SUPPORTED_NAMESPACES.includes(r);return!e||!n?null:M`
- <w3m-tooltip-trigger text="Send">
- <wui-icon-button
- data-testid="wallet-features-send-button"
- @click=${this.onSendClick.bind(this)}
- icon="send"
- ></wui-icon-button>
- </w3m-tooltip-trigger>
- `}watchSwapValues(){this.watchTokenBalance=setInterval(()=>re.fetchTokenBalance(e=>this.onTokenBalanceError(e)),1e4)}onTokenBalanceError(e){e instanceof Error&&e.cause instanceof Response&&e.cause.status===_e.HTTP_STATUS_CODES.SERVICE_UNAVAILABLE&&clearInterval(this.watchTokenBalance)}listContentTemplate(){return this.currentTab===0?M`<w3m-account-tokens-widget></w3m-account-tokens-widget>`:this.currentTab===1?M`<w3m-account-nfts-widget></w3m-account-nfts-widget>`:this.currentTab===2?M`<w3m-account-activity-widget></w3m-account-activity-widget>`:M`<w3m-account-tokens-widget></w3m-account-tokens-widget>`}tokenBalanceTemplate(){var e;if(this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>=0){const r=ue.calculateBalance(this.tokenBalance),{dollars:n="0",pennies:i="00"}=ue.formatTokenBalance(r);return M`<wui-balance dollars=${n} pennies=${i}></wui-balance>`}return M`<wui-balance dollars="0" pennies="00"></wui-balance>`}tabsTemplate(){const e=aSe.getTabsByNamespace(F.state.activeChain);if(e.length===0)return null;const r=ue.isMobile()&&window.innerWidth<mSe;let n="104px";return r?n=`${(window.innerWidth-gSe)/e.length}px`:e.length===2?n="156px":n="104px",M`<wui-tabs
- .onTabChange=${this.onTabChange.bind(this)}
- .activeTab=${this.currentTab}
- localTabWidth=${n}
- .tabs=${e}
- ></wui-tabs>`}onTabChange(e){re.setCurrentTab(e)}onProfileButtonClick(){const{allAccounts:e}=re.state;e.length>1?X.push("Profile"):X.push("AccountSettings")}onBuyClick(){X.push("OnRampProviders")}onSwapClick(){var r,n,i,s;const e=F.state.activeChain;(r=this.network)!=null&&r.caipNetworkId&&!ct.SWAP_SUPPORTED_NETWORKS.includes((n=this.network)==null?void 0:n.caipNetworkId)?X.push("UnsupportedChain",{swapUnsupportedChain:!0}):(Re.sendEvent({type:"track",event:"OPEN_SWAP",properties:{network:((i=this.network)==null?void 0:i.caipNetworkId)||"",isSmartAccount:((s=re.state.preferredAccountTypes)==null?void 0:s[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT}}),X.push("Swap"))}onReceiveClick(){X.push("WalletReceive")}onSendClick(){var r,n;const e=F.state.activeChain;Re.sendEvent({type:"track",event:"OPEN_SEND",properties:{network:((r=this.network)==null?void 0:r.caipNetworkId)||"",isSmartAccount:((n=re.state.preferredAccountTypes)==null?void 0:n[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT}}),X.push("WalletSend")}};Os.styles=pSe;ua([G()],Os.prototype,"watchTokenBalance",void 0);ua([G()],Os.prototype,"address",void 0);ua([G()],Os.prototype,"profileImage",void 0);ua([G()],Os.prototype,"profileName",void 0);ua([G()],Os.prototype,"network",void 0);ua([G()],Os.prototype,"currentTab",void 0);ua([G()],Os.prototype,"tokenBalance",void 0);ua([G()],Os.prototype,"features",void 0);ua([G()],Os.prototype,"remoteFeatures",void 0);ua([G()],Os.prototype,"networkImage",void 0);Os=ua([te("w3m-account-wallet-features-widget")],Os);var rQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let p6=class extends se{constructor(){super(),this.unsubscribe=[],this.namespace=F.state.activeChain,this.unsubscribe.push(F.subscribeKey("activeChain",e=>{this.namespace=e}))}render(){if(!this.namespace)return null;const e=ge.getConnectorId(this.namespace),r=ge.getAuthConnector();return M`
- ${r&&e===_e.CONNECTOR_ID.AUTH?this.walletFeaturesTemplate():this.defaultTemplate()}
- `}walletFeaturesTemplate(){return M`<w3m-account-wallet-features-widget></w3m-account-wallet-features-widget>`}defaultTemplate(){return M`<w3m-account-default-widget></w3m-account-default-widget>`}};rQ([G()],p6.prototype,"namespace",void 0);p6=rQ([te("w3m-account-view")],p6);const wSe=de`
- button {
- padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs);
- display: flex;
- justify-content: space-between;
- width: 100%;
- border-radius: var(--wui-border-radius-xs);
- background-color: var(--wui-color-gray-glass-002);
- }
- button[data-clickable='false'] {
- pointer-events: none;
- background-color: transparent;
- }
- wui-image {
- width: var(--wui-spacing-3xl);
- height: var(--wui-spacing-3xl);
- border-radius: var(--wui-border-radius-3xl);
- }
- wui-avatar {
- width: var(--wui-spacing-3xl);
- height: var(--wui-spacing-3xl);
- box-shadow: 0 0 0 0;
- }
- .address {
- color: var(--wui-color-fg-base-100);
- }
- .address-description {
- text-transform: capitalize;
- color: var(--wui-color-fg-base-200);
- }
- wui-icon-box {
- position: relative;
- right: 15px;
- top: 15px;
- border: 2px solid var(--wui-color-bg-150);
- background-color: var(--wui-color-bg-125);
- }
- `;var d2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let ap=class extends se{constructor(){super(...arguments),this.accountAddress="",this.accountType="",this.labels=re.state.addressLabels,this.caipNetwork=F.state.activeCaipNetwork,this.socialProvider=Le.getConnectedSocialProvider(),this.balance=0,this.fetchingBalance=!0,this.shouldShowIcon=!1,this.selected=!1}connectedCallback(){var e;super.connectedCallback(),Xe.getBalance(this.accountAddress,(e=this.caipNetwork)==null?void 0:e.caipNetworkId).then(r=>{let n=this.balance;r.balances.length>0&&(n=r.balances.reduce((i,s)=>i+((s==null?void 0:s.value)||0),0)),this.balance=n,this.fetchingBalance=!1,this.requestUpdate()}).catch(()=>{this.fetchingBalance=!1,this.requestUpdate()})}render(){const e=this.getLabel(),r=F.state.activeChain,n=ge.getConnectorId(r);return this.shouldShowIcon=n===_e.CONNECTOR_ID.AUTH,M`
- <wui-flex
- flexDirection="row"
- justifyContent="space-between"
- .padding=${["0","0","s","1xs"]}
- >
- <wui-flex gap="md" alignItems="center">
- <wui-avatar address=${this.accountAddress}></wui-avatar>
- ${this.shouldShowIcon?M`<wui-icon-box
- size="sm"
- iconcolor="fg-200"
- backgroundcolor="fg-300"
- icon=${this.accountType===bt.ACCOUNT_TYPES.EOA?this.socialProvider??"mail":"lightbulb"}
- background="fg-300"
- ></wui-icon-box>`:M`<wui-flex .padding="${["0","0","0","s"]}"></wui-flex>`}
- <wui-flex flexDirection="column">
- <wui-text class="address" variant="paragraph-500" color="fg-100"
- >${nt.getTruncateString({string:this.accountAddress,charsStart:4,charsEnd:6,truncate:"middle"})}</wui-text
- >
- <wui-text class="address-description" variant="small-400">${e}</wui-text></wui-flex
- >
- </wui-flex>
- <wui-flex gap="s" alignItems="center">
- <slot name="action"></slot>
- ${this.fetchingBalance?M`<wui-loading-spinner size="sm" color="accent-100"></wui-loading-spinner>`:M` <wui-text variant="small-400">$${this.balance.toFixed(2)}</wui-text>`}
- </wui-flex>
- </wui-flex>
- `}getLabel(){var i;let e=(i=this.labels)==null?void 0:i.get(this.accountAddress);const r=F.state.activeChain,n=ge.getConnectorId(r);return!e&&n===_e.CONNECTOR_ID.AUTH?e=`${this.accountType==="eoa"?this.socialProvider??"Email":"Smart"} Account`:e||(e="EOA"),e}};ap.styles=[He,vt,wSe];d2([q()],ap.prototype,"accountAddress",void 0);d2([q()],ap.prototype,"accountType",void 0);d2([q({type:Boolean})],ap.prototype,"selected",void 0);d2([q({type:Function})],ap.prototype,"onSelect",void 0);ap=d2([te("wui-list-account")],ap);const bSe=de`
- wui-flex {
- width: 100%;
- }
- wui-icon-link {
- margin-right: calc(var(--wui-icon-box-size-md) * -1);
- }
- .account-links {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .account-links wui-flex {
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- flex: 1;
- background: red;
- align-items: center;
- justify-content: center;
- height: 48px;
- padding: 10px;
- flex: 1 0 0;
- border-radius: var(--XS, 16px);
- border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
- background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
- transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: background-color;
- }
- .account-links wui-flex:hover {
- background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
- }
- .account-links wui-flex wui-icon {
- width: var(--S, 20px);
- height: var(--S, 20px);
- }
- .account-links wui-flex wui-icon svg path {
- stroke: #47a1ff;
- }
- .account-settings-button {
- padding: calc(var(--wui-spacing-m) - 1px) var(--wui-spacing-2l);
- height: 40px;
- border-radius: var(--wui-border-radius-xxs);
- border: 1px solid var(--wui-color-gray-glass-002);
- background: var(--wui-color-gray-glass-002);
- cursor: pointer;
- }
- .account-settings-button:hover {
- background: var(--wui-color-gray-glass-005);
- }
- `;var h1=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let zu=class extends se{constructor(){super(),this.usubscribe=[],this.address=re.state.address,this.profileImage=re.state.profileImage,this.profileName=re.state.profileName,this.accounts=re.state.allAccounts,this.loading=!1,this.usubscribe.push(re.subscribeKey("address",e=>{e?this.address=e:We.close()})),this.usubscribe.push(re.subscribeKey("profileImage",e=>{this.profileImage=e})),this.usubscribe.push(re.subscribeKey("profileName",e=>{this.profileName=e}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-profile-view: No account provided");return M`
- <wui-flex flexDirection="column" gap="l" .padding=${["0","xl","m","xl"]}>
- <wui-flex flexDirection="column" alignItems="center" gap="l">
- <wui-avatar
- alt=${this.address}
- address=${this.address}
- imageSrc=${we(this.profileImage)}
- size="2lg"
- ></wui-avatar>
- <wui-flex flexDirection="column" alignItems="center">
- <wui-flex gap="3xs" alignItems="center" justifyContent="center">
- <wui-text variant="title-6-600" color="fg-100" data-testid="account-settings-address">
- ${this.profileName?nt.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):nt.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
- </wui-text>
- <wui-icon-link
- size="md"
- icon="copy"
- iconColor="fg-200"
- @click=${this.onCopyAddress}
- ></wui-icon-link>
- </wui-flex>
- </wui-flex>
- </wui-flex>
- <wui-flex
- data-testid="account-settings-button"
- justifyContent="center"
- alignItems="center"
- class="account-settings-button"
- @click=${()=>X.push("AccountSettings")}
- >
- <wui-text variant="paragraph-500" color="fg-100">Account Settings</wui-text>
- </wui-flex>
- ${this.accountsTemplate()}
- </wui-flex>
- `}accountsTemplate(){return M`<wui-flex flexDirection="column">
- <wui-flex .padding=${["3xs","m","s","s"]}>
- <wui-text color="fg-200" variant="paragraph-400">Your accounts</wui-text>
- </wui-flex>
- <wui-flex flexDirection="column" gap="xxs">
- ${this.accounts.map(e=>this.accountTemplate(e))}
- </wui-flex>
- </wui-flex>`}async onSwitchAccount(e){var i;const r=(i=F.state.activeCaipNetwork)==null?void 0:i.chainNamespace;if(this.loading=!0,ge.getAuthConnector()){const s=e.type;await xe.setPreferredAccountType(s,r)}re.setShouldUpdateToAddress(e.address,r),this.loading=!1}accountTemplate(e){return M`<wui-list-account accountAddress=${e.address} accountType=${e.type}>
- ${e.address===this.address?"":M`<wui-button
- slot="action"
- textVariant="small-600"
- size="md"
- variant="accent"
- @click=${()=>this.onSwitchAccount(e)}
- .loading=${this.loading}
- >Switch</wui-button
- >`}
- </wui-list-account>`}onCopyAddress(){try{this.address&&(ue.copyToClopboard(this.address),Fe.showSuccess("Address copied"))}catch{Fe.showError("Failed to copy")}}};zu.styles=bSe;h1([G()],zu.prototype,"address",void 0);h1([G()],zu.prototype,"profileImage",void 0);h1([G()],zu.prototype,"profileName",void 0);h1([G()],zu.prototype,"accounts",void 0);h1([G()],zu.prototype,"loading",void 0);zu=h1([te("w3m-profile-view")],zu);const ySe=de`
- wui-flex {
- width: 100%;
- background-color: var(--wui-color-gray-glass-005);
- border-radius: var(--wui-border-radius-m);
- padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs)
- var(--wui-spacing-1xs);
- }
- `;var BA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Fm=class extends se{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size=""}render(){return M`
- <wui-flex gap="1xs" alignItems="center">
- <wui-avatar size=${this.size} imageSrc=${this.imageSrc}></wui-avatar>
- <wui-text variant="small-400" color="fg-200">${this.text}</wui-text>
- </wui-flex>
- `}};Fm.styles=[He,vt,ySe];BA([q()],Fm.prototype,"imageSrc",void 0);BA([q()],Fm.prototype,"text",void 0);BA([q()],Fm.prototype,"size",void 0);Fm=BA([te("wui-banner-img")],Fm);const vSe=de`
- wui-avatar {
- width: var(--wui-spacing-3xl);
- height: var(--wui-spacing-3xl);
- box-shadow: 0 0 0 0;
- }
- wui-icon-box {
- position: relative;
- right: 15px;
- top: 15px;
- border: 2px solid var(--wui-color-bg-150);
- background-color: var(--wui-color-bg-125);
- }
- `;var Q7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Hm=class extends se{constructor(){super(),this.metadata=oe.state.metadata,this.allAccounts=re.state.allAccounts||[],this.balances={},this.labels=re.state.addressLabels,this.currentAddress=re.state.address||"",this.caipNetwork=F.state.activeCaipNetwork,re.subscribeKey("allAccounts",e=>{this.allAccounts=e})}connectedCallback(){super.connectedCallback(),this.allAccounts.forEach(e=>{var r;Xe.getBalance(e.address,(r=this.caipNetwork)==null?void 0:r.caipNetworkId).then(n=>{let i=this.balances[e.address]||0;n.balances.length>0&&(i=n.balances.reduce((s,o)=>s+((o==null?void 0:o.value)||0),0)),this.balances[e.address]=i,this.requestUpdate()})})}getAddressIcon(e){return e==="smartAccount"?"lightbulb":"mail"}render(){var e,r;return M`
- <wui-flex justifyContent="center" .padding=${["xl","0","xl","0"]}>
- <wui-banner-img
- imageSrc=${we((e=this.metadata)==null?void 0:e.icons[0])}
- text=${we((r=this.metadata)==null?void 0:r.url)}
- size="sm"
- ></wui-banner-img>
- </wui-flex>
- <wui-flex flexDirection="column" gap="xxl" .padding=${["l","xl","xl","xl"]}>
- ${this.allAccounts.map((n,i)=>this.getAddressTemplate(n,i))}
- </wui-flex>
- `}getAddressTemplate(e,r){var a,c,u,l;const n=(a=this.labels)==null?void 0:a.get(e.address),i=F.state.activeChain,o=ge.getConnectorId(i)===_e.CONNECTOR_ID.AUTH;return M`
- <wui-flex
- flexDirection="row"
- justifyContent="space-between"
- data-testid="switch-address-item"
- >
- <wui-flex alignItems="center">
- <wui-avatar address=${e.address}></wui-avatar>
- ${o?M`<wui-icon-box
- size="sm"
- iconcolor="fg-200"
- backgroundcolor="glass-002"
- background="gray"
- icon="${this.getAddressIcon(e.type)}"
- ?border=${!0}
- ></wui-icon-box>`:M`<wui-flex .padding="${["0","0","0","s"]}"></wui-flex>`}
- <wui-flex flexDirection="column">
- <wui-text class="address" variant="paragraph-500" color="fg-100"
- >${n||nt.getTruncateString({string:e.address,charsStart:4,charsEnd:6,truncate:"middle"})}</wui-text
- >
- <wui-text class="address-description" variant="small-400">
- ${typeof this.balances[e.address]=="number"?`$${(c=this.balances[e.address])==null?void 0:c.toFixed(2)}`:M`<wui-loading-spinner size="sm" color="accent-100"></wui-loading-spinner>`}
- </wui-text>
- </wui-flex>
- </wui-flex>
- <wui-flex gap="s" alignItems="center">
- ${((u=e.address)==null?void 0:u.toLowerCase())===((l=this.currentAddress)==null?void 0:l.toLowerCase())?"":M`
- <wui-button
- data-testid=${`w3m-switch-address-button-${r}`}
- textVariant="small-600"
- size="md"
- variant="accent"
- @click=${()=>this.onSwitchAddress(e.address)}
- >Switch to</wui-button
- >
- `}
- </wui-flex>
- </wui-flex>
- `}onSwitchAddress(e){const r=F.state.activeCaipNetwork,n=r==null?void 0:r.chainNamespace,i=`${n}:${r==null?void 0:r.id}:${e}`;re.setCaipAddress(i,n),We.close()}};Hm.styles=vSe;Q7([G()],Hm.prototype,"allAccounts",void 0);Q7([G()],Hm.prototype,"balances",void 0);Hm=Q7([te("w3m-switch-address-view")],Hm);const _Se=de`
- :host {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- label {
- position: relative;
- display: inline-block;
- width: 32px;
- height: 22px;
- }
- input {
- width: 0;
- height: 0;
- opacity: 0;
- }
- span {
- position: absolute;
- cursor: pointer;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: var(--wui-color-blue-100);
- border-width: 1px;
- border-style: solid;
- border-color: var(--wui-color-gray-glass-002);
- border-radius: 999px;
- transition:
- background-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
- border-color var(--wui-ease-inout-power-1) var(--wui-duration-md);
- will-change: background-color, border-color;
- }
- span:before {
- position: absolute;
- content: '';
- height: 16px;
- width: 16px;
- left: 3px;
- top: 2px;
- background-color: var(--wui-color-inverse-100);
- transition: transform var(--wui-ease-inout-power-1) var(--wui-duration-lg);
- will-change: transform;
- border-radius: 50%;
- }
- input:checked + span {
- border-color: var(--wui-color-gray-glass-005);
- background-color: var(--wui-color-blue-100);
- }
- input:not(:checked) + span {
- background-color: var(--wui-color-gray-glass-010);
- }
- input:checked + span:before {
- transform: translateX(calc(100% - 7px));
- }
- `;var nQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let g6=class extends se{constructor(){super(...arguments),this.inputElementRef=ec(),this.checked=void 0}render(){return M`
- <label>
- <input
- ${tc(this.inputElementRef)}
- type="checkbox"
- ?checked=${we(this.checked)}
- @change=${this.dispatchChangeEvent.bind(this)}
- />
- <span></span>
- </label>
- `}dispatchChangeEvent(){var e;this.dispatchEvent(new CustomEvent("switchChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.checked,bubbles:!0,composed:!0}))}};g6.styles=[He,vt,qv,_Se];nQ([q({type:Boolean})],g6.prototype,"checked",void 0);g6=nQ([te("wui-switch")],g6);const ESe=de`
- :host {
- height: 100%;
- }
- button {
- display: flex;
- align-items: center;
- justify-content: center;
- column-gap: var(--wui-spacing-1xs);
- padding: var(--wui-spacing-xs) var(--wui-spacing-s);
- background-color: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xs);
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
- transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: background-color;
- cursor: pointer;
- }
- wui-switch {
- pointer-events: none;
- }
- `;var iQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let m6=class extends se{constructor(){super(...arguments),this.checked=void 0}render(){return M`
- <button>
- <wui-icon size="xl" name="walletConnectBrown"></wui-icon>
- <wui-switch ?checked=${we(this.checked)}></wui-switch>
- </button>
- `}};m6.styles=[He,vt,ESe];iQ([q({type:Boolean})],m6.prototype,"checked",void 0);m6=iQ([te("wui-certified-switch")],m6);const CSe=de`
- button {
- background-color: var(--wui-color-fg-300);
- border-radius: var(--wui-border-radius-4xs);
- width: 16px;
- height: 16px;
- }
- button:disabled {
- background-color: var(--wui-color-bg-300);
- }
- wui-icon {
- color: var(--wui-color-bg-200) !important;
- }
- button:focus-visible {
- background-color: var(--wui-color-fg-250);
- border: 1px solid var(--wui-color-accent-100);
- }
- @media (hover: hover) and (pointer: fine) {
- button:hover:enabled {
- background-color: var(--wui-color-fg-250);
- }
- button:active:enabled {
- background-color: var(--wui-color-fg-225);
- }
- }
- `;var sQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let w6=class extends se{constructor(){super(...arguments),this.icon="copy"}render(){return M`
- <button>
- <wui-icon color="inherit" size="xxs" name=${this.icon}></wui-icon>
- </button>
- `}};w6.styles=[He,vt,CSe];sQ([q()],w6.prototype,"icon",void 0);w6=sQ([te("wui-input-element")],w6);const ASe=de`
- :host {
- position: relative;
- display: inline-block;
- width: 100%;
- }
- `;var xSe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let QP=class extends se{constructor(){super(...arguments),this.inputComponentRef=ec()}render(){return M`
- <wui-input-text
- ${tc(this.inputComponentRef)}
- placeholder="Search wallet"
- icon="search"
- type="search"
- enterKeyHint="search"
- size="sm"
- >
- <wui-input-element @click=${this.clearValue} icon="close"></wui-input-element>
- </wui-input-text>
- `}clearValue(){const e=this.inputComponentRef.value,r=e==null?void 0:e.inputElementRef.value;r&&(r.value="",r.focus(),r.dispatchEvent(new Event("input")))}};QP.styles=[He,ASe];QP=xSe([te("wui-search-bar")],QP);const SSe=de`
- :host {
- display: flex;
- flex-direction: column;
- align-items: center;
- width: 104px;
- row-gap: var(--wui-spacing-xs);
- padding: var(--wui-spacing-xs) 10px;
- background-color: var(--wui-color-gray-glass-002);
- border-radius: clamp(0px, var(--wui-border-radius-xs), 20px);
- position: relative;
- }
- wui-shimmer[data-type='network'] {
- border: none;
- -webkit-clip-path: var(--wui-path-network);
- clip-path: var(--wui-path-network);
- }
- svg {
- position: absolute;
- width: 48px;
- height: 54px;
- z-index: 1;
- }
- svg > path {
- stroke: var(--wui-color-gray-glass-010);
- stroke-width: 1px;
- }
- @media (max-width: 350px) {
- :host {
- width: 100%;
- }
- }
- `;var oQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let b6=class extends se{constructor(){super(...arguments),this.type="wallet"}render(){return M`
- ${this.shimmerTemplate()}
- <wui-shimmer width="56px" height="20px" borderRadius="xs"></wui-shimmer>
- `}shimmerTemplate(){return this.type==="network"?M` <wui-shimmer
- data-type=${this.type}
- width="48px"
- height="54px"
- borderRadius="xs"
- ></wui-shimmer>
- ${eQ}`:M`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}};b6.styles=[He,vt,SSe];oQ([q()],b6.prototype,"type",void 0);b6=oQ([te("wui-card-select-loader")],b6);const TSe=de`
- :host {
- display: grid;
- width: inherit;
- height: inherit;
- }
- `;var fo=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Qi=class extends se{render(){return this.style.cssText=`
- grid-template-rows: ${this.gridTemplateRows};
- grid-template-columns: ${this.gridTemplateColumns};
- justify-items: ${this.justifyItems};
- align-items: ${this.alignItems};
- justify-content: ${this.justifyContent};
- align-content: ${this.alignContent};
- column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`};
- row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`};
- gap: ${this.gap&&`var(--wui-spacing-${this.gap})`};
- padding-top: ${this.padding&&nt.getSpacingStyles(this.padding,0)};
- padding-right: ${this.padding&&nt.getSpacingStyles(this.padding,1)};
- padding-bottom: ${this.padding&&nt.getSpacingStyles(this.padding,2)};
- padding-left: ${this.padding&&nt.getSpacingStyles(this.padding,3)};
- margin-top: ${this.margin&&nt.getSpacingStyles(this.margin,0)};
- margin-right: ${this.margin&&nt.getSpacingStyles(this.margin,1)};
- margin-bottom: ${this.margin&&nt.getSpacingStyles(this.margin,2)};
- margin-left: ${this.margin&&nt.getSpacingStyles(this.margin,3)};
- `,M`<slot></slot>`}};Qi.styles=[He,TSe];fo([q()],Qi.prototype,"gridTemplateRows",void 0);fo([q()],Qi.prototype,"gridTemplateColumns",void 0);fo([q()],Qi.prototype,"justifyItems",void 0);fo([q()],Qi.prototype,"alignItems",void 0);fo([q()],Qi.prototype,"justifyContent",void 0);fo([q()],Qi.prototype,"alignContent",void 0);fo([q()],Qi.prototype,"columnGap",void 0);fo([q()],Qi.prototype,"rowGap",void 0);fo([q()],Qi.prototype,"gap",void 0);fo([q()],Qi.prototype,"padding",void 0);fo([q()],Qi.prototype,"margin",void 0);Qi=fo([te("wui-grid")],Qi);const ISe=de`
- button {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- cursor: pointer;
- width: 104px;
- row-gap: var(--wui-spacing-xs);
- padding: var(--wui-spacing-s) var(--wui-spacing-0);
- background-color: var(--wui-color-gray-glass-002);
- border-radius: clamp(0px, var(--wui-border-radius-xs), 20px);
- transition:
- color var(--wui-duration-lg) var(--wui-ease-out-power-1),
- background-color var(--wui-duration-lg) var(--wui-ease-out-power-1),
- border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1);
- will-change: background-color, color, border-radius;
- outline: none;
- border: none;
- }
- button > wui-flex > wui-text {
- color: var(--wui-color-fg-100);
- max-width: 86px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- justify-content: center;
- }
- button > wui-flex > wui-text.certified {
- max-width: 66px;
- }
- button:hover:enabled {
- background-color: var(--wui-color-gray-glass-005);
- }
- button:disabled > wui-flex > wui-text {
- color: var(--wui-color-gray-glass-015);
- }
- [data-selected='true'] {
- background-color: var(--wui-color-accent-glass-020);
- }
- @media (hover: hover) and (pointer: fine) {
- [data-selected='true']:hover:enabled {
- background-color: var(--wui-color-accent-glass-015);
- }
- }
- [data-selected='true']:active:enabled {
- background-color: var(--wui-color-accent-glass-010);
- }
- @media (max-width: 350px) {
- button {
- width: 100%;
- }
- }
- `;var h2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let cp=class extends se{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(r=>{r.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var r,n;const e=((r=this.wallet)==null?void 0:r.badge_type)==="certified";return M`
- <button>
- ${this.imageTemplate()}
- <wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="3xs">
- <wui-text
- variant="tiny-500"
- color="inherit"
- class=${we(e?"certified":void 0)}
- >${(n=this.wallet)==null?void 0:n.name}</wui-text
- >
- ${e?M`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null}
- </wui-flex>
- </button>
- `}imageTemplate(){var e,r;return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():M`
- <wui-wallet-image
- size="md"
- imageSrc=${we(this.imageSrc)}
- name=${(e=this.wallet)==null?void 0:e.name}
- .installed=${(r=this.wallet)==null?void 0:r.installed}
- badgeSize="sm"
- >
- </wui-wallet-image>
- `}shimmerTemplate(){return M`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=pt.getWalletImage(this.wallet),!this.imageSrc&&(this.imageLoading=!0,this.imageSrc=await pt.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}};cp.styles=ISe;h2([G()],cp.prototype,"visible",void 0);h2([G()],cp.prototype,"imageSrc",void 0);h2([G()],cp.prototype,"imageLoading",void 0);h2([q()],cp.prototype,"wallet",void 0);cp=h2([te("w3m-all-wallets-list-item")],cp);const PSe=de`
- wui-grid {
- max-height: clamp(360px, 400px, 80vh);
- overflow: scroll;
- scrollbar-width: none;
- grid-auto-rows: min-content;
- grid-template-columns: repeat(auto-fill, 104px);
- }
- @media (max-width: 350px) {
- wui-grid {
- grid-template-columns: repeat(2, 1fr);
- }
- }
- wui-grid[data-scroll='false'] {
- overflow: hidden;
- }
- wui-grid::-webkit-scrollbar {
- display: none;
- }
- wui-loading-spinner {
- padding-top: var(--wui-spacing-l);
- padding-bottom: var(--wui-spacing-l);
- justify-content: center;
- grid-column: 1 / span 4;
- }
- `;var f1=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const SD="local-paginator";let Od=class extends se{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!Ne.state.wallets.length,this.wallets=Ne.state.wallets,this.recommended=Ne.state.recommended,this.featured=Ne.state.featured,this.filteredWallets=Ne.state.filteredWallets,this.unsubscribe.push(Ne.subscribeKey("wallets",e=>this.wallets=e),Ne.subscribeKey("recommended",e=>this.recommended=e),Ne.subscribeKey("featured",e=>this.featured=e),Ne.subscribeKey("filteredWallets",e=>this.filteredWallets=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var e;this.unsubscribe.forEach(r=>r()),(e=this.paginationObserver)==null||e.disconnect()}render(){return M`
- <wui-grid
- data-scroll=${!this.loading}
- .padding=${["0","s","s","s"]}
- columnGap="xxs"
- rowGap="l"
- justifyContent="space-between"
- >
- ${this.loading?this.shimmerTemplate(16):this.walletsTemplate()}
- ${this.paginationLoaderTemplate()}
- </wui-grid>
- `}async initialFetch(){var r;this.loading=!0;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("wui-grid");e&&(await Ne.fetchWalletsByPage({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.loading=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,r){return[...Array(e)].map(()=>M`
- <wui-card-select-loader type="wallet" id=${we(r)}></wui-card-select-loader>
- `)}walletsTemplate(){var n;const e=((n=this.filteredWallets)==null?void 0:n.length)>0?ue.uniqueBy([...this.featured,...this.recommended,...this.filteredWallets],"id"):ue.uniqueBy([...this.featured,...this.recommended,...this.wallets],"id");return Ou.markWalletsAsInstalled(e).map(i=>M`
- <w3m-all-wallets-list-item
- @click=${()=>this.onConnectWallet(i)}
- .wallet=${i}
- ></w3m-all-wallets-list-item>
- `)}paginationLoaderTemplate(){const{wallets:e,recommended:r,featured:n,count:i}=Ne.state,s=window.innerWidth<352?3:4,o=e.length+r.length;let c=Math.ceil(o/s)*s-o+s;return c-=e.length?n.length%s:0,i===0&&n.length>0?null:i===0||[...n,...e,...r].length<i?this.shimmerTemplate(c,SD):null}createPaginationObserver(){var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector(`#${SD}`);e&&(this.paginationObserver=new IntersectionObserver(([n])=>{if(n!=null&&n.isIntersecting&&!this.loading){const{page:i,count:s,wallets:o}=Ne.state;o.length<s&&Ne.fetchWalletsByPage({page:i+1})}}),this.paginationObserver.observe(e))}onConnectWallet(e){ge.selectWalletConnector(e)}};Od.styles=PSe;f1([G()],Od.prototype,"loading",void 0);f1([G()],Od.prototype,"wallets",void 0);f1([G()],Od.prototype,"recommended",void 0);f1([G()],Od.prototype,"featured",void 0);f1([G()],Od.prototype,"filteredWallets",void 0);Od=f1([te("w3m-all-wallets-list")],Od);const OSe=de`
- wui-grid,
- wui-loading-spinner,
- wui-flex {
- height: 360px;
- }
- wui-grid {
- overflow: scroll;
- scrollbar-width: none;
- grid-auto-rows: min-content;
- grid-template-columns: repeat(auto-fill, 104px);
- }
- wui-grid[data-scroll='false'] {
- overflow: hidden;
- }
- wui-grid::-webkit-scrollbar {
- display: none;
- }
- wui-loading-spinner {
- justify-content: center;
- align-items: center;
- }
- @media (max-width: 350px) {
- wui-grid {
- grid-template-columns: repeat(2, 1fr);
- }
- }
- `;var DA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let qm=class extends se{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?M`<wui-loading-spinner color="accent-100"></wui-loading-spinner>`:this.walletsTemplate()}async onSearch(){(this.query.trim()!==this.prevQuery.trim()||this.badge!==this.prevBadge)&&(this.prevQuery=this.query,this.prevBadge=this.badge,this.loading=!0,await Ne.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){const{search:e}=Ne.state,r=Ou.markWalletsAsInstalled(e);return e.length?M`
- <wui-grid
- data-testid="wallet-list"
- .padding=${["0","s","s","s"]}
- rowGap="l"
- columnGap="xs"
- justifyContent="space-between"
- >
- ${r.map(n=>M`
- <w3m-all-wallets-list-item
- @click=${()=>this.onConnectWallet(n)}
- .wallet=${n}
- data-testid="wallet-search-item-${n.id}"
- ></w3m-all-wallets-list-item>
- `)}
- </wui-grid>
- `:M`
- <wui-flex
- data-testid="no-wallet-found"
- justifyContent="center"
- alignItems="center"
- gap="s"
- flexDirection="column"
- >
- <wui-icon-box
- size="lg"
- iconColor="fg-200"
- backgroundColor="fg-300"
- icon="wallet"
- background="transparent"
- ></wui-icon-box>
- <wui-text data-testid="no-wallet-found-text" color="fg-200" variant="paragraph-500">
- No Wallet found
- </wui-text>
- </wui-flex>
- `}onConnectWallet(e){ge.selectWalletConnector(e)}};qm.styles=OSe;DA([G()],qm.prototype,"loading",void 0);DA([q()],qm.prototype,"query",void 0);DA([q()],qm.prototype,"badge",void 0);qm=DA([te("w3m-all-wallets-search")],qm);var X7=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Vy=class extends se{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=ue.debounce(e=>{this.search=e})}render(){const e=this.search.length>=2;return M`
- <wui-flex .padding=${["0","s","s","s"]} gap="xs">
- <wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
- <wui-certified-switch
- ?checked=${this.badge}
- @click=${this.onClick.bind(this)}
- data-testid="wui-certified-switch"
- ></wui-certified-switch>
- ${this.qrButtonTemplate()}
- </wui-flex>
- ${e||this.badge?M`<w3m-all-wallets-search
- query=${this.search}
- badge=${we(this.badge)}
- ></w3m-all-wallets-search>`:M`<w3m-all-wallets-list badge=${we(this.badge)}></w3m-all-wallets-list>`}
- `}onInputChange(e){this.onDebouncedSearch(e.detail)}onClick(){if(this.badge==="certified"){this.badge=void 0;return}this.badge="certified",Fe.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})}qrButtonTemplate(){return ue.isMobile()?M`
- <wui-icon-box
- size="lg"
- iconSize="xl"
- iconColor="accent-100"
- backgroundColor="accent-100"
- icon="qrCode"
- background="transparent"
- border
- borderColor="wui-accent-glass-010"
- @click=${this.onWalletConnectQr.bind(this)}
- ></wui-icon-box>
- `:null}onWalletConnectQr(){X.push("ConnectingWalletConnect")}};X7([G()],Vy.prototype,"search",void 0);X7([G()],Vy.prototype,"badge",void 0);Vy=X7([te("w3m-all-wallets-view")],Vy);const RSe=de`
- button {
- column-gap: var(--wui-spacing-s);
- padding: 16.5px var(--wui-spacing-l) 16.5px var(--wui-spacing-xs);
- width: 100%;
- background-color: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xs);
- color: var(--wui-color-fg-100);
- justify-content: center;
- align-items: center;
- }
- button:disabled {
- background-color: var(--wui-color-gray-glass-015);
- color: var(--wui-color-gray-glass-015);
- }
- `;var MA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let zm=class extends se{constructor(){super(...arguments),this.text="",this.disabled=!1,this.tabIdx=void 0}render(){return M`
- <button ?disabled=${this.disabled} tabindex=${we(this.tabIdx)}>
- <wui-text align="center" variant="paragraph-500" color="inherit">${this.text}</wui-text>
- </button>
- `}};zm.styles=[He,vt,RSe];MA([q()],zm.prototype,"text",void 0);MA([q({type:Boolean})],zm.prototype,"disabled",void 0);MA([q()],zm.prototype,"tabIdx",void 0);zm=MA([te("wui-list-button")],zm);const kSe=de`
- wui-separator {
- margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1);
- width: calc(100% + var(--wui-spacing-s) * 2);
- }
- wui-email-input {
- width: 100%;
- }
- form {
- width: 100%;
- display: block;
- position: relative;
- }
- wui-icon-link,
- wui-loading-spinner {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- }
- wui-icon-link {
- right: var(--wui-spacing-xs);
- }
- wui-loading-spinner {
- right: var(--wui-spacing-m);
- }
- wui-text {
- margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m);
- }
- `;var f2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let up=class extends se{constructor(){super(...arguments),this.unsubscribe=[],this.formRef=ec(),this.email="",this.loading=!1,this.error=""}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",r=>{r.key==="Enter"&&this.onSubmitEmail(r)})}render(){return M`
- <form ${tc(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
- <wui-email-input
- @focus=${this.onFocusEvent.bind(this)}
- .disabled=${this.loading}
- @inputChange=${this.onEmailInputChange.bind(this)}
- tabIdx=${we(this.tabIdx)}
- >
- </wui-email-input>
- ${this.submitButtonTemplate()}${this.loadingTemplate()}
- <input type="submit" hidden />
- </form>
- ${this.templateError()}
- `}submitButtonTemplate(){return!this.loading&&this.email.length>3?M`
- <wui-icon-link
- size="sm"
- icon="chevronRight"
- iconcolor="accent-100"
- @click=${this.onSubmitEmail.bind(this)}
- >
- </wui-icon-link>
- `:null}loadingTemplate(){return this.loading?M`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>`:null}templateError(){return this.error?M`<wui-text variant="tiny-500" color="error-100">${this.error}</wui-text>`:null}onEmailInputChange(e){this.email=e.detail.trim(),this.error=""}async onSubmitEmail(e){if(!_e.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(n=>n===F.state.activeChain)){const n=F.getFirstCaipNetworkSupportsAuthConnector();if(n){X.push("SwitchNetwork",{network:n});return}}try{if(this.loading)return;this.loading=!0,e.preventDefault();const n=ge.getAuthConnector();if(!n)throw new Error("w3m-email-login-widget: Auth connector not found");const{action:i}=await n.provider.connectEmail({email:this.email});Re.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),i==="VERIFY_OTP"?(Re.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),X.push("EmailVerifyOtp",{email:this.email})):i==="VERIFY_DEVICE"?X.push("EmailVerifyDevice",{email:this.email}):i==="CONNECT"&&(await xe.connectExternal(n,F.state.activeChain),X.replace("Account"))}catch(n){const i=ue.parseError(n);i!=null&&i.includes("Invalid email")?this.error="Invalid email. Try again.":Fe.showError(n)}finally{this.loading=!1}}onFocusEvent(){Re.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};up.styles=kSe;f2([q()],up.prototype,"tabIdx",void 0);f2([G()],up.prototype,"email",void 0);f2([G()],up.prototype,"loading",void 0);f2([G()],up.prototype,"error",void 0);up=f2([te("w3m-email-login-widget")],up);const NSe=de`
- :host {
- display: block;
- width: 100%;
- }
- button {
- width: 100%;
- height: 56px;
- background: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xs);
- }
- `;var LA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Wm=class extends se{constructor(){super(...arguments),this.logo="google",this.disabled=!1,this.tabIdx=void 0}render(){return M`
- <button ?disabled=${this.disabled} tabindex=${we(this.tabIdx)}>
- <wui-logo logo=${this.logo}></wui-logo>
- </button>
- `}};Wm.styles=[He,vt,NSe];LA([q()],Wm.prototype,"logo",void 0);LA([q({type:Boolean})],Wm.prototype,"disabled",void 0);LA([q()],Wm.prototype,"tabIdx",void 0);Wm=LA([te("wui-logo-select")],Wm);const $Se=de`
- wui-separator {
- margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-m)
- calc(var(--wui-spacing-m) * -1);
- width: calc(100% + var(--wui-spacing-s) * 2);
- }
- `;var Bp=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const TD=2,ID=6;let Wu=class extends se{constructor(){super(),this.unsubscribe=[],this.walletGuide="get-started",this.tabIdx=void 0,this.connectors=ge.state.connectors,this.remoteFeatures=oe.state.remoteFeatures,this.authConnector=this.connectors.find(e=>e.type==="AUTH"),this.isPwaLoading=!1,this.unsubscribe.push(ge.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(r=>r.type==="AUTH")}),oe.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}connectedCallback(){super.connectedCallback(),this.handlePwaFrameLoad()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return M`
- <wui-flex
- class="container"
- flexDirection="column"
- gap="xs"
- data-testid="w3m-social-login-widget"
- >
- ${this.topViewTemplate()}${this.bottomViewTemplate()}
- </wui-flex>
- `}topViewTemplate(){var n;const e=this.walletGuide==="explore";let r=(n=this.remoteFeatures)==null?void 0:n.socials;return!r&&e?(r=ct.DEFAULT_SOCIALS,this.renderTopViewContent(r)):r?this.renderTopViewContent(r):null}renderTopViewContent(e){return e.length===2?M` <wui-flex gap="xs">
- ${e.slice(0,TD).map(r=>M`<wui-logo-select
- data-testid=${`social-selector-${r}`}
- @click=${()=>{this.onSocialClick(r)}}
- logo=${r}
- tabIdx=${we(this.tabIdx)}
- ?disabled=${this.isPwaLoading}
- ></wui-logo-select>`)}
- </wui-flex>`:M` <wui-list-social
- data-testid=${`social-selector-${e[0]}`}
- @click=${()=>{this.onSocialClick(e[0])}}
- logo=${we(e[0])}
- align="center"
- name=${`Continue with ${e[0]}`}
- tabIdx=${we(this.tabIdx)}
- ?disabled=${this.isPwaLoading}
- ></wui-list-social>`}bottomViewTemplate(){var i;let e=(i=this.remoteFeatures)==null?void 0:i.socials;const r=this.walletGuide==="explore";return(!this.authConnector||!e||e.length===0)&&r&&(e=ct.DEFAULT_SOCIALS),!e||e.length<=TD?null:e&&e.length>ID?M`<wui-flex gap="xs">
- ${e.slice(1,ID-1).map(s=>M`<wui-logo-select
- data-testid=${`social-selector-${s}`}
- @click=${()=>{this.onSocialClick(s)}}
- logo=${s}
- tabIdx=${we(this.tabIdx)}
- ?focusable=${this.tabIdx!==void 0&&this.tabIdx>=0}
- ?disabled=${this.isPwaLoading}
- ></wui-logo-select>`)}
- <wui-logo-select
- logo="more"
- tabIdx=${we(this.tabIdx)}
- @click=${this.onMoreSocialsClick.bind(this)}
- ?disabled=${this.isPwaLoading}
- data-testid="social-selector-more"
- ></wui-logo-select>
- </wui-flex>`:e?M`<wui-flex gap="xs">
- ${e.slice(1,e.length).map(s=>M`<wui-logo-select
- data-testid=${`social-selector-${s}`}
- @click=${()=>{this.onSocialClick(s)}}
- logo=${s}
- tabIdx=${we(this.tabIdx)}
- ?focusable=${this.tabIdx!==void 0&&this.tabIdx>=0}
- ?disabled=${this.isPwaLoading}
- ></wui-logo-select>`)}
- </wui-flex>`:null}onMoreSocialsClick(){X.push("ConnectSocials")}async onSocialClick(e){if(!_e.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(n=>n===F.state.activeChain)){const n=F.getFirstCaipNetworkSupportsAuthConnector();if(n){X.push("SwitchNetwork",{network:n});return}}e&&await OZ(e)}async handlePwaFrameLoad(){var e;if(ue.isPWA()){this.isPwaLoading=!0;try{((e=this.authConnector)==null?void 0:e.provider)instanceof s7&&await this.authConnector.provider.init()}catch(r){Fn.open({shortMessage:"Error loading embedded wallet in PWA",longMessage:r.message},"error")}finally{this.isPwaLoading=!1}}}};Wu.styles=$Se;Bp([q()],Wu.prototype,"walletGuide",void 0);Bp([q()],Wu.prototype,"tabIdx",void 0);Bp([G()],Wu.prototype,"connectors",void 0);Bp([G()],Wu.prototype,"remoteFeatures",void 0);Bp([G()],Wu.prototype,"authConnector",void 0);Bp([G()],Wu.prototype,"isPwaLoading",void 0);Wu=Bp([te("w3m-social-login-widget")],Wu);const jSe=de`
- wui-flex {
- width: 100%;
- }
- .wallet-guide {
- width: 100%;
- }
- .chip-box {
- width: fit-content;
- background-color: var(--wui-color-gray-glass-005);
- border-radius: var(--wui-border-radius-3xl);
- }
- `;var eO=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Gy=class extends se{constructor(){super(...arguments),this.walletGuide="get-started"}render(){return this.walletGuide==="explore"?M`<wui-flex
- class="wallet-guide"
- flexDirection="column"
- alignItems="center"
- justifyContent="center"
- rowGap="xs"
- data-testid="w3m-wallet-guide-explore"
- >
- <wui-text variant="small-400" color="fg-200" align="center">
- Looking for a self-custody wallet?
- </wui-text>
- <wui-flex class="chip-box">
- <wui-chip
- imageIcon="walletConnectLightBrown"
- icon="externalLink"
- variant="transparent"
- href="https://walletguide.walletconnect.network"
- title="Find one on WalletGuide"
- ></wui-chip>
- </wui-flex>
- </wui-flex>`:M`<wui-flex
- columnGap="4xs"
- flexDirection="row"
- alignItems="center"
- justifyContent="center"
- .padding=${["s","0","s","0"]}
- >
- <wui-text variant="small-400" class="title" color="fg-200"
- >Haven't got a wallet?</wui-text
- >
- <wui-link
- data-testid="w3m-wallet-guide-get-started"
- color="blue-100"
- class="get-started-link"
- @click=${this.onGetStarted}
- tabIdx=${we(this.tabIdx)}
- >
- Get started
- </wui-link>
- </wui-flex>`}onGetStarted(){X.push("Create")}};Gy.styles=jSe;eO([q()],Gy.prototype,"tabIdx",void 0);eO([q()],Gy.prototype,"walletGuide",void 0);Gy=eO([te("w3m-wallet-guide")],Gy);const BSe=de`
- :host {
- position: relative;
- border-radius: var(--wui-border-radius-xxs);
- width: 40px;
- height: 40px;
- overflow: hidden;
- background: var(--wui-color-gray-glass-002);
- display: flex;
- justify-content: center;
- align-items: center;
- flex-wrap: wrap;
- gap: var(--wui-spacing-4xs);
- padding: 3.75px !important;
- }
- :host::after {
- content: '';
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- border-radius: inherit;
- border: 1px solid var(--wui-color-gray-glass-010);
- pointer-events: none;
- }
- :host > wui-wallet-image {
- width: 14px;
- height: 14px;
- border-radius: var(--wui-border-radius-5xs);
- }
- :host > wui-flex {
- padding: 2px;
- position: fixed;
- overflow: hidden;
- left: 34px;
- bottom: 8px;
- background: var(--dark-background-150, #1e1f1f);
- border-radius: 50%;
- z-index: 2;
- display: flex;
- }
- `;var aQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const oT=4;let y6=class extends se{constructor(){super(...arguments),this.walletImages=[]}render(){const e=this.walletImages.length<oT;return M`${this.walletImages.slice(0,oT).map(({src:r,walletName:n})=>M`
- <wui-wallet-image
- size="inherit"
- imageSrc=${r}
- name=${we(n)}
- ></wui-wallet-image>
- `)}
- ${e?[...Array(oT-this.walletImages.length)].map(()=>M` <wui-wallet-image size="inherit" name=""></wui-wallet-image>`):null}
- <wui-flex>
- <wui-icon-box
- size="xxs"
- iconSize="xxs"
- iconcolor="success-100"
- backgroundcolor="success-100"
- icon="checkmark"
- background="opaque"
- ></wui-icon-box>
- </wui-flex>`}};y6.styles=[He,BSe];aQ([q({type:Array})],y6.prototype,"walletImages",void 0);y6=aQ([te("wui-all-wallets-image")],y6);const DSe=de`
- button {
- column-gap: var(--wui-spacing-s);
- padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
- width: 100%;
- background-color: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xs);
- color: var(--wui-color-fg-100);
- }
- button > wui-text:nth-child(2) {
- display: flex;
- flex: 1;
- }
- button:disabled {
- background-color: var(--wui-color-gray-glass-015);
- color: var(--wui-color-gray-glass-015);
- }
- button:disabled > wui-tag {
- background-color: var(--wui-color-gray-glass-010);
- color: var(--wui-color-fg-300);
- }
- wui-icon {
- color: var(--wui-color-fg-200) !important;
- }
- `;var ts=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let ii=class extends se{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.tabIdx=void 0,this.installed=!1,this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100"}render(){return M`
- <button ?disabled=${this.disabled} tabindex=${we(this.tabIdx)}>
- ${this.templateAllWallets()} ${this.templateWalletImage()}
- <wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text>
- ${this.templateStatus()}
- </button>
- `}templateAllWallets(){return this.showAllWallets&&this.imageSrc?M` <wui-all-wallets-image .imageeSrc=${this.imageSrc}> </wui-all-wallets-image> `:this.showAllWallets&&this.walletIcon?M` <wui-wallet-image .walletIcon=${this.walletIcon} size="sm"> </wui-wallet-image> `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?M`<wui-wallet-image
- size="sm"
- imageSrc=${this.imageSrc}
- name=${this.name}
- .installed=${this.installed}
- ></wui-wallet-image>`:!this.showAllWallets&&!this.imageSrc?M`<wui-wallet-image size="sm" name=${this.name}></wui-wallet-image>`:null}templateStatus(){return this.loading?M`<wui-loading-spinner
- size="lg"
- color=${this.loadingSpinnerColor}
- ></wui-loading-spinner>`:this.tagLabel&&this.tagVariant?M`<wui-tag variant=${this.tagVariant}>${this.tagLabel}</wui-tag>`:this.icon?M`<wui-icon color="inherit" size="sm" name=${this.icon}></wui-icon>`:null}};ii.styles=[He,vt,DSe];ts([q({type:Array})],ii.prototype,"walletImages",void 0);ts([q()],ii.prototype,"imageSrc",void 0);ts([q()],ii.prototype,"name",void 0);ts([q()],ii.prototype,"tagLabel",void 0);ts([q()],ii.prototype,"tagVariant",void 0);ts([q()],ii.prototype,"icon",void 0);ts([q()],ii.prototype,"walletIcon",void 0);ts([q()],ii.prototype,"tabIdx",void 0);ts([q({type:Boolean})],ii.prototype,"installed",void 0);ts([q({type:Boolean})],ii.prototype,"disabled",void 0);ts([q({type:Boolean})],ii.prototype,"showAllWallets",void 0);ts([q({type:Boolean})],ii.prototype,"loading",void 0);ts([q({type:String})],ii.prototype,"loadingSpinnerColor",void 0);ii=ts([te("wui-list-wallet")],ii);var p1=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let lp=class extends se{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=ge.state.connectors,this.count=Ne.state.count,this.filteredCount=Ne.state.filteredWallets.length,this.isFetchingRecommendedWallets=Ne.state.isFetchingRecommendedWallets,this.unsubscribe.push(ge.subscribeKey("connectors",e=>this.connectors=e),Ne.subscribeKey("count",e=>this.count=e),Ne.subscribeKey("filteredWallets",e=>this.filteredCount=e.length),Ne.subscribeKey("isFetchingRecommendedWallets",e=>this.isFetchingRecommendedWallets=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.find(c=>c.id==="walletConnect"),{allWallets:r}=oe.state;if(!e||r==="HIDE"||r==="ONLY_MOBILE"&&!ue.isMobile())return null;const n=Ne.state.featured.length,i=this.count+n,s=i<10?i:Math.floor(i/10)*10,o=this.filteredCount>0?this.filteredCount:s;let a=`${o}`;return this.filteredCount>0?a=`${this.filteredCount}`:o<i&&(a=`${o}+`),M`
- <wui-list-wallet
- name="All Wallets"
- walletIcon="allWallets"
- showAllWallets
- @click=${this.onAllWallets.bind(this)}
- tagLabel=${a}
- tagVariant="shade"
- data-testid="all-wallets"
- tabIdx=${we(this.tabIdx)}
- .loading=${this.isFetchingRecommendedWallets}
- loadingSpinnerColor=${this.isFetchingRecommendedWallets?"fg-300":"accent-100"}
- ></wui-list-wallet>
- `}onAllWallets(){Re.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),X.push("AllWallets")}};p1([q()],lp.prototype,"tabIdx",void 0);p1([G()],lp.prototype,"connectors",void 0);p1([G()],lp.prototype,"count",void 0);p1([G()],lp.prototype,"filteredCount",void 0);p1([G()],lp.prototype,"isFetchingRecommendedWallets",void 0);lp=p1([te("w3m-all-wallets-widget")],lp);var tO=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let v6=class extends se{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=ge.state.connectors,this.unsubscribe.push(ge.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(r=>r.type==="ANNOUNCED");return e!=null&&e.length?M`
- <wui-flex flexDirection="column" gap="xs">
- ${e.filter(xu.showConnector).map(r=>M`
- <wui-list-wallet
- imageSrc=${we(pt.getConnectorImage(r))}
- name=${r.name??"Unknown"}
- @click=${()=>this.onConnector(r)}
- tagVariant="success"
- tagLabel="installed"
- data-testid=${`wallet-selector-${r.id}`}
- .installed=${!0}
- tabIdx=${we(this.tabIdx)}
- >
- </wui-list-wallet>
- `)}
- </wui-flex>
- `:(this.style.cssText="display: none",null)}onConnector(e){e.id==="walletConnect"?ue.isMobile()?X.push("AllWallets"):X.push("ConnectingWalletConnect"):X.push("ConnectingExternal",{connector:e})}};tO([q()],v6.prototype,"tabIdx",void 0);tO([G()],v6.prototype,"connectors",void 0);v6=tO([te("w3m-connect-announced-widget")],v6);var UA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Ky=class extends se{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=ge.state.connectors,this.loading=!1,this.unsubscribe.push(ge.subscribeKey("connectors",e=>this.connectors=e)),ue.isTelegram()&&ue.isIos()&&(this.loading=!xe.state.wcUri,this.unsubscribe.push(xe.subscribeKey("wcUri",e=>this.loading=!e)))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{customWallets:e}=oe.state;if(!(e!=null&&e.length))return this.style.cssText="display: none",null;const r=this.filterOutDuplicateWallets(e);return M`<wui-flex flexDirection="column" gap="xs">
- ${r.map(n=>M`
- <wui-list-wallet
- imageSrc=${we(pt.getWalletImage(n))}
- name=${n.name??"Unknown"}
- @click=${()=>this.onConnectWallet(n)}
- data-testid=${`wallet-selector-${n.id}`}
- tabIdx=${we(this.tabIdx)}
- ?loading=${this.loading}
- >
- </wui-list-wallet>
- `)}
- </wui-flex>`}filterOutDuplicateWallets(e){const r=Le.getRecentWallets(),n=this.connectors.map(a=>{var c;return(c=a.info)==null?void 0:c.rdns}).filter(Boolean),i=r.map(a=>a.rdns).filter(Boolean),s=n.concat(i);if(s.includes("io.metamask.mobile")&&ue.isMobile()){const a=s.indexOf("io.metamask.mobile");s[a]="io.metamask"}return e.filter(a=>!s.includes(String(a==null?void 0:a.rdns)))}onConnectWallet(e){this.loading||X.push("ConnectingWalletConnect",{wallet:e})}};UA([q()],Ky.prototype,"tabIdx",void 0);UA([G()],Ky.prototype,"connectors",void 0);UA([G()],Ky.prototype,"loading",void 0);Ky=UA([te("w3m-connect-custom-widget")],Ky);var rO=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let _6=class extends se{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=ge.state.connectors,this.unsubscribe.push(ge.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const n=this.connectors.filter(i=>i.type==="EXTERNAL").filter(xu.showConnector).filter(i=>i.id!==_e.CONNECTOR_ID.COINBASE_SDK);return n!=null&&n.length?M`
- <wui-flex flexDirection="column" gap="xs">
- ${n.map(i=>M`
- <wui-list-wallet
- imageSrc=${we(pt.getConnectorImage(i))}
- .installed=${!0}
- name=${i.name??"Unknown"}
- data-testid=${`wallet-selector-external-${i.id}`}
- @click=${()=>this.onConnector(i)}
- tabIdx=${we(this.tabIdx)}
- >
- </wui-list-wallet>
- `)}
- </wui-flex>
- `:(this.style.cssText="display: none",null)}onConnector(e){X.push("ConnectingExternal",{connector:e})}};rO([q()],_6.prototype,"tabIdx",void 0);rO([G()],_6.prototype,"connectors",void 0);_6=rO([te("w3m-connect-external-widget")],_6);var nO=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let E6=class extends se{constructor(){super(...arguments),this.tabIdx=void 0,this.wallets=[]}render(){return this.wallets.length?M`
- <wui-flex flexDirection="column" gap="xs">
- ${this.wallets.map(e=>M`
- <wui-list-wallet
- data-testid=${`wallet-selector-featured-${e.id}`}
- imageSrc=${we(pt.getWalletImage(e))}
- name=${e.name??"Unknown"}
- @click=${()=>this.onConnectWallet(e)}
- tabIdx=${we(this.tabIdx)}
- >
- </wui-list-wallet>
- `)}
- </wui-flex>
- `:(this.style.cssText="display: none",null)}onConnectWallet(e){ge.selectWalletConnector(e)}};nO([q()],E6.prototype,"tabIdx",void 0);nO([q()],E6.prototype,"wallets",void 0);E6=nO([te("w3m-connect-featured-widget")],E6);var iO=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let C6=class extends se{constructor(){super(...arguments),this.tabIdx=void 0,this.connectors=[]}render(){const e=this.connectors.filter(xu.showConnector);return e.length===0?(this.style.cssText="display: none",null):M`
- <wui-flex flexDirection="column" gap="xs">
- ${e.map(r=>M`
- <wui-list-wallet
- imageSrc=${we(pt.getConnectorImage(r))}
- .installed=${!0}
- name=${r.name??"Unknown"}
- tagVariant="success"
- tagLabel="installed"
- data-testid=${`wallet-selector-${r.id}`}
- @click=${()=>this.onConnector(r)}
- tabIdx=${we(this.tabIdx)}
- >
- </wui-list-wallet>
- `)}
- </wui-flex>
- `}onConnector(e){ge.setActiveConnector(e),X.push("ConnectingExternal",{connector:e})}};iO([q()],C6.prototype,"tabIdx",void 0);iO([q()],C6.prototype,"connectors",void 0);C6=iO([te("w3m-connect-injected-widget")],C6);var sO=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let A6=class extends se{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=ge.state.connectors,this.unsubscribe.push(ge.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(r=>r.type==="MULTI_CHAIN"&&r.name!=="WalletConnect");return e!=null&&e.length?M`
- <wui-flex flexDirection="column" gap="xs">
- ${e.map(r=>M`
- <wui-list-wallet
- imageSrc=${we(pt.getConnectorImage(r))}
- .installed=${!0}
- name=${r.name??"Unknown"}
- tagVariant="shade"
- tagLabel="multichain"
- data-testid=${`wallet-selector-${r.id}`}
- @click=${()=>this.onConnector(r)}
- tabIdx=${we(this.tabIdx)}
- >
- </wui-list-wallet>
- `)}
- </wui-flex>
- `:(this.style.cssText="display: none",null)}onConnector(e){ge.setActiveConnector(e),X.push("ConnectingMultiChain")}};sO([q()],A6.prototype,"tabIdx",void 0);sO([G()],A6.prototype,"connectors",void 0);A6=sO([te("w3m-connect-multi-chain-widget")],A6);var FA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Zy=class extends se{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=ge.state.connectors,this.loading=!1,this.unsubscribe.push(ge.subscribeKey("connectors",e=>this.connectors=e)),ue.isTelegram()&&ue.isIos()&&(this.loading=!xe.state.wcUri,this.unsubscribe.push(xe.subscribeKey("wcUri",e=>this.loading=!e)))}render(){const r=Le.getRecentWallets().filter(n=>!Ou.isExcluded(n)).filter(n=>!this.hasWalletConnector(n)).filter(n=>this.isWalletCompatibleWithCurrentChain(n));return r.length?M`
- <wui-flex flexDirection="column" gap="xs">
- ${r.map(n=>M`
- <wui-list-wallet
- imageSrc=${we(pt.getWalletImage(n))}
- name=${n.name??"Unknown"}
- @click=${()=>this.onConnectWallet(n)}
- tagLabel="recent"
- tagVariant="shade"
- tabIdx=${we(this.tabIdx)}
- ?loading=${this.loading}
- >
- </wui-list-wallet>
- `)}
- </wui-flex>
- `:(this.style.cssText="display: none",null)}onConnectWallet(e){this.loading||ge.selectWalletConnector(e)}hasWalletConnector(e){return this.connectors.some(r=>r.id===e.id||r.name===e.name)}isWalletCompatibleWithCurrentChain(e){const r=F.state.activeChain;return r&&e.chains?e.chains.some(n=>{const i=n.split(":")[0];return r===i}):!0}};FA([q()],Zy.prototype,"tabIdx",void 0);FA([G()],Zy.prototype,"connectors",void 0);FA([G()],Zy.prototype,"loading",void 0);Zy=FA([te("w3m-connect-recent-widget")],Zy);var HA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Yy=class extends se{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.wallets=[],this.loading=!1,ue.isTelegram()&&ue.isIos()&&(this.loading=!xe.state.wcUri,this.unsubscribe.push(xe.subscribeKey("wcUri",e=>this.loading=!e)))}render(){const{connectors:e}=ge.state,{customWallets:r,featuredWalletIds:n}=oe.state,i=Le.getRecentWallets(),s=e.find(d=>d.id==="walletConnect"),a=e.filter(d=>d.type==="INJECTED"||d.type==="ANNOUNCED"||d.type==="MULTI_CHAIN").filter(d=>d.name!=="Browser Wallet");if(!s)return null;if(n||r||!this.wallets.length)return this.style.cssText="display: none",null;const c=a.length+i.length,u=Math.max(0,2-c),l=Ou.filterOutDuplicateWallets(this.wallets).slice(0,u);return l.length?M`
- <wui-flex flexDirection="column" gap="xs">
- ${l.map(d=>M`
- <wui-list-wallet
- imageSrc=${we(pt.getWalletImage(d))}
- name=${(d==null?void 0:d.name)??"Unknown"}
- @click=${()=>this.onConnectWallet(d)}
- tabIdx=${we(this.tabIdx)}
- ?loading=${this.loading}
- >
- </wui-list-wallet>
- `)}
- </wui-flex>
- `:(this.style.cssText="display: none",null)}onConnectWallet(e){if(this.loading)return;const r=ge.getConnector(e.id,e.rdns);r?X.push("ConnectingExternal",{connector:r}):X.push("ConnectingWalletConnect",{wallet:e})}};HA([q()],Yy.prototype,"tabIdx",void 0);HA([q()],Yy.prototype,"wallets",void 0);HA([G()],Yy.prototype,"loading",void 0);Yy=HA([te("w3m-connect-recommended-widget")],Yy);var qA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Jy=class extends se{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=ge.state.connectors,this.connectorImages=er.state.connectorImages,this.unsubscribe.push(ge.subscribeKey("connectors",e=>this.connectors=e),er.subscribeKey("connectorImages",e=>this.connectorImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(ue.isMobile())return this.style.cssText="display: none",null;const e=this.connectors.find(n=>n.id==="walletConnect");if(!e)return this.style.cssText="display: none",null;const r=e.imageUrl||this.connectorImages[(e==null?void 0:e.imageId)??""];return M`
- <wui-list-wallet
- imageSrc=${we(r)}
- name=${e.name??"Unknown"}
- @click=${()=>this.onConnector(e)}
- tagLabel="qr code"
- tagVariant="main"
- tabIdx=${we(this.tabIdx)}
- data-testid="wallet-selector-walletconnect"
- >
- </wui-list-wallet>
- `}onConnector(e){ge.setActiveConnector(e),X.push("ConnectingWalletConnect")}};qA([q()],Jy.prototype,"tabIdx",void 0);qA([G()],Jy.prototype,"connectors",void 0);qA([G()],Jy.prototype,"connectorImages",void 0);Jy=qA([te("w3m-connect-walletconnect-widget")],Jy);const MSe=de`
- :host {
- margin-top: var(--wui-spacing-3xs);
- }
- wui-separator {
- margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
- calc(var(--wui-spacing-m) * -1);
- width: calc(100% + var(--wui-spacing-s) * 2);
- }
- `;var p2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let dp=class extends se{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=ge.state.connectors,this.recommended=Ne.state.recommended,this.featured=Ne.state.featured,this.unsubscribe.push(ge.subscribeKey("connectors",e=>this.connectors=e),Ne.subscribeKey("recommended",e=>this.recommended=e),Ne.subscribeKey("featured",e=>this.featured=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return M`
- <wui-flex flexDirection="column" gap="xs"> ${this.connectorListTemplate()} </wui-flex>
- `}connectorListTemplate(){const{custom:e,recent:r,announced:n,injected:i,multiChain:s,recommended:o,featured:a,external:c}=xu.getConnectorsByType(this.connectors,this.recommended,this.featured);return xu.getConnectorTypeOrder({custom:e,recent:r,announced:n,injected:i,multiChain:s,recommended:o,featured:a,external:c}).map(l=>{switch(l){case"injected":return M`
- ${s.length?M`<w3m-connect-multi-chain-widget
- tabIdx=${we(this.tabIdx)}
- ></w3m-connect-multi-chain-widget>`:null}
- ${n.length?M`<w3m-connect-announced-widget
- tabIdx=${we(this.tabIdx)}
- ></w3m-connect-announced-widget>`:null}
- ${i.length?M`<w3m-connect-injected-widget
- .connectors=${i}
- tabIdx=${we(this.tabIdx)}
- ></w3m-connect-injected-widget>`:null}
- `;case"walletConnect":return M`<w3m-connect-walletconnect-widget
- tabIdx=${we(this.tabIdx)}
- ></w3m-connect-walletconnect-widget>`;case"recent":return M`<w3m-connect-recent-widget
- tabIdx=${we(this.tabIdx)}
- ></w3m-connect-recent-widget>`;case"featured":return M`<w3m-connect-featured-widget
- .wallets=${a}
- tabIdx=${we(this.tabIdx)}
- ></w3m-connect-featured-widget>`;case"custom":return M`<w3m-connect-custom-widget
- tabIdx=${we(this.tabIdx)}
- ></w3m-connect-custom-widget>`;case"external":return M`<w3m-connect-external-widget
- tabIdx=${we(this.tabIdx)}
- ></w3m-connect-external-widget>`;case"recommended":return M`<w3m-connect-recommended-widget
- .wallets=${o}
- tabIdx=${we(this.tabIdx)}
- ></w3m-connect-recommended-widget>`;default:return console.warn(`Unknown connector type: ${l}`),null}})}};dp.styles=MSe;p2([q()],dp.prototype,"tabIdx",void 0);p2([G()],dp.prototype,"connectors",void 0);p2([G()],dp.prototype,"recommended",void 0);p2([G()],dp.prototype,"featured",void 0);dp=p2([te("w3m-connector-list")],dp);var cQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let XP=class extends se{constructor(){super(...arguments),this.tabIdx=void 0}render(){return M`
- <wui-flex flexDirection="column" gap="xs">
- <w3m-connector-list tabIdx=${we(this.tabIdx)}></w3m-connector-list>
- <w3m-all-wallets-widget tabIdx=${we(this.tabIdx)}></w3m-all-wallets-widget>
- </wui-flex>
- `}};cQ([q()],XP.prototype,"tabIdx",void 0);XP=cQ([te("w3m-wallet-login-list")],XP);const LSe=de`
- :host {
- --connect-scroll--top-opacity: 0;
- --connect-scroll--bottom-opacity: 0;
- --connect-mask-image: none;
- }
- .connect {
- max-height: clamp(360px, 470px, 80vh);
- scrollbar-width: none;
- overflow-y: scroll;
- overflow-x: hidden;
- transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: opacity;
- mask-image: var(--connect-mask-image);
- }
- .guide {
- transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: opacity;
- }
- .connect::-webkit-scrollbar {
- display: none;
- }
- .all-wallets {
- flex-flow: column;
- }
- .connect.disabled,
- .guide.disabled {
- opacity: 0.3;
- pointer-events: none;
- user-select: none;
- }
- wui-separator {
- margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1);
- width: calc(100% + var(--wui-spacing-s) * 2);
- }
- `;var po=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const USe=470;let Ii=class extends se{constructor(){var e,r;super(),this.unsubscribe=[],this.connectors=ge.state.connectors,this.authConnector=this.connectors.find(n=>n.type==="AUTH"),this.features=oe.state.features,this.remoteFeatures=oe.state.remoteFeatures,this.enableWallets=oe.state.enableWallets,this.noAdapters=F.state.noAdapters,this.walletGuide="get-started",this.checked=As.state.isLegalCheckboxChecked,this.isEmailEnabled=((e=this.remoteFeatures)==null?void 0:e.email)&&!F.state.noAdapters,this.isSocialEnabled=((r=this.remoteFeatures)==null?void 0:r.socials)&&this.remoteFeatures.socials.length>0&&!F.state.noAdapters,this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors),this.unsubscribe.push(ge.subscribeKey("connectors",n=>{this.connectors=n,this.authConnector=this.connectors.find(i=>i.type==="AUTH"),this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors)}),oe.subscribeKey("features",n=>{this.features=n}),oe.subscribeKey("remoteFeatures",n=>{this.remoteFeatures=n,this.setEmailAndSocialEnableCheck(this.noAdapters,this.remoteFeatures)}),oe.subscribeKey("enableWallets",n=>this.enableWallets=n),F.subscribeKey("noAdapters",n=>this.setEmailAndSocialEnableCheck(n,this.remoteFeatures)),As.subscribeKey("isLegalCheckboxChecked",n=>this.checked=n))}disconnectedCallback(){var r,n;this.unsubscribe.forEach(i=>i()),(r=this.resizeObserver)==null||r.disconnect();const e=(n=this.shadowRoot)==null?void 0:n.querySelector(".connect");e==null||e.removeEventListener("scroll",this.handleConnectListScroll.bind(this))}firstUpdated(){var r,n;const e=(r=this.shadowRoot)==null?void 0:r.querySelector(".connect");e&&(requestAnimationFrame(this.handleConnectListScroll.bind(this)),e==null||e.addEventListener("scroll",this.handleConnectListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleConnectListScroll()}),(n=this.resizeObserver)==null||n.observe(e),this.handleConnectListScroll())}render(){var h;const{termsConditionsUrl:e,privacyPolicyUrl:r}=oe.state,n=(h=oe.state.features)==null?void 0:h.legalCheckbox,o=!!(e||r)&&!!n&&this.walletGuide==="get-started"&&!this.checked,a={connect:!0,disabled:o},c=oe.state.enableWalletGuide,u=this.enableWallets,l=this.isSocialEnabled||this.authConnector,d=o?-1:void 0;return M`
- <wui-flex flexDirection="column">
- ${this.legalCheckboxTemplate()}
- <wui-flex
- data-testid="w3m-connect-scroll-view"
- flexDirection="column"
- class=${r6(a)}
- >
- <wui-flex
- class="connect-methods"
- flexDirection="column"
- gap="s"
- .padding=${l&&u&&c&&this.walletGuide==="get-started"?["3xs","s","0","s"]:["3xs","s","s","s"]}
- >
- ${this.renderConnectMethod(d)}
- </wui-flex>
- </wui-flex>
- ${this.guideTemplate(o)}
- <w3m-legal-footer></w3m-legal-footer>
- </wui-flex>
- `}setEmailAndSocialEnableCheck(e,r){this.isEmailEnabled=(r==null?void 0:r.email)&&!e,this.isSocialEnabled=(r==null?void 0:r.socials)&&r.socials.length>0&&!e,this.remoteFeatures=r,this.noAdapters=e}checkIfAuthEnabled(e){const r=e.filter(i=>i.type===Xt.CONNECTOR_TYPE_AUTH).map(i=>i.chain);return _e.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(i=>r.includes(i))}renderConnectMethod(e){const r=Ou.getConnectOrderMethod(this.features,this.connectors);return M`${r.map((n,i)=>{switch(n){case"email":return M`${this.emailTemplate(e)} ${this.separatorTemplate(i,"email")}`;case"social":return M`${this.socialListTemplate(e)}
- ${this.separatorTemplate(i,"social")}`;case"wallet":return M`${this.walletListTemplate(e)}
- ${this.separatorTemplate(i,"wallet")}`;default:return null}})}`}checkMethodEnabled(e){switch(e){case"wallet":return this.enableWallets;case"social":return this.isSocialEnabled&&this.isAuthEnabled;case"email":return this.isEmailEnabled&&this.isAuthEnabled;default:return null}}checkIsThereNextMethod(e){const n=Ou.getConnectOrderMethod(this.features,this.connectors)[e+1];return n?this.checkMethodEnabled(n)?n:this.checkIsThereNextMethod(e+1):void 0}separatorTemplate(e,r){const n=this.checkIsThereNextMethod(e),i=this.walletGuide==="explore";switch(r){case"wallet":return this.enableWallets&&n&&!i?M`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null;case"email":{const s=n==="social";return this.isAuthEnabled&&this.isEmailEnabled&&!s&&n?M`<wui-separator
- data-testid="w3m-email-login-or-separator"
- text="or"
- ></wui-separator>`:null}case"social":{const s=n==="email";return this.isAuthEnabled&&this.isSocialEnabled&&!s&&n?M`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null}default:return null}}emailTemplate(e){return!this.isEmailEnabled||!this.isAuthEnabled?null:M`<w3m-email-login-widget
- walletGuide=${this.walletGuide}
- tabIdx=${we(e)}
- ></w3m-email-login-widget>`}socialListTemplate(e){return!this.isSocialEnabled||!this.isAuthEnabled?null:M`<w3m-social-login-widget
- walletGuide=${this.walletGuide}
- tabIdx=${we(e)}
- ></w3m-social-login-widget>`}walletListTemplate(e){var a,c;const r=this.enableWallets,n=((a=this.features)==null?void 0:a.emailShowWallets)===!1,i=(c=this.features)==null?void 0:c.collapseWallets,s=n||i;return!r||(ue.isTelegram()&&(ue.isSafari()||ue.isIos())&&xe.connectWalletConnect().catch(u=>({})),this.walletGuide==="explore")?null:this.isAuthEnabled&&(this.isEmailEnabled||this.isSocialEnabled)&&s?M`<wui-list-button
- data-testid="w3m-collapse-wallets-button"
- tabIdx=${we(e)}
- @click=${this.onContinueWalletClick.bind(this)}
- text="Continue with a wallet"
- ></wui-list-button>`:M`<w3m-wallet-login-list tabIdx=${we(e)}></w3m-wallet-login-list>`}guideTemplate(e=!1){if(!oe.state.enableWalletGuide)return null;const n={guide:!0,disabled:e},i=e?-1:void 0;return!this.authConnector&&!this.isSocialEnabled?null:M`
- ${this.walletGuide==="explore"&&!F.state.noAdapters?M`<wui-separator data-testid="wui-separator" id="explore" text="or"></wui-separator>`:null}
- <w3m-wallet-guide
- class=${r6(n)}
- tabIdx=${we(i)}
- walletGuide=${this.walletGuide}
- ></w3m-wallet-guide>
- `}legalCheckboxTemplate(){return this.walletGuide==="explore"?null:M`<w3m-legal-checkbox data-testid="w3m-legal-checkbox"></w3m-legal-checkbox>`}handleConnectListScroll(){var n;const e=(n=this.shadowRoot)==null?void 0:n.querySelector(".connect");if(!e)return;e.scrollHeight>USe?(e.style.setProperty("--connect-mask-image",`linear-gradient(
- to bottom,
- rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,
- rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,
- black 40px,
- black calc(100% - 40px),
- rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),
- rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%
- )`),e.style.setProperty("--connect-scroll--top-opacity",K0.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",K0.interpolate([0,50],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString())):(e.style.setProperty("--connect-mask-image","none"),e.style.setProperty("--connect-scroll--top-opacity","0"),e.style.setProperty("--connect-scroll--bottom-opacity","0"))}onContinueWalletClick(){X.push("ConnectWallets")}};Ii.styles=LSe;po([G()],Ii.prototype,"connectors",void 0);po([G()],Ii.prototype,"authConnector",void 0);po([G()],Ii.prototype,"features",void 0);po([G()],Ii.prototype,"remoteFeatures",void 0);po([G()],Ii.prototype,"enableWallets",void 0);po([G()],Ii.prototype,"noAdapters",void 0);po([q()],Ii.prototype,"walletGuide",void 0);po([G()],Ii.prototype,"checked",void 0);po([G()],Ii.prototype,"isEmailEnabled",void 0);po([G()],Ii.prototype,"isSocialEnabled",void 0);po([G()],Ii.prototype,"isAuthEnabled",void 0);Ii=po([te("w3m-connect-view")],Ii);const FSe=de`
- wui-flex {
- width: 100%;
- background-color: var(--wui-color-gray-glass-002);
- border-radius: var(--wui-border-radius-xs);
- }
- `;var zA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Vm=class extends se{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return M`
- <wui-flex
- justifyContent="space-between"
- alignItems="center"
- .padding=${["1xs","2l","1xs","2l"]}
- >
- <wui-text variant="paragraph-500" color="fg-200">${this.label}</wui-text>
- <wui-chip-button size="sm" variant="shade" text=${this.buttonLabel} icon="chevronRight">
- </wui-chip-button>
- </wui-flex>
- `}};Vm.styles=[He,vt,FSe];zA([q({type:Boolean})],Vm.prototype,"disabled",void 0);zA([q()],Vm.prototype,"label",void 0);zA([q()],Vm.prototype,"buttonLabel",void 0);Vm=zA([te("wui-cta-button")],Vm);const HSe=de`
- :host {
- display: block;
- padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl);
- }
- `;var uQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let x6=class extends se{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:e,app_store:r,play_store:n,chrome_store:i,homepage:s}=this.wallet,o=ue.isMobile(),a=ue.isIos(),c=ue.isAndroid(),u=[r,n,s,i].filter(Boolean).length>1,l=nt.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return u&&!o?M`
- <wui-cta-button
- label=${`Don't have ${l}?`}
- buttonLabel="Get"
- @click=${()=>X.push("Downloads",{wallet:this.wallet})}
- ></wui-cta-button>
- `:!u&&s?M`
- <wui-cta-button
- label=${`Don't have ${l}?`}
- buttonLabel="Get"
- @click=${this.onHomePage.bind(this)}
- ></wui-cta-button>
- `:r&&a?M`
- <wui-cta-button
- label=${`Don't have ${l}?`}
- buttonLabel="Get"
- @click=${this.onAppStore.bind(this)}
- ></wui-cta-button>
- `:n&&c?M`
- <wui-cta-button
- label=${`Don't have ${l}?`}
- buttonLabel="Get"
- @click=${this.onPlayStore.bind(this)}
- ></wui-cta-button>
- `:(this.style.display="none",null)}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&ue.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&ue.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&ue.openHref(this.wallet.homepage,"_blank")}};x6.styles=[HSe];uQ([q({type:Object})],x6.prototype,"wallet",void 0);x6=uQ([te("w3m-mobile-download-links")],x6);const qSe=de`
- @keyframes shake {
- 0% {
- transform: translateX(0);
- }
- 25% {
- transform: translateX(3px);
- }
- 50% {
- transform: translateX(-3px);
- }
- 75% {
- transform: translateX(3px);
- }
- 100% {
- transform: translateX(0);
- }
- }
- wui-flex:first-child:not(:only-child) {
- position: relative;
- }
- wui-loading-thumbnail {
- position: absolute;
- }
- wui-icon-box {
- position: absolute;
- right: calc(var(--wui-spacing-3xs) * -1);
- bottom: calc(var(--wui-spacing-3xs) * -1);
- opacity: 0;
- transform: scale(0.5);
- transition-property: opacity, transform;
- transition-duration: var(--wui-duration-lg);
- transition-timing-function: var(--wui-ease-out-power-2);
- will-change: opacity, transform;
- }
- wui-text[align='center'] {
- width: 100%;
- padding: 0px var(--wui-spacing-l);
- }
- [data-error='true'] wui-icon-box {
- opacity: 1;
- transform: scale(1);
- }
- [data-error='true'] > wui-flex:first-child {
- animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
- }
- [data-retry='false'] wui-link {
- display: none;
- }
- [data-retry='true'] wui-link {
- display: block;
- opacity: 1;
- }
- `;var fc=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};class Vn extends se{constructor(){var e,r,n,i,s;super(),this.wallet=(e=X.state.data)==null?void 0:e.wallet,this.connector=(r=X.state.data)==null?void 0:r.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=pt.getWalletImage(this.wallet)??pt.getConnectorImage(this.connector),this.name=((n=this.wallet)==null?void 0:n.name)??((i=this.connector)==null?void 0:i.name)??"Wallet",this.isRetrying=!1,this.uri=xe.state.wcUri,this.error=xe.state.wcError,this.ready=!1,this.showRetry=!1,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.isLoading=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(xe.subscribeKey("wcUri",o=>{var a;this.uri=o,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(a=this.onConnect)==null||a.call(this))}),xe.subscribeKey("wcError",o=>this.error=o)),(ue.isTelegram()||ue.isSafari())&&ue.isIos()&&xe.state.wcUri&&((s=this.onConnect)==null||s.call(this))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),xe.setWcError(!1),clearTimeout(this.timeout)}render(){var n;(n=this.onRender)==null||n.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let r=`Continue in ${this.name}`;return this.error&&(r="Connection declined"),M`
- <wui-flex
- data-error=${we(this.error)}
- data-retry=${this.showRetry}
- flexDirection="column"
- alignItems="center"
- .padding=${["3xl","xl","xl","xl"]}
- gap="xl"
- >
- <wui-flex justifyContent="center" alignItems="center">
- <wui-wallet-image size="lg" imageSrc=${we(this.imageSrc)}></wui-wallet-image>
- ${this.error?null:this.loaderTemplate()}
- <wui-icon-box
- backgroundColor="error-100"
- background="opaque"
- iconColor="error-100"
- icon="close"
- size="sm"
- border
- borderColor="wui-color-bg-125"
- ></wui-icon-box>
- </wui-flex>
- <wui-flex flexDirection="column" alignItems="center" gap="xs">
- <wui-text variant="paragraph-500" color=${this.error?"error-100":"fg-100"}>
- ${r}
- </wui-text>
- <wui-text align="center" variant="small-500" color="fg-200">${e}</wui-text>
- </wui-flex>
- ${this.secondaryBtnLabel?M`
- <wui-button
- variant="accent"
- size="md"
- ?disabled=${this.isRetrying||this.isLoading}
- @click=${this.onTryAgain.bind(this)}
- data-testid="w3m-connecting-widget-secondary-button"
- >
- <wui-icon color="inherit" slot="iconLeft" name=${this.secondaryBtnIcon}></wui-icon>
- ${this.secondaryBtnLabel}
- </wui-button>
- `:null}
- </wui-flex>
- ${this.isWalletConnect?M`
- <wui-flex .padding=${["0","xl","xl","xl"]} justifyContent="center">
- <wui-link @click=${this.onCopyUri} color="fg-200" data-testid="wui-link-copy">
- <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
- Copy link
- </wui-link>
- </wui-flex>
- `:null}
- <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
- `}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const r=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");r==null||r.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,r;xe.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(r=this.onConnect)==null||r.call(this)}loaderTemplate(){const e=ar.state.themeVariables["--w3m-border-radius-master"],r=e?parseInt(e.replace("px",""),10):4;return M`<wui-loading-thumbnail radius=${r*9}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(ue.copyToClopboard(this.uri),Fe.showSuccess("Link copied"))}catch{Fe.showError("Failed to copy")}}}Vn.styles=qSe;fc([G()],Vn.prototype,"isRetrying",void 0);fc([G()],Vn.prototype,"uri",void 0);fc([G()],Vn.prototype,"error",void 0);fc([G()],Vn.prototype,"ready",void 0);fc([G()],Vn.prototype,"showRetry",void 0);fc([G()],Vn.prototype,"secondaryBtnLabel",void 0);fc([G()],Vn.prototype,"secondaryLabel",void 0);fc([G()],Vn.prototype,"isLoading",void 0);fc([q({type:Boolean})],Vn.prototype,"isMobile",void 0);fc([q()],Vn.prototype,"onRetry",void 0);var zSe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let e9=class extends Vn{constructor(){if(super(),this.externalViewUnsubscribe=[],!this.connector)throw new Error("w3m-connecting-view: No connector provided");Re.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser"}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(F.subscribeKey("activeCaipAddress",e=>{e&&We.close()}))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){try{this.error=!1,this.connector&&(this.connector.id!==_e.CONNECTOR_ID.COINBASE_SDK||!this.error)&&(await xe.connectExternal(this.connector,this.connector.chain),Re.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}catch(e){Re.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}};e9=zSe([te("w3m-connecting-external-view")],e9);const WSe=de`
- wui-flex,
- wui-list-wallet {
- width: 100%;
- }
- `;var lQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Qy=class extends se{constructor(){super(),this.unsubscribe=[],this.activeConnector=ge.state.activeConnector,this.unsubscribe.push(ge.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return M`
- <wui-flex
- flexDirection="column"
- alignItems="center"
- .padding=${["m","xl","xl","xl"]}
- gap="xl"
- >
- <wui-flex justifyContent="center" alignItems="center">
- <wui-wallet-image
- size="lg"
- imageSrc=${we(pt.getConnectorImage(this.activeConnector))}
- ></wui-wallet-image>
- </wui-flex>
- <wui-flex
- flexDirection="column"
- alignItems="center"
- gap="xs"
- .padding=${["0","s","0","s"]}
- >
- <wui-text variant="paragraph-500" color="fg-100">
- Select Chain for ${(e=this.activeConnector)==null?void 0:e.name}
- </wui-text>
- <wui-text align="center" variant="small-500" color="fg-200"
- >Select which chain to connect to your multi chain wallet</wui-text
- >
- </wui-flex>
- <wui-flex
- flexGrow="1"
- flexDirection="column"
- alignItems="center"
- gap="xs"
- .padding=${["xs","0","xs","0"]}
- >
- ${this.networksTemplate()}
- </wui-flex>
- </wui-flex>
- `}networksTemplate(){var e,r;return(r=(e=this.activeConnector)==null?void 0:e.connectors)==null?void 0:r.map(n=>n.name?M`
- <wui-list-wallet
- imageSrc=${we(pt.getChainImage(n.chain))}
- name=${_e.CHAIN_NAME_MAP[n.chain]}
- @click=${()=>this.onConnector(n)}
- data-testid="wui-list-chain-${n.chain}"
- ></wui-list-wallet>
- `:null)}onConnector(e){var n,i;const r=(i=(n=this.activeConnector)==null?void 0:n.connectors)==null?void 0:i.find(s=>s.chain===e.chain);if(!r){Fe.showError("Failed to find connector");return}r.id==="walletConnect"?ue.isMobile()?X.push("AllWallets"):X.push("ConnectingWalletConnect"):X.push("ConnectingExternal",{connector:r})}};Qy.styles=WSe;lQ([G()],Qy.prototype,"activeConnector",void 0);Qy=lQ([te("w3m-connecting-multi-chain-view")],Qy);var oO=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let S6=class extends se{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.generateTabs();return M`
- <wui-flex justifyContent="center" .padding=${["0","0","l","0"]}>
- <wui-tabs .tabs=${e} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs>
- </wui-flex>
- `}generateTabs(){const e=this.platforms.map(r=>r==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:r==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:r==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:r==="web"?{label:"Webapp",icon:"browser",platform:"web"}:r==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:r})=>r),e}onTabChange(e){var n;const r=this.platformTabs[e];r&&((n=this.onSelectPlatfrom)==null||n.call(this,r))}};oO([q({type:Array})],S6.prototype,"platforms",void 0);oO([q()],S6.prototype,"onSelectPlatfrom",void 0);S6=oO([te("w3m-connecting-header")],S6);var VSe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let PD=class extends Vn{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),Re.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}async onConnectProxy(){var e;try{this.error=!1;const{connectors:r}=ge.state,n=r.find(i=>{var s,o,a;return i.type==="ANNOUNCED"&&((s=i.info)==null?void 0:s.rdns)===((o=this.wallet)==null?void 0:o.rdns)||i.type==="INJECTED"||i.name===((a=this.wallet)==null?void 0:a.name)});if(n)await xe.connectExternal(n,n.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");We.close(),Re.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:((e=this.wallet)==null?void 0:e.name)||"Unknown"}})}catch(r){Re.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(r==null?void 0:r.message)??"Unknown"}}),this.error=!0}}};PD=VSe([te("w3m-connecting-wc-browser")],PD);var GSe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let OD=class extends Vn{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),Re.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop"}})}onRenderProxy(){var e;!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:r,name:n}=this.wallet,{redirect:i,href:s}=ue.formatNativeUrl(r,this.uri);xe.setWcLinking({name:n,href:s}),xe.setRecentWallet(this.wallet),ue.openHref(i,"_blank")}catch{this.error=!0}}};OD=GSe([te("w3m-connecting-wc-desktop")],OD);var g1=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let hp=class extends Vn{constructor(){if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=oe.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{var e;if((e=this.wallet)!=null&&e.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:r,link_mode:n,name:i}=this.wallet,{redirect:s,redirectUniversalLink:o,href:a}=ue.formatNativeUrl(r,this.uri,n);this.redirectDeeplink=s,this.redirectUniversalLink=o,this.target=ue.isIframe()?"_top":"_self",xe.setWcLinking({name:i,href:a}),xe.setRecentWallet(this.wallet),this.preferUniversalLinks&&this.redirectUniversalLink?ue.openHref(this.redirectUniversalLink,this.target):ue.openHref(this.redirectDeeplink,this.target)}catch(r){Re.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:r instanceof Error?r.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}},!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=ct.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(xe.subscribeKey("wcUri",()=>{this.onHandleURI()})),Re.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile"}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){var e;this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onTryAgain(){var e;xe.setWcError(!1),(e=this.onConnect)==null||e.call(this)}};g1([G()],hp.prototype,"redirectDeeplink",void 0);g1([G()],hp.prototype,"redirectUniversalLink",void 0);g1([G()],hp.prototype,"target",void 0);g1([G()],hp.prototype,"preferUniversalLinks",void 0);g1([G()],hp.prototype,"isLoading",void 0);hp=g1([te("w3m-connecting-wc-mobile")],hp);const KSe=de`
- @keyframes fadein {
- from {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
- }
- wui-shimmer {
- width: 100%;
- aspect-ratio: 1 / 1;
- border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
- }
- wui-qr-code {
- opacity: 0;
- animation-duration: 200ms;
- animation-timing-function: ease;
- animation-name: fadein;
- animation-fill-mode: forwards;
- }
- `;var ZSe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let t9=class extends Vn{constructor(){var e;super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),Re.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((e=this.wallet)==null?void 0:e.name)??"WalletConnect",platform:"qrcode"}})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribe)==null||e.forEach(r=>r()),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),M`
- <wui-flex
- flexDirection="column"
- alignItems="center"
- .padding=${["0","xl","xl","xl"]}
- gap="xl"
- >
- <wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
- <wui-text variant="paragraph-500" color="fg-100">
- Scan this QR Code with your phone
- </wui-text>
- ${this.copyTemplate()}
- </wui-flex>
- <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
- `}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40,r=this.wallet?this.wallet.name:void 0;return xe.setWcLinking(void 0),xe.setRecentWallet(this.wallet),M` <wui-qr-code
- size=${e}
- theme=${ar.state.themeMode}
- uri=${this.uri}
- imageSrc=${we(pt.getWalletImage(this.wallet))}
- color=${we(ar.state.themeVariables["--w3m-qr-color"])}
- alt=${we(r)}
- data-testid="wui-qr-code"
- ></wui-qr-code>`}copyTemplate(){const e=!this.uri||!this.ready;return M`<wui-link
- .disabled=${e}
- @click=${this.onCopyUri}
- color="fg-200"
- data-testid="copy-wc2-uri"
- >
- <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
- Copy link
- </wui-link>`}};t9.styles=KSe;t9=ZSe([te("w3m-connecting-wc-qrcode")],t9);var YSe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let RD=class extends se{constructor(){var e;if(super(),this.wallet=(e=X.state.data)==null?void 0:e.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");Re.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}render(){return M`
- <wui-flex
- flexDirection="column"
- alignItems="center"
- .padding=${["3xl","xl","xl","xl"]}
- gap="xl"
- >
- <wui-wallet-image
- size="lg"
- imageSrc=${we(pt.getWalletImage(this.wallet))}
- ></wui-wallet-image>
- <wui-text variant="paragraph-500" color="fg-100">Not Detected</wui-text>
- </wui-flex>
- <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
- `}};RD=YSe([te("w3m-connecting-wc-unsupported")],RD);var dQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let r9=class extends Vn{constructor(){if(super(),this.isLoading=!0,!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=ct.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(xe.subscribeKey("wcUri",()=>{this.updateLoadingState()})),Re.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web"}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:r,name:n}=this.wallet,{redirect:i,href:s}=ue.formatUniversalUrl(r,this.uri);xe.setWcLinking({name:n,href:s}),xe.setRecentWallet(this.wallet),ue.openHref(i,"_blank")}catch{this.error=!0}}};dQ([G()],r9.prototype,"isLoading",void 0);r9=dQ([te("w3m-connecting-wc-web")],r9);var g2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let fp=class extends se{constructor(){var e;super(),this.wallet=(e=X.state.data)==null?void 0:e.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!oe.state.siwx,this.remoteFeatures=oe.state.remoteFeatures,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(oe.subscribeKey("remoteFeatures",r=>this.remoteFeatures=r))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return M`
- ${this.headerTemplate()}
- <div>${this.platformTemplate()}</div>
- ${this.reownBrandingTemplate()}
- `}reownBrandingTemplate(){var e;return(e=this.remoteFeatures)!=null&&e.reownBranding?M`<wui-ux-by-reown></wui-ux-by-reown>`:null}async initializeConnection(e=!1){if(!(this.platform==="browser"||oe.state.manualWCControl&&!e))try{const{wcPairingExpiry:r,status:n}=xe.state;(e||oe.state.enableEmbedded||ue.isPairingExpired(r)||n==="connecting")&&(await xe.connectWalletConnect(),this.isSiwxEnabled||We.close())}catch(r){Re.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(r==null?void 0:r.message)??"Unknown"}}),xe.setWcError(!0),Fe.showError(r.message??"Connection error"),xe.resetWcConnection(),X.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;const{mobile_link:e,desktop_link:r,webapp_link:n,injected:i,rdns:s}=this.wallet,o=i==null?void 0:i.map(({injected_id:g})=>g).filter(Boolean),a=[...s?[s]:o??[]],c=oe.state.isUniversalProvider?!1:a.length,u=e,l=n,d=xe.checkInstalled(a),h=c&&d,f=r&&!ue.isMobile();h&&!F.state.noAdapters&&this.platforms.push("browser"),u&&this.platforms.push(ue.isMobile()?"mobile":"qrcode"),l&&this.platforms.push("web"),f&&this.platforms.push("desktop"),!h&&c&&!F.state.noAdapters&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return M`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return M`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return M`
- <w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}>
- </w3m-connecting-wc-desktop>
- `;case"mobile":return M`
- <w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}>
- </w3m-connecting-wc-mobile>
- `;case"qrcode":return M`<w3m-connecting-wc-qrcode></w3m-connecting-wc-qrcode>`;default:return M`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?M`
- <w3m-connecting-header
- .platforms=${this.platforms}
- .onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
- >
- </w3m-connecting-header>
- `:null}async onSelectPlatform(e){var n;const r=(n=this.shadowRoot)==null?void 0:n.querySelector("div");r&&(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};g2([G()],fp.prototype,"platform",void 0);g2([G()],fp.prototype,"platforms",void 0);g2([G()],fp.prototype,"isSiwxEnabled",void 0);g2([G()],fp.prototype,"remoteFeatures",void 0);fp=g2([te("w3m-connecting-wc-view")],fp);var hQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let T6=class extends se{constructor(){super(...arguments),this.isMobile=ue.isMobile()}render(){if(this.isMobile){const{featured:e,recommended:r}=Ne.state,{customWallets:n}=oe.state,i=Le.getRecentWallets(),s=e.length||r.length||(n==null?void 0:n.length)||i.length;return M`<wui-flex
- flexDirection="column"
- gap="xs"
- .margin=${["3xs","s","s","s"]}
- >
- ${s?M`<w3m-connector-list></w3m-connector-list>`:null}
- <w3m-all-wallets-widget></w3m-all-wallets-widget>
- </wui-flex>`}return M`<wui-flex flexDirection="column" .padding=${["0","0","l","0"]}>
- <w3m-connecting-wc-view></w3m-connecting-wc-view>
- <wui-flex flexDirection="column" .padding=${["0","m","0","m"]}>
- <w3m-all-wallets-widget></w3m-all-wallets-widget> </wui-flex
- ></wui-flex>`}};hQ([G()],T6.prototype,"isMobile",void 0);T6=hQ([te("w3m-connecting-wc-basic-view")],T6);const JSe=de`
- .continue-button-container {
- width: 100%;
- }
- `;var fQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Xy=class extends se{constructor(){super(...arguments),this.loading=!1}render(){return M`
- <wui-flex
- flexDirection="column"
- alignItems="center"
- gap="xxl"
- .padding=${["0","0","l","0"]}
- >
- ${this.onboardingTemplate()} ${this.buttonsTemplate()}
- <wui-link
- @click=${()=>{ue.openHref(IV.URLS.FAQ,"_blank")}}
- >
- Learn more about names
- <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
- </wui-link>
- </wui-flex>
- `}onboardingTemplate(){return M` <wui-flex
- flexDirection="column"
- gap="xxl"
- alignItems="center"
- .padding=${["0","xxl","0","xxl"]}
- >
- <wui-flex gap="s" alignItems="center" justifyContent="center">
- <wui-icon-box
- icon="id"
- size="xl"
- iconSize="xxl"
- iconColor="fg-200"
- backgroundColor="fg-200"
- ></wui-icon-box>
- </wui-flex>
- <wui-flex flexDirection="column" alignItems="center" gap="s">
- <wui-text align="center" variant="medium-600" color="fg-100">
- Choose your account name
- </wui-text>
- <wui-text align="center" variant="paragraph-400" color="fg-100">
- Finally say goodbye to 0x addresses, name your account to make it easier to exchange
- assets
- </wui-text>
- </wui-flex>
- </wui-flex>`}buttonsTemplate(){return M`<wui-flex
- .padding=${["0","2l","0","2l"]}
- gap="s"
- class="continue-button-container"
- >
- <wui-button
- fullWidth
- .loading=${this.loading}
- size="lg"
- borderRadius="xs"
- @click=${this.handleContinue.bind(this)}
- >Choose name
- </wui-button>
- </wui-flex>`}handleContinue(){var r;const e=F.state.activeChain;X.push("RegisterAccountName"),Re.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:((r=re.state.preferredAccountTypes)==null?void 0:r[e])===bt.ACCOUNT_TYPES.SMART_ACCOUNT}})}};Xy.styles=JSe;fQ([G()],Xy.prototype,"loading",void 0);Xy=fQ([te("w3m-choose-account-name-view")],Xy);var QSe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let n9=class extends se{constructor(){var e;super(...arguments),this.wallet=(e=X.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return M`
- <wui-flex gap="xs" flexDirection="column" .padding=${["s","s","l","s"]}>
- ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
- ${this.homepageTemplate()}
- </wui-flex>
- `}chromeTemplate(){var e;return(e=this.wallet)!=null&&e.chrome_store?M`<wui-list-item
- variant="icon"
- icon="chromeStore"
- iconVariant="square"
- @click=${this.onChromeStore.bind(this)}
- chevron
- >
- <wui-text variant="paragraph-500" color="fg-100">Chrome Extension</wui-text>
- </wui-list-item>`:null}iosTemplate(){var e;return(e=this.wallet)!=null&&e.app_store?M`<wui-list-item
- variant="icon"
- icon="appStore"
- iconVariant="square"
- @click=${this.onAppStore.bind(this)}
- chevron
- >
- <wui-text variant="paragraph-500" color="fg-100">iOS App</wui-text>
- </wui-list-item>`:null}androidTemplate(){var e;return(e=this.wallet)!=null&&e.play_store?M`<wui-list-item
- variant="icon"
- icon="playStore"
- iconVariant="square"
- @click=${this.onPlayStore.bind(this)}
- chevron
- >
- <wui-text variant="paragraph-500" color="fg-100">Android App</wui-text>
- </wui-list-item>`:null}homepageTemplate(){var e;return(e=this.wallet)!=null&&e.homepage?M`
- <wui-list-item
- variant="icon"
- icon="browser"
- iconVariant="square-blue"
- @click=${this.onHomePage.bind(this)}
- chevron
- >
- <wui-text variant="paragraph-500" color="fg-100">Website</wui-text>
- </wui-list-item>
- `:null}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&&ue.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&ue.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&ue.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&ue.openHref(this.wallet.homepage,"_blank")}};n9=QSe([te("w3m-downloads-view")],n9);var XSe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const eTe="https://walletconnect.com/explorer";let i9=class extends se{render(){return M`
- <wui-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs">
- ${this.recommendedWalletsTemplate()}
- <wui-list-wallet
- name="Explore all"
- showAllWallets
- walletIcon="allWallets"
- icon="externalLink"
- @click=${()=>{ue.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}}
- ></wui-list-wallet>
- </wui-flex>
- `}recommendedWalletsTemplate(){const{recommended:e,featured:r}=Ne.state,{customWallets:n}=oe.state;return[...r,...n??[],...e].slice(0,4).map(s=>M`
- <wui-list-wallet
- name=${s.name??"Unknown"}
- tagVariant="main"
- imageSrc=${we(pt.getWalletImage(s))}
- @click=${()=>{ue.openHref(s.homepage??eTe,"_blank")}}
- ></wui-list-wallet>
- `)}};i9=XSe([te("w3m-get-wallet-view")],i9);var pQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let s9=class extends se{constructor(){super(...arguments),this.data=[]}render(){return M`
- <wui-flex flexDirection="column" alignItems="center" gap="l">
- ${this.data.map(e=>M`
- <wui-flex flexDirection="column" alignItems="center" gap="xl">
- <wui-flex flexDirection="row" justifyContent="center" gap="1xs">
- ${e.images.map(r=>M`<wui-visual name=${r}></wui-visual>`)}
- </wui-flex>
- </wui-flex>
- <wui-flex flexDirection="column" alignItems="center" gap="xxs">
- <wui-text variant="paragraph-500" color="fg-100" align="center">
- ${e.title}
- </wui-text>
- <wui-text variant="small-500" color="fg-200" align="center">${e.text}</wui-text>
- </wui-flex>
- `)}
- </wui-flex>
- `}};pQ([q({type:Array})],s9.prototype,"data",void 0);s9=pQ([te("w3m-help-widget")],s9);var tTe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const rTe=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let o9=class extends se{render(){return M`
- <wui-flex
- flexDirection="column"
- .padding=${["xxl","xl","xl","xl"]}
- alignItems="center"
- gap="xl"
- >
- <w3m-help-widget .data=${rTe}></w3m-help-widget>
- <wui-button variant="main" size="md" @click=${this.onGetWallet.bind(this)}>
- <wui-icon color="inherit" slot="iconLeft" name="wallet"></wui-icon>
- Get a wallet
- </wui-button>
- </wui-flex>
- `}onGetWallet(){Re.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),X.push("GetWallet")}};o9=tTe([te("w3m-what-is-a-wallet-view")],o9);const nTe=de`
- wui-flex {
- max-height: clamp(360px, 540px, 80vh);
- overflow: scroll;
- scrollbar-width: none;
- transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
- will-change: opacity;
- }
- wui-flex::-webkit-scrollbar {
- display: none;
- }
- wui-flex.disabled {
- opacity: 0.3;
- pointer-events: none;
- user-select: none;
- }
- `;var gQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let ev=class extends se{constructor(){super(),this.unsubscribe=[],this.checked=As.state.isLegalCheckboxChecked,this.unsubscribe.push(As.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var c;const{termsConditionsUrl:e,privacyPolicyUrl:r}=oe.state,n=(c=oe.state.features)==null?void 0:c.legalCheckbox,s=!!(e||r)&&!!n,o=s&&!this.checked,a=o?-1:void 0;return M`
- <w3m-legal-checkbox></w3m-legal-checkbox>
- <wui-flex
- flexDirection="column"
- .padding=${s?["0","s","s","s"]:"s"}
- gap="xs"
- class=${we(o?"disabled":void 0)}
- >
- <w3m-wallet-login-list tabIdx=${we(a)}></w3m-wallet-login-list>
- </wui-flex>
- <w3m-legal-footer></w3m-legal-footer>
- `}};ev.styles=nTe;gQ([G()],ev.prototype,"checked",void 0);ev=gQ([te("w3m-connect-wallets-view")],ev);const iTe=de`
- :host {
- display: block;
- width: var(--wui-box-size-lg);
- height: var(--wui-box-size-lg);
- }
- svg {
- width: var(--wui-box-size-lg);
- height: var(--wui-box-size-lg);
- fill: none;
- stroke: transparent;
- stroke-linecap: round;
- }
- use {
- stroke: var(--wui-color-accent-100);
- stroke-width: 2px;
- stroke-dasharray: 54, 118;
- stroke-dashoffset: 172;
- animation: dash 1s linear infinite;
- }
- @keyframes dash {
- to {
- stroke-dashoffset: 0px;
- }
- }
- `;var sTe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let a9=class extends se{render(){return M`
- <svg viewBox="0 0 54 59">
- <path
- id="wui-loader-path"
- d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"
- />
- <use xlink:href="#wui-loader-path"></use>
- </svg>
- `}};a9.styles=[He,iTe];a9=sTe([te("wui-loading-hexagon")],a9);const oTe=de`
- @keyframes shake {
- 0% {
- transform: translateX(0);
- }
- 25% {
- transform: translateX(3px);
- }
- 50% {
- transform: translateX(-3px);
- }
- 75% {
- transform: translateX(3px);
- }
- 100% {
- transform: translateX(0);
- }
- }
- wui-flex:first-child:not(:only-child) {
- position: relative;
- }
- wui-loading-hexagon {
- position: absolute;
- }
- wui-icon-box {
- position: absolute;
- right: 4px;
- bottom: 0;
- opacity: 0;
- transform: scale(0.5);
- z-index: 1;
- }
- wui-button {
- display: none;
- }
- [data-error='true'] wui-icon-box {
- opacity: 1;
- transform: scale(1);
- }
- [data-error='true'] > wui-flex:first-child {
- animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
- }
- wui-button[data-retry='true'] {
- display: block;
- opacity: 1;
- }
- `;var aO=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Gm=class extends se{constructor(){var e;super(),this.network=(e=X.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.getLabel(),r=this.getSubLabel();return M`
- <wui-flex
- data-error=${this.error}
- flexDirection="column"
- alignItems="center"
- .padding=${["3xl","xl","3xl","xl"]}
- gap="xl"
- >
- <wui-flex justifyContent="center" alignItems="center">
- <wui-network-image
- size="lg"
- imageSrc=${we(pt.getNetworkImage(this.network))}
- ></wui-network-image>
- ${this.error?null:M`<wui-loading-hexagon></wui-loading-hexagon>`}
- <wui-icon-box
- backgroundColor="error-100"
- background="opaque"
- iconColor="error-100"
- icon="close"
- size="sm"
- ?border=${!0}
- borderColor="wui-color-bg-125"
- ></wui-icon-box>
- </wui-flex>
- <wui-flex flexDirection="column" alignItems="center" gap="xs">
- <wui-text align="center" variant="paragraph-500" color="fg-100">${e}</wui-text>
- <wui-text align="center" variant="small-500" color="fg-200">${r}</wui-text>
- </wui-flex>
- <wui-button
- data-retry=${this.showRetry}
- variant="accent"
- size="md"
- .disabled=${!this.error}
- @click=${this.onSwitchNetwork.bind(this)}
- >
- <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
- Try again
- </wui-button>
- </wui-flex>
- `}getSubLabel(){const e=F.state.activeChain,r=ge.getConnectorId(e);return ge.getAuthConnector()&&r===_e.CONNECTOR_ID.AUTH?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){var i;const e=F.state.activeChain,r=ge.getConnectorId(e);return ge.getAuthConnector()&&r===_e.CONNECTOR_ID.AUTH?`Switching to ${((i=this.network)==null?void 0:i.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const r=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");r==null||r.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onSwitchNetwork(){var e;try{this.error=!1,F.state.activeChain!==((e=this.network)==null?void 0:e.chainNamespace)&&F.setIsSwitchingNamespace(!0),this.network&&F.switchActiveNetwork(this.network)}catch{this.error=!0}}};Gm.styles=oTe;aO([G()],Gm.prototype,"showRetry",void 0);aO([G()],Gm.prototype,"error",void 0);Gm=aO([te("w3m-network-switch-view")],Gm);const aTe=de`
- button {
- column-gap: var(--wui-spacing-s);
- padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
- width: 100%;
- transition: all var(--wui-ease-out-power-1) var(--wui-duration-md);
- border-radius: var(--wui-border-radius-xs);
- color: var(--wui-color-fg-100);
- }
- button > wui-text:nth-child(2) {
- display: flex;
- flex: 1;
- }
- button[data-transparent='true'] {
- pointer-events: none;
- background-color: transparent;
- }
- button:hover {
- background-color: var(--wui-color-gray-glass-002);
- }
- button:active {
- background-color: var(--wui-color-gray-glass-005);
- }
- wui-image {
- width: var(--wui-spacing-3xl);
- height: var(--wui-spacing-3xl);
- border-radius: 100%;
- }
- button:disabled {
- background-color: var(--wui-color-gray-glass-002);
- opacity: 0.5;
- cursor: not-allowed;
- }
- button:disabled > wui-tag {
- background-color: var(--wui-color-gray-glass-010);
- color: var(--wui-color-fg-300);
- }
- `;var m1=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Rd=class extends se{constructor(){super(...arguments),this.imageSrc="",this.name="",this.disabled=!1,this.selected=!1,this.transparent=!1}render(){return M`
- <button data-transparent=${this.transparent} ?disabled=${this.disabled}>
- <wui-flex gap="s" alignItems="center">
- ${this.templateNetworkImage()}
- <wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text></wui-flex
- >
- ${this.checkmarkTemplate()}
- </button>
- `}checkmarkTemplate(){return this.selected?M`<wui-icon size="sm" color="accent-100" name="checkmarkBold"></wui-icon>`:null}templateNetworkImage(){return this.imageSrc?M`<wui-image size="sm" src=${this.imageSrc} name=${this.name}></wui-image>`:this.imageSrc?null:M`<wui-network-image
- ?round=${!0}
- size="md"
- name=${this.name}
- ></wui-network-image>`}};Rd.styles=[He,vt,aTe];m1([q()],Rd.prototype,"imageSrc",void 0);m1([q()],Rd.prototype,"name",void 0);m1([q({type:Boolean})],Rd.prototype,"disabled",void 0);m1([q({type:Boolean})],Rd.prototype,"selected",void 0);m1([q({type:Boolean})],Rd.prototype,"transparent",void 0);Rd=m1([te("wui-list-network")],Rd);const cTe=de`
- .container {
- max-height: 360px;
- overflow: auto;
- }
- .container::-webkit-scrollbar {
- display: none;
- }
- `;var m2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let kd=class extends se{constructor(){super(),this.unsubscribe=[],this.network=F.state.activeCaipNetwork,this.requestedCaipNetworks=F.getCaipNetworks(),this.search="",this.onDebouncedSearch=ue.debounce(e=>{this.search=e},100),this.unsubscribe.push(er.subscribeNetworkImages(()=>this.requestUpdate()),F.subscribeKey("activeCaipNetwork",e=>this.network=e),F.subscribe(()=>{this.requestedCaipNetworks=F.getAllRequestedCaipNetworks()}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return M`
- ${this.templateSearchInput()}
- <wui-flex
- class="container"
- .padding=${["0","s","s","s"]}
- flexDirection="column"
- gap="xs"
- >
- ${this.networksTemplate()}
- </wui-flex>
- <wui-separator></wui-separator>
- <wui-flex padding="s" flexDirection="column" gap="m" alignItems="center">
- <wui-text variant="small-400" color="fg-300" align="center">
- Your connected wallet may not support some of the networks available for this dApp
- </wui-text>
- <wui-link @click=${this.onNetworkHelp.bind(this)}>
- <wui-icon size="xs" color="accent-100" slot="iconLeft" name="helpCircle"></wui-icon>
- What is a network
- </wui-link>
- </wui-flex>
- `}templateSearchInput(){return M`
- <wui-flex gap="xs" .padding=${["0","s","s","s"]}>
- <wui-input-text
- @inputChange=${this.onInputChange.bind(this)}
- class="network-search-input"
- size="md"
- placeholder="Search network"
- icon="search"
- ></wui-input-text>
- </wui-flex>
- `}onInputChange(e){this.onDebouncedSearch(e.detail)}onNetworkHelp(){Re.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),X.push("WhatIsANetwork")}networksTemplate(){var n;const e=F.getAllApprovedCaipNetworkIds(),r=ue.sortRequestedNetworks(e,this.requestedCaipNetworks);return this.search?this.filteredNetworks=r==null?void 0:r.filter(i=>{var s;return(s=i==null?void 0:i.name)==null?void 0:s.toLowerCase().includes(this.search.toLowerCase())}):this.filteredNetworks=r,(n=this.filteredNetworks)==null?void 0:n.map(i=>{var s;return M`
- <wui-list-network
- .selected=${((s=this.network)==null?void 0:s.id)===i.id}
- imageSrc=${we(pt.getNetworkImage(i))}
- type="network"
- name=${i.name??i.id}
- @click=${()=>this.onSwitchNetwork(i)}
- .disabled=${this.getNetworkDisabled(i)}
- data-testid=${`w3m-network-switch-${i.name??i.id}`}
- ></wui-list-network>
- `})}getNetworkDisabled(e){const r=e.chainNamespace,n=re.getCaipAddress(r),i=F.getAllApprovedCaipNetworkIds(),s=F.getNetworkProp("supportsAllNetworks",r)!==!1,o=ge.getConnectorId(r),a=ge.getAuthConnector(),c=o===_e.CONNECTOR_ID.AUTH&&a;return!n||s||c?!1:!(i!=null&&i.includes(e.caipNetworkId))}onSwitchNetwork(e){MV.onSwitchNetwork({network:e})}};kd.styles=cTe;m2([G()],kd.prototype,"network",void 0);m2([G()],kd.prototype,"requestedCaipNetworks",void 0);m2([G()],kd.prototype,"filteredNetworks",void 0);m2([G()],kd.prototype,"search",void 0);kd=m2([te("w3m-networks-view")],kd);const uTe=de`
- @keyframes shake {
- 0% {
- transform: translateX(0);
- }
- 25% {
- transform: translateX(3px);
- }
- 50% {
- transform: translateX(-3px);
- }
- 75% {
- transform: translateX(3px);
- }
- 100% {
- transform: translateX(0);
- }
- }
- wui-flex:first-child:not(:only-child) {
- position: relative;
- }
- wui-loading-thumbnail {
- position: absolute;
- }
- wui-visual {
- width: var(--wui-wallet-image-size-lg);
- height: var(--wui-wallet-image-size-lg);
- border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
- position: relative;
- overflow: hidden;
- }
- wui-visual::after {
- content: '';
- display: block;
- width: 100%;
- height: 100%;
- position: absolute;
- inset: 0;
- border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
- box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
- }
- wui-icon-box {
- position: absolute;
- right: calc(var(--wui-spacing-3xs) * -1);
- bottom: calc(var(--wui-spacing-3xs) * -1);
- opacity: 0;
- transform: scale(0.5);
- transition:
- opacity var(--wui-ease-out-power-2) var(--wui-duration-lg),
- transform var(--wui-ease-out-power-2) var(--wui-duration-lg);
- will-change: opacity, transform;
- }
- wui-text[align='center'] {
- width: 100%;
- padding: 0px var(--wui-spacing-l);
- }
- [data-error='true'] wui-icon-box {
- opacity: 1;
- transform: scale(1);
- }
- [data-error='true'] > wui-flex:first-child {
- animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
- }
- [data-retry='false'] wui-link {
- display: none;
- }
- [data-retry='true'] wui-link {
- display: block;
- opacity: 1;
- }
- wui-link {
- padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs);
- }
- .capitalize {
- text-transform: capitalize;
- }
- `;var mQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const lTe={eip155:"eth",solana:"solana",bip122:"bitcoin",polkadot:void 0};let tv=class extends se{constructor(){var e,r;super(...arguments),this.unsubscribe=[],this.switchToChain=(e=X.state.data)==null?void 0:e.switchToChain,this.caipNetwork=(r=X.state.data)==null?void 0:r.network,this.activeChain=F.state.activeChain}firstUpdated(){this.unsubscribe.push(F.subscribeKey("activeChain",e=>this.activeChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.switchToChain?_e.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;const r=_e.CHAIN_NAME_MAP[this.switchToChain];return M`
- <wui-flex
- flexDirection="column"
- alignItems="center"
- .padding=${["3xl","xl","xl","xl"]}
- gap="xl"
- >
- <wui-flex justifyContent="center" flexDirection="column" alignItems="center" gap="xl">
- <wui-visual name=${we(lTe[this.switchToChain])}></wui-visual>
- <wui-text
- data-testid=${`w3m-switch-active-chain-to-${r}`}
- variant="paragraph-500"
- color="fg-100"
- align="center"
- >Switch to <span class="capitalize">${r}</span></wui-text
- >
- <wui-text variant="small-400" color="fg-200" align="center">
- Connected wallet doesn't support connecting to ${e} chain. You
- need to connect with a different wallet.
- </wui-text>
- <wui-button
- data-testid="w3m-switch-active-chain-button"
- size="md"
- @click=${this.switchActiveChain.bind(this)}
- >Switch</wui-button
- >
- </wui-flex>
- </wui-flex>
- `}async switchActiveChain(){this.switchToChain&&(F.setIsSwitchingNamespace(!0),ge.setFilterByNamespace(this.switchToChain),this.caipNetwork?await F.switchActiveNetwork(this.caipNetwork):F.setActiveNamespace(this.switchToChain),X.reset("Connect"))}};tv.styles=uTe;mQ([q()],tv.prototype,"activeChain",void 0);tv=mQ([te("w3m-switch-active-chain-view")],tv);var dTe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const hTe=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let c9=class extends se{render(){return M`
- <wui-flex
- flexDirection="column"
- .padding=${["xxl","xl","xl","xl"]}
- alignItems="center"
- gap="xl"
- >
- <w3m-help-widget .data=${hTe}></w3m-help-widget>
- <wui-button
- variant="main"
- size="md"
- @click=${()=>{ue.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}}
- >
- Learn more
- <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
- </wui-button>
- </wui-flex>
- `}};c9=dTe([te("w3m-what-is-a-network-view")],c9);const fTe=de`
- :host > wui-flex {
- max-height: clamp(360px, 540px, 80vh);
- overflow: scroll;
- scrollbar-width: none;
- }
- :host > wui-flex::-webkit-scrollbar {
- display: none;
- }
- `;var wQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let rv=class extends se{constructor(){var e;super(),this.swapUnsupportedChain=(e=X.state.data)==null?void 0:e.swapUnsupportedChain,this.unsubscribe=[],this.disconecting=!1,this.unsubscribe.push(er.subscribeNetworkImages(()=>this.requestUpdate()))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return M`
- <wui-flex class="container" flexDirection="column" gap="0">
- <wui-flex
- class="container"
- flexDirection="column"
- .padding=${["m","xl","xs","xl"]}
- alignItems="center"
- gap="xl"
- >
- ${this.descriptionTemplate()}
- </wui-flex>
- <wui-flex flexDirection="column" padding="s" gap="xs">
- ${this.networksTemplate()}
- </wui-flex>
- <wui-separator text="or"></wui-separator>
- <wui-flex flexDirection="column" padding="s" gap="xs">
- <wui-list-item
- variant="icon"
- iconVariant="overlay"
- icon="disconnect"
- ?chevron=${!1}
- .loading=${this.disconecting}
- @click=${this.onDisconnect.bind(this)}
- data-testid="disconnect-button"
- >
- <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text>
- </wui-list-item>
- </wui-flex>
- </wui-flex>
- `}descriptionTemplate(){return this.swapUnsupportedChain?M`
- <wui-text variant="small-400" color="fg-200" align="center">
- The swap feature doesn’t support your current network. Switch to an available option to
- continue.
- </wui-text>
- `:M`
- <wui-text variant="small-400" color="fg-200" align="center">
- This app doesn’t support your current network. Switch to an available option to continue.
- </wui-text>
- `}networksTemplate(){const e=F.getAllRequestedCaipNetworks(),r=F.getAllApprovedCaipNetworkIds(),n=ue.sortRequestedNetworks(r,e);return(this.swapUnsupportedChain?n.filter(s=>ct.SWAP_SUPPORTED_NETWORKS.includes(s.caipNetworkId)):n).map(s=>M`
- <wui-list-network
- imageSrc=${we(pt.getNetworkImage(s))}
- name=${s.name??"Unknown"}
- @click=${()=>this.onSwitchNetwork(s)}
- >
- </wui-list-network>
- `)}async onDisconnect(){try{this.disconecting=!0,await xe.disconnect(),We.close()}catch{Re.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),Fe.showError("Failed to disconnect")}finally{this.disconecting=!1}}async onSwitchNetwork(e){const r=re.state.caipAddress,n=F.getAllApprovedCaipNetworkIds(),i=F.getNetworkProp("supportsAllNetworks",e.chainNamespace),s=X.state.data;r?n!=null&&n.includes(e.caipNetworkId)?await F.switchActiveNetwork(e):i?X.push("SwitchNetwork",{...s,network:e}):X.push("SwitchNetwork",{...s,network:e}):r||(F.setActiveCaipNetwork(e),X.push("Connect"))}};rv.styles=fTe;wQ([G()],rv.prototype,"disconecting",void 0);rv=wQ([te("w3m-unsupported-chain-view")],rv);const pTe=de`
- wui-flex {
- width: 100%;
- background-color: var(--wui-color-gray-glass-005);
- border-radius: var(--wui-border-radius-s);
- padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs)
- var(--wui-spacing-1xs);
- }
- `;var cO=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let nv=class extends se{constructor(){super(...arguments),this.icon="externalLink",this.text=""}render(){return M`
- <wui-flex gap="1xs" alignItems="center">
- <wui-icon-box
- size="sm"
- iconcolor="fg-200"
- backgroundcolor="fg-200"
- icon=${this.icon}
- background="transparent"
- ></wui-icon-box>
- <wui-text variant="small-400" color="fg-200">${this.text}</wui-text>
- </wui-flex>
- `}};nv.styles=[He,vt,pTe];cO([q()],nv.prototype,"icon",void 0);cO([q()],nv.prototype,"text",void 0);nv=cO([te("wui-banner")],nv);const gTe=de`
- :host > wui-flex {
- max-height: clamp(360px, 540px, 80vh);
- overflow: scroll;
- scrollbar-width: none;
- }
- :host > wui-flex::-webkit-scrollbar {
- display: none;
- }
- `;var bQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let iv=class extends se{constructor(){super(),this.unsubscribe=[],this.preferredAccountTypes=re.state.preferredAccountTypes,this.unsubscribe.push(re.subscribeKey("preferredAccountTypes",e=>{this.preferredAccountTypes=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return M` <wui-flex
- flexDirection="column"
- .padding=${["xs","s","m","s"]}
- gap="xs"
- >
- <wui-banner
- icon="warningCircle"
- text="You can only receive assets on these networks"
- ></wui-banner>
- ${this.networkTemplate()}
- </wui-flex>`}networkTemplate(){var a;const e=F.getAllRequestedCaipNetworks(),r=F.getAllApprovedCaipNetworkIds(),n=F.state.activeCaipNetwork,i=F.checkIfSmartAccountEnabled();let s=ue.sortRequestedNetworks(r,e);if(i&&((a=this.preferredAccountTypes)==null?void 0:a[n==null?void 0:n.chainNamespace])===bt.ACCOUNT_TYPES.SMART_ACCOUNT){if(!n)return null;s=[n]}return s.filter(c=>c.chainNamespace===(n==null?void 0:n.chainNamespace)).map(c=>M`
- <wui-list-network
- imageSrc=${we(pt.getNetworkImage(c))}
- name=${c.name??"Unknown"}
- ?transparent=${!0}
- >
- </wui-list-network>
- `)}};iv.styles=gTe;bQ([G()],iv.prototype,"preferredAccountTypes",void 0);iv=bQ([te("w3m-wallet-compatible-networks-view")],iv);const mTe=de`
- :host {
- display: flex;
- justify-content: center;
- align-items: center;
- width: var(--wui-icon-box-size-xl);
- height: var(--wui-icon-box-size-xl);
- box-shadow: 0 0 0 8px var(--wui-thumbnail-border);
- border-radius: var(--local-border-radius);
- overflow: hidden;
- }
- wui-icon {
- width: 32px;
- height: 32px;
- }
- `;var WA=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Km=class extends se{render(){return this.style.cssText=`--local-border-radius: ${this.borderRadiusFull?"1000px":"20px"}; background-color: var(--wui-color-modal-bg);`,M`${this.templateVisual()}`}templateVisual(){return this.imageSrc?M`<wui-image src=${this.imageSrc} alt=${this.alt??""}></wui-image>`:M`<wui-icon
- data-parent-size="md"
- size="inherit"
- color="inherit"
- name="walletPlaceholder"
- ></wui-icon>`}};Km.styles=[He,mTe];WA([q()],Km.prototype,"imageSrc",void 0);WA([q()],Km.prototype,"alt",void 0);WA([q({type:Boolean})],Km.prototype,"borderRadiusFull",void 0);Km=WA([te("wui-visual-thumbnail")],Km);const wTe=de`
- :host {
- display: flex;
- justify-content: center;
- gap: var(--wui-spacing-2xl);
- }
- wui-visual-thumbnail:nth-child(1) {
- z-index: 1;
- }
- `;var bTe=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let u9=class extends se{constructor(){var e,r;super(...arguments),this.dappImageUrl=(e=oe.state.metadata)==null?void 0:e.icons,this.walletImageUrl=(r=re.state.connectedWalletInfo)==null?void 0:r.icon}firstUpdated(){var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelectorAll("wui-visual-thumbnail");e!=null&&e[0]&&this.createAnimation(e[0],"translate(18px)"),e!=null&&e[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){var e;return M`
- <wui-visual-thumbnail
- ?borderRadiusFull=${!0}
- .imageSrc=${(e=this.dappImageUrl)==null?void 0:e[0]}
- ></wui-visual-thumbnail>
- <wui-visual-thumbnail .imageSrc=${this.walletImageUrl}></wui-visual-thumbnail>
- `}createAnimation(e,r){e.animate([{transform:"translateX(0px)"},{transform:r}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};u9.styles=wTe;u9=bTe([te("w3m-siwx-sign-message-thumbnails")],u9);var uO=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let sv=class extends se{constructor(){var e;super(...arguments),this.dappName=(e=oe.state.metadata)==null?void 0:e.name,this.isCancelling=!1,this.isSigning=!1}render(){return M`
- <wui-flex justifyContent="center" .padding=${["2xl","0","xxl","0"]}>
- <w3m-siwx-sign-message-thumbnails></w3m-siwx-sign-message-thumbnails>
- </wui-flex>
- <wui-flex
- .padding=${["0","4xl","l","4xl"]}
- gap="s"
- justifyContent="space-between"
- >
- <wui-text variant="paragraph-500" align="center" color="fg-100"
- >${this.dappName??"Dapp"} needs to connect to your wallet</wui-text
- >
- </wui-flex>
- <wui-flex
- .padding=${["0","3xl","l","3xl"]}
- gap="s"
- justifyContent="space-between"
- >
- <wui-text variant="small-400" align="center" color="fg-200"
- >Sign this message to prove you own this wallet and proceed. Canceling will disconnect
- you.</wui-text
- >
- </wui-flex>
- <wui-flex .padding=${["l","xl","xl","xl"]} gap="s" justifyContent="space-between">
- <wui-button
- size="lg"
- borderRadius="xs"
- fullWidth
- variant="neutral"
- ?loading=${this.isCancelling}
- @click=${this.onCancel.bind(this)}
- data-testid="w3m-connecting-siwe-cancel"
- >
- ${this.isCancelling?"Cancelling...":"Cancel"}
- </wui-button>
- <wui-button
- size="lg"
- borderRadius="xs"
- fullWidth
- variant="main"
- @click=${this.onSign.bind(this)}
- ?loading=${this.isSigning}
- data-testid="w3m-connecting-siwe-sign"
- >
- ${this.isSigning?"Signing...":"Sign"}
- </wui-button>
- </wui-flex>
- `}async onSign(){this.isSigning=!0,await Cu.requestSignMessage().finally(()=>this.isSigning=!1)}async onCancel(){this.isCancelling=!0,await Cu.cancelSignMessage().finally(()=>this.isCancelling=!1)}};uO([G()],sv.prototype,"isCancelling",void 0);uO([G()],sv.prototype,"isSigning",void 0);sv=uO([te("w3m-siwx-sign-message-view")],sv);const yTe=Object.freeze(Object.defineProperty({__proto__:null,get AppKitAccountButton(){return HP},get AppKitButton(){return zP},get AppKitConnectButton(){return VP},get AppKitNetworkButton(){return KP},get W3mAccountButton(){return FP},get W3mAccountSettingsView(){return oo},get W3mAccountView(){return p6},get W3mAllWalletsView(){return Vy},get W3mButton(){return qP},get W3mChooseAccountNameView(){return Xy},get W3mConnectButton(){return WP},get W3mConnectView(){return Ii},get W3mConnectWalletsView(){return ev},get W3mConnectingExternalView(){return e9},get W3mConnectingMultiChainView(){return Qy},get W3mConnectingWcBasicView(){return T6},get W3mConnectingWcView(){return fp},get W3mDownloadsView(){return n9},get W3mGetWalletView(){return i9},get W3mNetworkButton(){return GP},get W3mNetworkSwitchView(){return Gm},get W3mNetworksView(){return kd},get W3mProfileView(){return zu},get W3mRouter(){return Mm},get W3mSIWXSignMessageView(){return sv},get W3mSwitchActiveChainView(){return tv},get W3mSwitchAddressView(){return Hm},get W3mUnsupportedChainView(){return rv},get W3mWalletCompatibleNetworksView(){return iv},get W3mWhatIsANetworkView(){return c9},get W3mWhatIsAWalletView(){return o9}},Symbol.toStringTag,{value:"Module"})),vTe=de`
- :host {
- display: block;
- border-radius: clamp(0px, var(--wui-border-radius-l), 44px);
- box-shadow: 0 0 0 1px var(--wui-color-gray-glass-005);
- background-color: var(--wui-color-modal-bg);
- overflow: hidden;
- }
- :host([data-embedded='true']) {
- box-shadow:
- 0 0 0 1px var(--wui-color-gray-glass-005),
- 0px 4px 12px 4px var(--w3m-card-embedded-shadow-color);
- }
- `;var _Te=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let l9=class extends se{render(){return M`<slot></slot>`}};l9.styles=[He,vTe];l9=_Te([te("wui-card")],l9);const ETe=de`
- :host {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: var(--wui-spacing-s);
- border-radius: var(--wui-border-radius-s);
- border: 1px solid var(--wui-color-dark-glass-100);
- box-sizing: border-box;
- background-color: var(--wui-color-bg-325);
- box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25);
- }
- wui-flex {
- width: 100%;
- }
- wui-text {
- word-break: break-word;
- flex: 1;
- }
- .close {
- cursor: pointer;
- }
- .icon-box {
- height: 40px;
- width: 40px;
- border-radius: var(--wui-border-radius-3xs);
- background-color: var(--local-icon-bg-value);
- }
- `;var w2=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let pp=class extends se{constructor(){super(...arguments),this.message="",this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="info"}render(){return this.style.cssText=`
- --local-icon-bg-value: var(--wui-color-${this.backgroundColor});
- `,M`
- <wui-flex flexDirection="row" justifyContent="space-between" alignItems="center">
- <wui-flex columnGap="xs" flexDirection="row" alignItems="center">
- <wui-flex
- flexDirection="row"
- alignItems="center"
- justifyContent="center"
- class="icon-box"
- >
- <wui-icon color=${this.iconColor} size="md" name=${this.icon}></wui-icon>
- </wui-flex>
- <wui-text variant="small-500" color="bg-350" data-testid="wui-alertbar-text"
- >${this.message}</wui-text
- >
- </wui-flex>
- <wui-icon
- class="close"
- color="bg-350"
- size="sm"
- name="close"
- @click=${this.onClose}
- ></wui-icon>
- </wui-flex>
- `}onClose(){Fn.close()}};pp.styles=[He,ETe];w2([q()],pp.prototype,"message",void 0);w2([q()],pp.prototype,"backgroundColor",void 0);w2([q()],pp.prototype,"iconColor",void 0);w2([q()],pp.prototype,"icon",void 0);pp=w2([te("wui-alertbar")],pp);const CTe=de`
- :host {
- display: block;
- position: absolute;
- top: var(--wui-spacing-s);
- left: var(--wui-spacing-l);
- right: var(--wui-spacing-l);
- opacity: 0;
- pointer-events: none;
- }
- `;var yQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const ATe={info:{backgroundColor:"fg-350",iconColor:"fg-325",icon:"info"},success:{backgroundColor:"success-glass-reown-020",iconColor:"success-125",icon:"checkmark"},warning:{backgroundColor:"warning-glass-reown-020",iconColor:"warning-100",icon:"warningCircle"},error:{backgroundColor:"error-glass-reown-020",iconColor:"error-125",icon:"exclamationTriangle"}};let I6=class extends se{constructor(){super(),this.unsubscribe=[],this.open=Fn.state.open,this.onOpen(!0),this.unsubscribe.push(Fn.subscribeKey("open",e=>{this.open=e,this.onOpen(!1)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{message:e,variant:r}=Fn.state,n=ATe[r];return M`
- <wui-alertbar
- message=${e}
- backgroundColor=${n==null?void 0:n.backgroundColor}
- iconColor=${n==null?void 0:n.iconColor}
- icon=${n==null?void 0:n.icon}
- ></wui-alertbar>
- `}onOpen(e){this.open?(this.animate([{opacity:0,transform:"scale(0.85)"},{opacity:1,transform:"scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: auto"):e||(this.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: none")}};I6.styles=CTe;yQ([G()],I6.prototype,"open",void 0);I6=yQ([te("w3m-alertbar")],I6);const xTe=de`
- button {
- display: block;
- display: flex;
- align-items: center;
- padding: var(--wui-spacing-xxs);
- gap: var(--wui-spacing-xxs);
- transition: all var(--wui-ease-out-power-1) var(--wui-duration-md);
- border-radius: var(--wui-border-radius-xxs);
- }
- wui-image {
- border-radius: 100%;
- width: var(--wui-spacing-xl);
- height: var(--wui-spacing-xl);
- }
- wui-icon-box {
- width: var(--wui-spacing-xl);
- height: var(--wui-spacing-xl);
- }
- button:hover {
- background-color: var(--wui-color-gray-glass-002);
- }
- button:active {
- background-color: var(--wui-color-gray-glass-005);
- }
- `;var vQ=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let P6=class extends se{constructor(){super(...arguments),this.imageSrc=""}render(){return M`<button>
- ${this.imageTemplate()}
- <wui-icon size="xs" color="fg-200" name="chevronBottom"></wui-icon>
- </button>`}imageTemplate(){return this.imageSrc?M`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`:M`<wui-icon-box
- size="xxs"
- iconColor="fg-200"
- backgroundColor="fg-100"
- background="opaque"
- icon="networkPlaceholder"
- ></wui-icon-box>`}};P6.styles=[He,vt,qv,xTe];vQ([q()],P6.prototype,"imageSrc",void 0);P6=vQ([te("wui-select")],P6);const STe=de`
- :host {
- height: 64px;
- }
- wui-text {
- text-transform: capitalize;
- }
- wui-flex.w3m-header-title {
- transform: translateY(0);
- opacity: 1;
- }
- wui-flex.w3m-header-title[view-direction='prev'] {
- animation:
- slide-down-out 120ms forwards var(--wui-ease-out-power-2),
- slide-down-in 120ms forwards var(--wui-ease-out-power-2);
- animation-delay: 0ms, 200ms;
- }
- wui-flex.w3m-header-title[view-direction='next'] {
- animation:
- slide-up-out 120ms forwards var(--wui-ease-out-power-2),
- slide-up-in 120ms forwards var(--wui-ease-out-power-2);
- animation-delay: 0ms, 200ms;
- }
- wui-icon-link[data-hidden='true'] {
- opacity: 0 !important;
- pointer-events: none;
- }
- @keyframes slide-up-out {
- from {
- transform: translateY(0px);
- opacity: 1;
- }
- to {
- transform: translateY(3px);
- opacity: 0;
- }
- }
- @keyframes slide-up-in {
- from {
- transform: translateY(-3px);
- opacity: 0;
- }
- to {
- transform: translateY(0);
- opacity: 1;
- }
- }
- @keyframes slide-down-out {
- from {
- transform: translateY(0px);
- opacity: 1;
- }
- to {
- transform: translateY(-3px);
- opacity: 0;
- }
- }
- @keyframes slide-down-in {
- from {
- transform: translateY(3px);
- opacity: 0;
- }
- to {
- transform: translateY(0);
- opacity: 1;
- }
- }
- `;var Xu=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const TTe=["SmartSessionList"];function aT(){var o,a,c,u,l,d,h;const t=(a=(o=X.state.data)==null?void 0:o.connector)==null?void 0:a.name,e=(u=(c=X.state.data)==null?void 0:c.wallet)==null?void 0:u.name,r=(d=(l=X.state.data)==null?void 0:l.network)==null?void 0:d.name,n=e??t,i=ge.getConnectors();return{Connect:`Connect ${i.length===1&&((h=i[0])==null?void 0:h.id)==="w3m-email"?"Email":""} Wallet`,Create:"Create Wallet",ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",ConnectingExternal:n??"Connect Wallet",ConnectingWalletConnect:n??"WalletConnect",ConnectingWalletConnectBasic:"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview convert",Downloads:n?`Get ${n}`:"Downloads",EmailLogin:"Email Login",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",GetWallet:"Get a wallet",Networks:"Choose Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",Pay:"How you pay",Profile:void 0,SwitchNetwork:r??"Switch Network",SwitchAddress:"Switch Address",Transactions:"Activity",UnsupportedChain:"Switch Network",UpgradeEmailWallet:"Upgrade your Wallet",UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",WhatIsABuy:"What is Buy?",RegisterAccountName:"Choose name",RegisterAccountNameSuccess:"",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Swap:"Swap",SwapSelectToken:"Select token",SwapPreview:"Preview swap",WalletSend:"Send",WalletSendPreview:"Review send",WalletSendSelectToken:"Select Token",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a wallet?",ConnectWallets:"Connect wallet",ConnectSocials:"All socials",ConnectingSocial:re.state.socialProvider?re.state.socialProvider:"Connect Social",ConnectingMultiChain:"Select chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch chain",SmartSessionCreated:void 0,SmartSessionList:"Smart Sessions",SIWXSignMessage:"Sign In",PayLoading:"Payment in progress"}}let ea=class extends se{constructor(){super(),this.unsubscribe=[],this.heading=aT()[X.state.view],this.network=F.state.activeCaipNetwork,this.networkImage=pt.getNetworkImage(this.network),this.showBack=!1,this.prevHistoryLength=1,this.view=X.state.view,this.viewDirection="",this.headerText=aT()[X.state.view],this.unsubscribe.push(er.subscribeNetworkImages(()=>{this.networkImage=pt.getNetworkImage(this.network)}),X.subscribeKey("view",e=>{setTimeout(()=>{this.view=e,this.headerText=aT()[e]},Fo.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),F.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=pt.getNetworkImage(this.network)}))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){return M`
- <wui-flex .padding=${this.getPadding()} justifyContent="space-between" alignItems="center">
- ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
- </wui-flex>
- `}onWalletHelp(){Re.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),X.push("WhatIsAWallet")}async onClose(){await _Z.safeClose()}rightHeaderTemplate(){var r,n;const e=(n=(r=oe==null?void 0:oe.state)==null?void 0:r.features)==null?void 0:n.smartSessions;return X.state.view!=="Account"||!e?this.closeButtonTemplate():M`<wui-flex>
- <wui-icon-link
- icon="clock"
- @click=${()=>X.push("SmartSessionList")}
- data-testid="w3m-header-smart-sessions"
- ></wui-icon-link>
- ${this.closeButtonTemplate()}
- </wui-flex> `}closeButtonTemplate(){return M`
- <wui-icon-link
- icon="close"
- @click=${this.onClose.bind(this)}
- data-testid="w3m-header-close"
- ></wui-icon-link>
- `}titleTemplate(){const e=TTe.includes(this.view);return M`
- <wui-flex
- view-direction="${this.viewDirection}"
- class="w3m-header-title"
- alignItems="center"
- gap="xs"
- >
- <wui-text variant="paragraph-700" color="fg-100" data-testid="w3m-header-text"
- >${this.headerText}</wui-text
- >
- ${e?M`<wui-tag variant="main">Beta</wui-tag>`:null}
- </wui-flex>
- `}leftHeaderTemplate(){var u;const{view:e}=X.state,r=e==="Connect",n=oe.state.enableEmbedded,i=e==="ApproveTransaction",s=e==="ConnectingSiwe",o=e==="Account",a=oe.state.enableNetworkSwitch,c=i||s||r&&n;return o&&a?M`<wui-select
- id="dynamic"
- data-testid="w3m-account-select-network"
- active-network=${we((u=this.network)==null?void 0:u.name)}
- @click=${this.onNetworks.bind(this)}
- imageSrc=${we(this.networkImage)}
- ></wui-select>`:this.showBack&&!c?M`<wui-icon-link
- data-testid="header-back"
- id="dynamic"
- icon="chevronLeft"
- @click=${this.onGoBack.bind(this)}
- ></wui-icon-link>`:M`<wui-icon-link
- data-hidden=${!r}
- id="dynamic"
- icon="helpCircle"
- @click=${this.onWalletHelp.bind(this)}
- ></wui-icon-link>`}onNetworks(){this.isAllowedNetworkSwitch()&&(Re.sendEvent({type:"track",event:"CLICK_NETWORKS"}),X.push("Networks"))}isAllowedNetworkSwitch(){const e=F.getAllRequestedCaipNetworks(),r=e?e.length>1:!1,n=e==null?void 0:e.find(({id:i})=>{var s;return i===((s=this.network)==null?void 0:s.id)});return r||!n}getPadding(){return this.heading?["l","2l","l","2l"]:["0","2l","0","2l"]}onViewChange(){const{history:e}=X.state;let r=Fo.VIEW_DIRECTION.Next;e.length<this.prevHistoryLength&&(r=Fo.VIEW_DIRECTION.Prev),this.prevHistoryLength=e.length,this.viewDirection=r}async onHistoryChange(){var n;const{history:e}=X.state,r=(n=this.shadowRoot)==null?void 0:n.querySelector("#dynamic");e.length>1&&!this.showBack&&r?(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):e.length<=1&&this.showBack&&r&&(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){X.goBack()}};ea.styles=STe;Xu([G()],ea.prototype,"heading",void 0);Xu([G()],ea.prototype,"network",void 0);Xu([G()],ea.prototype,"networkImage",void 0);Xu([G()],ea.prototype,"showBack",void 0);Xu([G()],ea.prototype,"prevHistoryLength",void 0);Xu([G()],ea.prototype,"view",void 0);Xu([G()],ea.prototype,"viewDirection",void 0);Xu([G()],ea.prototype,"headerText",void 0);ea=Xu([te("w3m-header")],ea);const ITe=de`
- :host {
- display: flex;
- column-gap: var(--wui-spacing-s);
- align-items: center;
- padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs);
- border-radius: var(--wui-border-radius-s);
- border: 1px solid var(--wui-color-gray-glass-005);
- box-sizing: border-box;
- background-color: var(--wui-color-bg-175);
- box-shadow:
- 0px 14px 64px -4px rgba(0, 0, 0, 0.15),
- 0px 8px 22px -6px rgba(0, 0, 0, 0.15);
- max-width: 300px;
- }
- :host wui-loading-spinner {
- margin-left: var(--wui-spacing-3xs);
- }
- `;var Dp=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};let Vu=class extends se{constructor(){super(...arguments),this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="checkmark",this.message="",this.loading=!1,this.iconType="default"}render(){return M`
- ${this.templateIcon()}
- <wui-text variant="paragraph-500" color="fg-100" data-testid="wui-snackbar-message"
- >${this.message}</wui-text
- >
- `}templateIcon(){return this.loading?M`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>`:this.iconType==="default"?M`<wui-icon size="xl" color=${this.iconColor} name=${this.icon}></wui-icon>`:M`<wui-icon-box
- size="sm"
- iconSize="xs"
- iconColor=${this.iconColor}
- backgroundColor=${this.backgroundColor}
- icon=${this.icon}
- background="opaque"
- ></wui-icon-box>`}};Vu.styles=[He,ITe];Dp([q()],Vu.prototype,"backgroundColor",void 0);Dp([q()],Vu.prototype,"iconColor",void 0);Dp([q()],Vu.prototype,"icon",void 0);Dp([q()],Vu.prototype,"message",void 0);Dp([q()],Vu.prototype,"loading",void 0);Dp([q()],Vu.prototype,"iconType",void 0);Vu=Dp([te("wui-snackbar")],Vu);const PTe=de`
- :host {
- display: block;
- position: absolute;
- opacity: 0;
- pointer-events: none;
- top: 11px;
- left: 50%;
- width: max-content;
- }
- `;var _Q=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const OTe={loading:void 0,success:{backgroundColor:"success-100",iconColor:"success-100",icon:"checkmark"},error:{backgroundColor:"error-100",iconColor:"error-100",icon:"close"}};let O6=class extends se{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=Fe.state.open,this.unsubscribe.push(Fe.subscribeKey("open",e=>{this.open=e,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(e=>e())}render(){const{message:e,variant:r,svg:n}=Fe.state,i=OTe[r],{icon:s,iconColor:o}=n??i??{};return M`
- <wui-snackbar
- message=${e}
- backgroundColor=${i==null?void 0:i.backgroundColor}
- iconColor=${o}
- icon=${s}
- .loading=${r==="loading"}
- ></wui-snackbar>
- `}onOpen(){clearTimeout(this.timeout),this.open?(this.animate([{opacity:0,transform:"translateX(-50%) scale(0.85)"},{opacity:1,transform:"translateX(-50%) scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.timeout&&clearTimeout(this.timeout),Fe.state.autoClose&&(this.timeout=setTimeout(()=>Fe.hide(),2500))):this.animate([{opacity:1,transform:"translateX(-50%) scale(1)"},{opacity:0,transform:"translateX(-50%) scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"})}};O6.styles=PTe;_Q([G()],O6.prototype,"open",void 0);O6=_Q([te("w3m-snackbar")],O6);const RTe=de`
- :host {
- z-index: var(--w3m-z-index);
- display: block;
- backface-visibility: hidden;
- will-change: opacity;
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- pointer-events: none;
- opacity: 0;
- background-color: var(--wui-cover);
- transition: opacity 0.2s var(--wui-ease-out-power-2);
- will-change: opacity;
- }
- :host(.open) {
- opacity: 1;
- }
- :host(.appkit-modal) {
- position: relative;
- pointer-events: unset;
- background: none;
- width: 100%;
- opacity: 1;
- }
- wui-card {
- max-width: var(--w3m-modal-width);
- width: 100%;
- position: relative;
- animation: zoom-in 0.2s var(--wui-ease-out-power-2);
- animation-fill-mode: backwards;
- outline: none;
- transition:
- border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1),
- background-color var(--wui-duration-lg) var(--wui-ease-out-power-1);
- will-change: border-radius, background-color;
- }
- :host(.appkit-modal) wui-card {
- max-width: 400px;
- }
- wui-card[shake='true'] {
- animation:
- zoom-in 0.2s var(--wui-ease-out-power-2),
- w3m-shake 0.5s var(--wui-ease-out-power-2);
- }
- wui-flex {
- overflow-x: hidden;
- overflow-y: auto;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 100%;
- }
- @media (max-height: 700px) and (min-width: 431px) {
- wui-flex {
- align-items: flex-start;
- }
- wui-card {
- margin: var(--wui-spacing-xxl) 0px;
- }
- }
- @media (max-width: 430px) {
- wui-flex {
- align-items: flex-end;
- }
- wui-card {
- max-width: 100%;
- border-bottom-left-radius: var(--local-border-bottom-mobile-radius);
- border-bottom-right-radius: var(--local-border-bottom-mobile-radius);
- border-bottom: none;
- animation: slide-in 0.2s var(--wui-ease-out-power-2);
- }
- wui-card[shake='true'] {
- animation:
- slide-in 0.2s var(--wui-ease-out-power-2),
- w3m-shake 0.5s var(--wui-ease-out-power-2);
- }
- }
- @keyframes zoom-in {
- 0% {
- transform: scale(0.95) translateY(0);
- }
- 100% {
- transform: scale(1) translateY(0);
- }
- }
- @keyframes slide-in {
- 0% {
- transform: scale(1) translateY(50px);
- }
- 100% {
- transform: scale(1) translateY(0);
- }
- }
- @keyframes w3m-shake {
- 0% {
- transform: scale(1) rotate(0deg);
- }
- 20% {
- transform: scale(1) rotate(-1deg);
- }
- 40% {
- transform: scale(1) rotate(1.5deg);
- }
- 60% {
- transform: scale(1) rotate(-1.5deg);
- }
- 80% {
- transform: scale(1) rotate(1deg);
- }
- 100% {
- transform: scale(1) rotate(0deg);
- }
- }
- @keyframes w3m-view-height {
- from {
- height: var(--prev-height);
- }
- to {
- height: var(--new-height);
- }
- }
- `;var Gd=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};const kD="scroll-lock";class pc extends se{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.hasPrefetched=!1,this.enableEmbedded=oe.state.enableEmbedded,this.open=We.state.open,this.caipAddress=F.state.activeCaipAddress,this.caipNetwork=F.state.activeCaipNetwork,this.shake=We.state.shake,this.filterByNamespace=ge.state.filterByNamespace,this.initializeTheming(),Ne.prefetchAnalyticsConfig(),this.unsubscribe.push(We.subscribeKey("open",e=>e?this.onOpen():this.onClose()),We.subscribeKey("shake",e=>this.shake=e),F.subscribeKey("activeCaipNetwork",e=>this.onNewNetwork(e)),F.subscribeKey("activeCaipAddress",e=>this.onNewAddress(e)),oe.subscribeKey("enableEmbedded",e=>this.enableEmbedded=e),ge.subscribeKey("filterByNamespace",e=>{var r;this.filterByNamespace!==e&&!((r=F.getAccountData(e))!=null&&r.caipAddress)&&(Ne.fetchRecommendedWallets(),this.filterByNamespace=e)}))}firstUpdated(){if(this.caipAddress){if(this.enableEmbedded){We.close(),this.prefetch();return}this.onNewAddress(this.caipAddress)}this.open&&this.onOpen(),this.enableEmbedded&&this.prefetch()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return this.style.cssText=`
- --local-border-bottom-mobile-radius: ${this.enableEmbedded?"clamp(0px, var(--wui-border-radius-l), 44px)":"0px"};
- `,this.enableEmbedded?M`${this.contentTemplate()}
- <w3m-tooltip></w3m-tooltip> `:this.open?M`
- <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
- ${this.contentTemplate()}
- </wui-flex>
- <w3m-tooltip></w3m-tooltip>
- `:null}contentTemplate(){return M` <wui-card
- shake="${this.shake}"
- data-embedded="${we(this.enableEmbedded)}"
- role="alertdialog"
- aria-modal="true"
- tabindex="0"
- data-testid="w3m-modal-card"
- >
- <w3m-header></w3m-header>
- <w3m-router></w3m-router>
- <w3m-snackbar></w3m-snackbar>
- <w3m-alertbar></w3m-alertbar>
- </wui-card>`}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){await _Z.safeClose()}initializeTheming(){const{themeVariables:e,themeMode:r}=ar.state,n=nt.getColorTheme(r);l_e(e,n)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),Fe.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=kD,e.textContent=`
- body {
- touch-action: none;
- overflow: hidden;
- overscroll-behavior: contain;
- }
- w3m-modal {
- pointer-events: auto;
- }
- `,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${kD}"]`);e&&e.remove()}onAddKeyboardListener(){var r;this.abortController=new AbortController;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("wui-card");e==null||e.focus(),window.addEventListener("keydown",n=>{if(n.key==="Escape")this.handleClose();else if(n.key==="Tab"){const{tagName:i}=n.target;i&&!i.includes("W3M-")&&!i.includes("WUI-")&&(e==null||e.focus())}},this.abortController)}onRemoveKeyboardListener(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}async onNewAddress(e){const r=F.state.isSwitchingNamespace,n=ue.getPlainAddress(e);!n&&!r?We.close():r&&n&&X.goBack(),await Cu.initializeIfEnabled(),this.caipAddress=e,F.setIsSwitchingNamespace(!1)}onNewNetwork(e){var m,b,v;const r=this.caipNetwork,n=(m=r==null?void 0:r.caipNetworkId)==null?void 0:m.toString(),i=r==null?void 0:r.chainNamespace,s=(b=e==null?void 0:e.caipNetworkId)==null?void 0:b.toString(),o=e==null?void 0:e.chainNamespace,a=n!==s,u=a&&!(i!==o),l=(r==null?void 0:r.name)===_e.UNSUPPORTED_NETWORK_NAME,d=X.state.view==="ConnectingExternal",h=!((v=F.getAccountData(e==null?void 0:e.chainNamespace))!=null&&v.caipAddress),f=X.state.view==="UnsupportedChain",g=We.state.open;let p=!1;g&&!d&&(h?a&&(p=!0):(f||u&&!l)&&(p=!0)),p&&X.state.view!=="SIWXSignMessage"&&X.goBack(),this.caipNetwork=e}prefetch(){this.hasPrefetched||(Ne.prefetch(),Ne.fetchWalletsByPage({page:1}),this.hasPrefetched=!0)}}pc.styles=RTe;Gd([q({type:Boolean})],pc.prototype,"enableEmbedded",void 0);Gd([G()],pc.prototype,"open",void 0);Gd([G()],pc.prototype,"caipAddress",void 0);Gd([G()],pc.prototype,"caipNetwork",void 0);Gd([G()],pc.prototype,"shake",void 0);Gd([G()],pc.prototype,"filterByNamespace",void 0);let d9=class extends pc{};d9=Gd([te("w3m-modal")],d9);let h9=class extends pc{};h9=Gd([te("appkit-modal")],h9);const kTe=Object.freeze(Object.defineProperty({__proto__:null,get AppKitModal(){return h9},get W3mModal(){return d9},W3mModalBase:pc},Symbol.toStringTag,{value:"Module"}));var cT={},X1={},Tc={},g0={},gh={},ew={},tw={},ND;function EQ(){if(ND)return tw;ND=1,Object.defineProperty(tw,"__esModule",{value:!0}),tw.getSDKVersion=void 0;const t=()=>"9.1.0";return tw.getSDKVersion=t,tw}var rw={},$D;function NTe(){if($D)return rw;$D=1,Object.defineProperty(rw,"__esModule",{value:!0}),rw.generateRequestId=void 0;const t=n=>n.toString(16).padStart(2,"0"),e=n=>{const i=new Uint8Array(n/2);return window.crypto.getRandomValues(i),Array.from(i,t).join("")},r=()=>typeof window<"u"?e(10):new Date().getTime().toString(36);return rw.generateRequestId=r,rw}var jD;function CQ(){if(jD)return ew;jD=1,Object.defineProperty(ew,"__esModule",{value:!0}),ew.MessageFormatter=void 0;const t=EQ(),e=NTe();class r{}return ew.MessageFormatter=r,r.makeRequest=(n,i)=>({id:(0,e.generateRequestId)(),method:n,params:i,env:{sdkVersion:(0,t.getSDKVersion)()}}),r.makeResponse=(n,i,s)=>({id:n,success:!0,version:s,data:i}),r.makeErrorResponse=(n,i,s)=>({id:n,success:!1,error:i,version:s}),ew}var mh={},BD;function Mp(){if(BD)return mh;BD=1,Object.defineProperty(mh,"__esModule",{value:!0}),mh.RestrictedMethods=mh.Methods=void 0;var t;(function(r){r.sendTransactions="sendTransactions",r.rpcCall="rpcCall",r.getChainInfo="getChainInfo",r.getSafeInfo="getSafeInfo",r.getTxBySafeTxHash="getTxBySafeTxHash",r.getSafeBalances="getSafeBalances",r.signMessage="signMessage",r.signTypedMessage="signTypedMessage",r.getEnvironmentInfo="getEnvironmentInfo",r.getOffChainSignature="getOffChainSignature",r.requestAddressBook="requestAddressBook",r.wallet_getPermissions="wallet_getPermissions",r.wallet_requestPermissions="wallet_requestPermissions"})(t||(mh.Methods=t={}));var e;return function(r){r.requestAddressBook="requestAddressBook"}(e||(mh.RestrictedMethods=e={})),mh}var DD;function $Te(){return DD||(DD=1,function(t){var e=gh&&gh.__createBinding||(Object.create?function(s,o,a,c){c===void 0&&(c=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,c,u)}:function(s,o,a,c){c===void 0&&(c=a),s[c]=o[a]}),r=gh&&gh.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(t,"__esModule",{value:!0});const n=CQ();class i{constructor(o=null,a=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:c,data:u,source:l})=>{const d=!u,h=!this.isServer&&l===window.parent,f=typeof u.version<"u"&&parseInt(u.version.split(".")[0]),g=typeof f=="number"&&f>=1;let p=!0;return Array.isArray(this.allowedOrigins)&&(p=this.allowedOrigins.find(m=>m.test(c))!==void 0),!d&&h&&g&&p},this.logIncomingMessage=c=>{console.info(`Safe Apps SDK v1: A message was received from origin ${c.origin}. `,c.data)},this.onParentMessage=c=>{this.isValidMessage(c)&&(this.debugMode&&this.logIncomingMessage(c),this.handleIncomingMessage(c.data))},this.handleIncomingMessage=c=>{const{id:u}=c,l=this.callbacks.get(u);l&&(l(c),this.callbacks.delete(u))},this.send=(c,u)=>{const l=n.MessageFormatter.makeRequest(c,u);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(l,"*"),new Promise((d,h)=>{this.callbacks.set(l.id,f=>{if(!f.success){h(new Error(f.error));return}d(f)})})},this.allowedOrigins=o,this.debugMode=a,this.isServer||window.addEventListener("message",this.onParentMessage)}}t.default=i,r(Mp(),t)}(gh)),gh}var nw={},wh={},iw={},MD;function jTe(){if(MD)return iw;MD=1,Object.defineProperty(iw,"__esModule",{value:!0}),iw.isObjectEIP712TypedData=void 0;const t=e=>typeof e=="object"&&e!=null&&"domain"in e&&"types"in e&&"message"in e;return iw.isObjectEIP712TypedData=t,iw}var uT={},LD;function BTe(){return LD||(LD=1,Object.defineProperty(uT,"__esModule",{value:!0})),uT}var lT={},bh={},yh={},Ic={},UD;function DTe(){if(UD)return Ic;UD=1;var t=Ic&&Ic.__awaiter||function(c,u,l,d){function h(f){return f instanceof l?f:new l(function(g){g(f)})}return new(l||(l=Promise))(function(f,g){function p(v){try{b(d.next(v))}catch(E){g(E)}}function m(v){try{b(d.throw(v))}catch(E){g(E)}}function b(v){v.done?f(v.value):h(v.value).then(p,m)}b((d=d.apply(c,u||[])).next())})};Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.insertParams=n,Ic.stringifyQuery=i,Ic.fetchData=o,Ic.getData=a;const e=c=>typeof c=="object"&&c!==null&&("code"in c||"statusCode"in c)&&"message"in c;function r(c,u,l){return c.replace(new RegExp(`\\{${u}\\}`,"g"),l)}function n(c,u){return u?Object.keys(u).reduce((l,d)=>r(l,d,String(u[d])),c):c}function i(c){if(!c)return"";const u=new URLSearchParams;Object.keys(c).forEach(d=>{c[d]!=null&&u.append(d,String(c[d]))});const l=u.toString();return l?`?${l}`:""}function s(c){return t(this,void 0,void 0,function*(){var u;let l;try{l=yield c.json()}catch{l={}}if(!c.ok){const d=e(l)?`CGW error - ${(u=l.code)!==null&&u!==void 0?u:l.statusCode}: ${l.message}`:`CGW error - status ${c.statusText}`;throw new Error(d)}return l})}function o(c,u,l,d,h){return t(this,void 0,void 0,function*(){const f=Object.assign({"Content-Type":"application/json"},d),g={method:u??"POST",headers:f};h&&(g.credentials=h),l!=null&&(g.body=typeof l=="string"?l:JSON.stringify(l));const p=yield fetch(c,g);return s(p)})}function a(c,u,l){return t(this,void 0,void 0,function*(){const d={method:"GET"};u&&(d.headers=Object.assign(Object.assign({},u),{"Content-Type":"application/json"})),l&&(d.credentials=l);const h=yield fetch(c,d);return s(h)})}return Ic}var FD;function MTe(){if(FD)return yh;FD=1,Object.defineProperty(yh,"__esModule",{value:!0}),yh.postEndpoint=r,yh.putEndpoint=n,yh.deleteEndpoint=i,yh.getEndpoint=s;const t=DTe();function e(o,a,c,u){const l=(0,t.insertParams)(a,c),d=(0,t.stringifyQuery)(u);return`${o}${l}${d}`}function r(o,a,c){const u=e(o,a,c==null?void 0:c.path,c==null?void 0:c.query);return(0,t.fetchData)(u,"POST",c==null?void 0:c.body,c==null?void 0:c.headers,c==null?void 0:c.credentials)}function n(o,a,c){const u=e(o,a,c==null?void 0:c.path,c==null?void 0:c.query);return(0,t.fetchData)(u,"PUT",c==null?void 0:c.body,c==null?void 0:c.headers,c==null?void 0:c.credentials)}function i(o,a,c){const u=e(o,a,c==null?void 0:c.path,c==null?void 0:c.query);return(0,t.fetchData)(u,"DELETE",c==null?void 0:c.body,c==null?void 0:c.headers,c==null?void 0:c.credentials)}function s(o,a,c,u){if(u)return(0,t.getData)(u,void 0,c==null?void 0:c.credentials);const l=e(o,a,c==null?void 0:c.path,c==null?void 0:c.query);return(0,t.getData)(l,c==null?void 0:c.headers,c==null?void 0:c.credentials)}return yh}var sw={},HD;function LTe(){return HD||(HD=1,Object.defineProperty(sw,"__esModule",{value:!0}),sw.DEFAULT_BASE_URL=void 0,sw.DEFAULT_BASE_URL="https://safe-client.safe.global"),sw}var ow={},qD;function UTe(){if(qD)return ow;qD=1,Object.defineProperty(ow,"__esModule",{value:!0}),ow.ImplementationVersionState=void 0;var t;return function(e){e.UP_TO_DATE="UP_TO_DATE",e.OUTDATED="OUTDATED",e.UNKNOWN="UNKNOWN"}(t||(ow.ImplementationVersionState=t={})),ow}var Pc={},zD;function FTe(){if(zD)return Pc;zD=1,Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.SafeAppSocialPlatforms=Pc.SafeAppFeatures=Pc.SafeAppAccessPolicyTypes=void 0;var t;(function(n){n.NoRestrictions="NO_RESTRICTIONS",n.DomainAllowlist="DOMAIN_ALLOWLIST"})(t||(Pc.SafeAppAccessPolicyTypes=t={}));var e;(function(n){n.BATCHED_TRANSACTIONS="BATCHED_TRANSACTIONS"})(e||(Pc.SafeAppFeatures=e={}));var r;return function(n){n.TWITTER="TWITTER",n.GITHUB="GITHUB",n.DISCORD="DISCORD",n.TELEGRAM="TELEGRAM"}(r||(Pc.SafeAppSocialPlatforms=r={})),Pc}var wr={},WD;function HTe(){if(WD)return wr;WD=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.LabelValue=wr.StartTimeValue=wr.DurationType=wr.DetailedExecutionInfoType=wr.TransactionListItemType=wr.ConflictType=wr.TransactionInfoType=wr.SettingsInfoType=wr.TransactionTokenType=wr.TransferDirection=wr.TransactionStatus=wr.Operation=void 0;var t;(function(h){h[h.CALL=0]="CALL",h[h.DELEGATE=1]="DELEGATE"})(t||(wr.Operation=t={}));var e;(function(h){h.AWAITING_CONFIRMATIONS="AWAITING_CONFIRMATIONS",h.AWAITING_EXECUTION="AWAITING_EXECUTION",h.CANCELLED="CANCELLED",h.FAILED="FAILED",h.SUCCESS="SUCCESS"})(e||(wr.TransactionStatus=e={}));var r;(function(h){h.INCOMING="INCOMING",h.OUTGOING="OUTGOING",h.UNKNOWN="UNKNOWN"})(r||(wr.TransferDirection=r={}));var n;(function(h){h.ERC20="ERC20",h.ERC721="ERC721",h.NATIVE_COIN="NATIVE_COIN"})(n||(wr.TransactionTokenType=n={}));var i;(function(h){h.SET_FALLBACK_HANDLER="SET_FALLBACK_HANDLER",h.ADD_OWNER="ADD_OWNER",h.REMOVE_OWNER="REMOVE_OWNER",h.SWAP_OWNER="SWAP_OWNER",h.CHANGE_THRESHOLD="CHANGE_THRESHOLD",h.CHANGE_IMPLEMENTATION="CHANGE_IMPLEMENTATION",h.ENABLE_MODULE="ENABLE_MODULE",h.DISABLE_MODULE="DISABLE_MODULE",h.SET_GUARD="SET_GUARD",h.DELETE_GUARD="DELETE_GUARD"})(i||(wr.SettingsInfoType=i={}));var s;(function(h){h.TRANSFER="Transfer",h.SETTINGS_CHANGE="SettingsChange",h.CUSTOM="Custom",h.CREATION="Creation",h.SWAP_ORDER="SwapOrder",h.TWAP_ORDER="TwapOrder",h.SWAP_TRANSFER="SwapTransfer",h.NATIVE_STAKING_DEPOSIT="NativeStakingDeposit",h.NATIVE_STAKING_VALIDATORS_EXIT="NativeStakingValidatorsExit",h.NATIVE_STAKING_WITHDRAW="NativeStakingWithdraw"})(s||(wr.TransactionInfoType=s={}));var o;(function(h){h.NONE="None",h.HAS_NEXT="HasNext",h.END="End"})(o||(wr.ConflictType=o={}));var a;(function(h){h.TRANSACTION="TRANSACTION",h.LABEL="LABEL",h.CONFLICT_HEADER="CONFLICT_HEADER",h.DATE_LABEL="DATE_LABEL"})(a||(wr.TransactionListItemType=a={}));var c;(function(h){h.MULTISIG="MULTISIG",h.MODULE="MODULE"})(c||(wr.DetailedExecutionInfoType=c={}));var u;(function(h){h.AUTO="AUTO",h.LIMIT_DURATION="LIMIT_DURATION"})(u||(wr.DurationType=u={}));var l;(function(h){h.AT_MINING_TIME="AT_MINING_TIME",h.AT_EPOCH="AT_EPOCH"})(l||(wr.StartTimeValue=l={}));var d;return function(h){h.Queued="Queued",h.Next="Next"}(d||(wr.LabelValue=d={})),wr}var Oc={},VD;function qTe(){if(VD)return Oc;VD=1,Object.defineProperty(Oc,"__esModule",{value:!0}),Oc.FEATURES=Oc.GAS_PRICE_TYPE=Oc.RPC_AUTHENTICATION=void 0;var t;(function(n){n.API_KEY_PATH="API_KEY_PATH",n.NO_AUTHENTICATION="NO_AUTHENTICATION",n.UNKNOWN="UNKNOWN"})(t||(Oc.RPC_AUTHENTICATION=t={}));var e;(function(n){n.ORACLE="ORACLE",n.FIXED="FIXED",n.FIXED_1559="FIXED1559",n.UNKNOWN="UNKNOWN"})(e||(Oc.GAS_PRICE_TYPE=e={}));var r;return function(n){n.ERC721="ERC721",n.SAFE_APPS="SAFE_APPS",n.CONTRACT_INTERACTION="CONTRACT_INTERACTION",n.DOMAIN_LOOKUP="DOMAIN_LOOKUP",n.SPENDING_LIMIT="SPENDING_LIMIT",n.EIP1559="EIP1559",n.SAFE_TX_GAS_OPTIONAL="SAFE_TX_GAS_OPTIONAL",n.TX_SIMULATION="TX_SIMULATION",n.EIP1271="EIP1271"}(r||(Oc.FEATURES=r={})),Oc}var aw={},GD;function zTe(){if(GD)return aw;GD=1,Object.defineProperty(aw,"__esModule",{value:!0}),aw.TokenType=void 0;var t;return function(e){e.ERC20="ERC20",e.ERC721="ERC721",e.NATIVE_TOKEN="NATIVE_TOKEN",e.UNKNOWN="UNKNOWN"}(t||(aw.TokenType=t={})),aw}var dT={},KD;function WTe(){return KD||(KD=1,Object.defineProperty(dT,"__esModule",{value:!0})),dT}var vh={},ZD;function VTe(){if(ZD)return vh;ZD=1,Object.defineProperty(vh,"__esModule",{value:!0}),vh.NativeStakingStatus=vh.ConfirmationViewTypes=void 0;var t;(function(r){r.GENERIC="GENERIC",r.COW_SWAP_ORDER="COW_SWAP_ORDER",r.COW_SWAP_TWAP_ORDER="COW_SWAP_TWAP_ORDER",r.KILN_NATIVE_STAKING_DEPOSIT="KILN_NATIVE_STAKING_DEPOSIT",r.KILN_NATIVE_STAKING_VALIDATORS_EXIT="KILN_NATIVE_STAKING_VALIDATORS_EXIT",r.KILN_NATIVE_STAKING_WITHDRAW="KILN_NATIVE_STAKING_WITHDRAW"})(t||(vh.ConfirmationViewTypes=t={}));var e;return function(r){r.NOT_STAKED="NOT_STAKED",r.ACTIVATING="ACTIVATING",r.DEPOSIT_IN_PROGRESS="DEPOSIT_IN_PROGRESS",r.ACTIVE="ACTIVE",r.EXIT_REQUESTED="EXIT_REQUESTED",r.EXITING="EXITING",r.EXITED="EXITED",r.SLASHED="SLASHED"}(e||(vh.NativeStakingStatus=e={})),vh}var _h={},YD;function GTe(){if(YD)return _h;YD=1,Object.defineProperty(_h,"__esModule",{value:!0}),_h.SafeMessageStatus=_h.SafeMessageListItemType=void 0;var t;(function(r){r.DATE_LABEL="DATE_LABEL",r.MESSAGE="MESSAGE"})(t||(_h.SafeMessageListItemType=t={}));var e;return function(r){r.NEEDS_CONFIRMATION="NEEDS_CONFIRMATION",r.CONFIRMED="CONFIRMED"}(e||(_h.SafeMessageStatus=e={})),_h}var cw={},JD;function KTe(){if(JD)return cw;JD=1,Object.defineProperty(cw,"__esModule",{value:!0}),cw.DeviceType=void 0;var t;return function(e){e.ANDROID="ANDROID",e.IOS="IOS",e.WEB="WEB"}(t||(cw.DeviceType=t={})),cw}var hT={},QD;function ZTe(){return QD||(QD=1,Object.defineProperty(hT,"__esModule",{value:!0})),hT}var XD;function AQ(){return XD||(XD=1,function(t){var e=bh&&bh.__createBinding||(Object.create?function(be,Te,Me,st){st===void 0&&(st=Me);var Cr=Object.getOwnPropertyDescriptor(Te,Me);(!Cr||("get"in Cr?!Te.__esModule:Cr.writable||Cr.configurable))&&(Cr={enumerable:!0,get:function(){return Te[Me]}}),Object.defineProperty(be,st,Cr)}:function(be,Te,Me,st){st===void 0&&(st=Me),be[st]=Te[Me]}),r=bh&&bh.__exportStar||function(be,Te){for(var Me in be)Me!=="default"&&!Object.prototype.hasOwnProperty.call(Te,Me)&&e(Te,be,Me)};Object.defineProperty(t,"__esModule",{value:!0}),t.setBaseUrl=void 0,t.relayTransaction=a,t.getRelayCount=c,t.getSafeInfo=u,t.getIncomingTransfers=l,t.getModuleTransactions=d,t.getMultisigTransactions=h,t.getBalances=f,t.getFiatCurrencies=g,t.getOwnedSafes=p,t.getAllOwnedSafes=m,t.getCollectibles=b,t.getCollectiblesPage=v,t.getTransactionHistory=E,t.getTransactionQueue=w,t.getTransactionDetails=C,t.deleteTransaction=y,t.postSafeGasEstimation=_,t.getNonces=x,t.proposeTransaction=A,t.getConfirmationView=T,t.getTxPreview=O,t.getChainsConfig=k,t.getChainConfig=j,t.getSafeApps=N,t.getMasterCopies=S,t.getDecodedData=P,t.getSafeMessages=I,t.getSafeMessage=B,t.proposeSafeMessage=$,t.confirmSafeMessage=R,t.getDelegates=D,t.registerDevice=L,t.unregisterSafe=U,t.unregisterDevice=z,t.registerEmail=W,t.changeEmail=K,t.resendEmailVerificationCode=J,t.verifyEmail=ne,t.getRegisteredEmail=ae,t.deleteRegisteredEmail=he,t.registerRecoveryModule=ie,t.unsubscribeSingle=Ee,t.unsubscribeAll=pe,t.getSafeOverviews=ve,t.getContract=je,t.getAuthNonce=rt,t.verifyAuth=Ce,t.createAccount=fe,t.getAccount=ft,t.deleteAccount=Wt,t.getAccountDataTypes=lr,t.getAccountDataSettings=dr,t.putAccountDataSettings=hr,t.getIndexingStatus=Er;const n=MTe(),i=LTe();r(UTe(),t),r(FTe(),t),r(HTe(),t),r(qTe(),t),r(zTe(),t),r(WTe(),t),r(VTe(),t),r(GTe(),t),r(KTe(),t),r(ZTe(),t);let s=i.DEFAULT_BASE_URL;const o=be=>{s=be};t.setBaseUrl=o;function a(be,Te){return(0,n.postEndpoint)(s,"/v1/chains/{chainId}/relay",{path:{chainId:be},body:Te})}function c(be,Te){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/relay/{address}",{path:{chainId:be,address:Te}})}function u(be,Te){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}",{path:{chainId:be,address:Te}})}function l(be,Te,Me,st){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/incoming-transfers/",{path:{chainId:be,address:Te},query:Me},st)}function d(be,Te,Me,st){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/module-transactions/",{path:{chainId:be,address:Te},query:Me},st)}function h(be,Te,Me,st){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/multisig-transactions/",{path:{chainId:be,address:Te},query:Me},st)}function f(be,Te,Me="usd",st={}){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/balances/{currency}",{path:{chainId:be,address:Te,currency:Me},query:st})}function g(){return(0,n.getEndpoint)(s,"/v1/balances/supported-fiat-codes")}function p(be,Te){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/owners/{address}/safes",{path:{chainId:be,address:Te}})}function m(be){return(0,n.getEndpoint)(s,"/v1/owners/{address}/safes",{path:{address:be}})}function b(be,Te,Me={}){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:be,address:Te},query:Me})}function v(be,Te,Me={},st){return(0,n.getEndpoint)(s,"/v2/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:be,address:Te},query:Me},st)}function E(be,Te,Me={},st){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/transactions/history",{path:{chainId:be,safe_address:Te},query:Me},st)}function w(be,Te,Me={},st){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/transactions/queued",{path:{chainId:be,safe_address:Te},query:Me},st)}function C(be,Te){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/transactions/{transactionId}",{path:{chainId:be,transactionId:Te}})}function y(be,Te,Me){return(0,n.deleteEndpoint)(s,"/v1/chains/{chainId}/transactions/{safeTxHash}",{path:{chainId:be,safeTxHash:Te},body:{signature:Me}})}function _(be,Te,Me){return(0,n.postEndpoint)(s,"/v2/chains/{chainId}/safes/{safe_address}/multisig-transactions/estimations",{path:{chainId:be,safe_address:Te},body:Me})}function x(be,Te){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/nonces",{path:{chainId:be,safe_address:Te}})}function A(be,Te,Me){return(0,n.postEndpoint)(s,"/v1/chains/{chainId}/transactions/{safe_address}/propose",{path:{chainId:be,safe_address:Te},body:Me})}function T(be,Te,Me,st,Cr,hn){return(0,n.postEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/views/transaction-confirmation",{path:{chainId:be,safe_address:Te},body:{operation:Me,data:st,to:Cr,value:hn}})}function O(be,Te,Me,st,Cr,hn){return(0,n.postEndpoint)(s,"/v1/chains/{chainId}/transactions/{safe_address}/preview",{path:{chainId:be,safe_address:Te},body:{operation:Me,data:st,to:Cr,value:hn}})}function k(be){return(0,n.getEndpoint)(s,"/v1/chains",{query:be})}function j(be){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}",{path:{chainId:be}})}function N(be,Te={}){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/safe-apps",{path:{chainId:be},query:Te})}function S(be){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/about/master-copies",{path:{chainId:be}})}function P(be,Te,Me,st){return(0,n.postEndpoint)(s,"/v1/chains/{chainId}/data-decoder",{path:{chainId:be},body:{operation:Te,data:Me,to:st}})}function I(be,Te,Me){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:be,safe_address:Te},query:{}},Me)}function B(be,Te){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/messages/{message_hash}",{path:{chainId:be,message_hash:Te}})}function $(be,Te,Me){return(0,n.postEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:be,safe_address:Te},body:Me})}function R(be,Te,Me){return(0,n.postEndpoint)(s,"/v1/chains/{chainId}/messages/{message_hash}/signatures",{path:{chainId:be,message_hash:Te},body:Me})}function D(be,Te={}){return(0,n.getEndpoint)(s,"/v2/chains/{chainId}/delegates",{path:{chainId:be},query:Te})}function L(be){return(0,n.postEndpoint)(s,"/v1/register/notifications",{body:be})}function U(be,Te,Me){return(0,n.deleteEndpoint)(s,"/v1/chains/{chainId}/notifications/devices/{uuid}/safes/{safe_address}",{path:{chainId:be,safe_address:Te,uuid:Me}})}function z(be,Te){return(0,n.deleteEndpoint)(s,"/v1/chains/{chainId}/notifications/devices/{uuid}",{path:{chainId:be,uuid:Te}})}function W(be,Te,Me,st){return(0,n.postEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/emails",{path:{chainId:be,safe_address:Te},body:Me,headers:st})}function K(be,Te,Me,st,Cr){return(0,n.putEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}",{path:{chainId:be,safe_address:Te,signer:Me},body:st,headers:Cr})}function J(be,Te,Me){return(0,n.postEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify-resend",{path:{chainId:be,safe_address:Te,signer:Me},body:""})}function ne(be,Te,Me,st){return(0,n.putEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify",{path:{chainId:be,safe_address:Te,signer:Me},body:st})}function ae(be,Te,Me,st){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}",{path:{chainId:be,safe_address:Te,signer:Me},headers:st})}function he(be,Te,Me,st){return(0,n.deleteEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}",{path:{chainId:be,safe_address:Te,signer:Me},headers:st})}function ie(be,Te,Me){return(0,n.postEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/recovery",{path:{chainId:be,safe_address:Te},body:Me})}function Ee(be){return(0,n.deleteEndpoint)(s,"/v1/subscriptions",{query:be})}function pe(be){return(0,n.deleteEndpoint)(s,"/v1/subscriptions/all",{query:be})}function ve(be,Te){return(0,n.getEndpoint)(s,"/v1/safes",{query:Object.assign(Object.assign({},Te),{safes:be.join(",")})})}function je(be,Te){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/contracts/{contractAddress}",{path:{chainId:be,contractAddress:Te}})}function rt(){return(0,n.getEndpoint)(s,"/v1/auth/nonce",{credentials:"include"})}function Ce(be){return(0,n.postEndpoint)(s,"/v1/auth/verify",{body:be,credentials:"include"})}function fe(be){return(0,n.postEndpoint)(s,"/v1/accounts",{body:be,credentials:"include"})}function ft(be){return(0,n.getEndpoint)(s,"/v1/accounts/{address}",{path:{address:be},credentials:"include"})}function Wt(be){return(0,n.deleteEndpoint)(s,"/v1/accounts/{address}",{path:{address:be},credentials:"include"})}function lr(){return(0,n.getEndpoint)(s,"/v1/accounts/data-types")}function dr(be){return(0,n.getEndpoint)(s,"/v1/accounts/{address}/data-settings",{path:{address:be},credentials:"include"})}function hr(be,Te){return(0,n.putEndpoint)(s,"/v1/accounts/{address}/data-settings",{path:{address:be},body:Te,credentials:"include"})}function Er(be){return(0,n.getEndpoint)(s,"/v1/chains/{chainId}/about/indexing",{path:{chainId:be}})}}(bh)),bh}var eM;function YTe(){return eM||(eM=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TransferDirection=t.TransactionStatus=t.TokenType=t.Operation=void 0;var e=AQ();Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return e.Operation}}),Object.defineProperty(t,"TokenType",{enumerable:!0,get:function(){return e.TokenType}}),Object.defineProperty(t,"TransactionStatus",{enumerable:!0,get:function(){return e.TransactionStatus}}),Object.defineProperty(t,"TransferDirection",{enumerable:!0,get:function(){return e.TransferDirection}})}(lT)),lT}var fT={},tM;function JTe(){return tM||(tM=1,Object.defineProperty(fT,"__esModule",{value:!0}),Mp()),fT}var rM;function lO(){return rM||(rM=1,function(t){var e=wh&&wh.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=wh&&wh.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(jTe(),t),r(BTe(),t),r(YTe(),t),r(JTe(),t)}(wh)),wh}var nM;function QTe(){if(nM)return nw;nM=1,Object.defineProperty(nw,"__esModule",{value:!0}),nw.TXs=void 0;const t=Mp(),e=lO();class r{constructor(i){this.communicator=i}async getBySafeTxHash(i){if(!i)throw new Error("Invalid safeTxHash");return(await this.communicator.send(t.Methods.getTxBySafeTxHash,{safeTxHash:i})).data}async signMessage(i){const s={message:i};return(await this.communicator.send(t.Methods.signMessage,s)).data}async signTypedMessage(i){if(!(0,e.isObjectEIP712TypedData)(i))throw new Error("Invalid typed data");return(await this.communicator.send(t.Methods.signTypedMessage,{typedData:i})).data}async send({txs:i,params:s}){if(!i||!i.length)throw new Error("No transactions were passed");const o={txs:i,params:s};return(await this.communicator.send(t.Methods.sendTransactions,o)).data}}return nw.TXs=r,nw}var uw={},lw={},iM;function dO(){return iM||(iM=1,Object.defineProperty(lw,"__esModule",{value:!0}),lw.RPC_CALLS=void 0,lw.RPC_CALLS={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"}),lw}var sM;function XTe(){if(sM)return uw;sM=1,Object.defineProperty(uw,"__esModule",{value:!0}),uw.Eth=void 0;const t=dO(),e=Mp(),r={defaultBlockParam:(i="latest")=>i,returnFullTxObjectParam:(i=!1)=>i,blockNumberToHex:i=>Number.isInteger(i)?`0x${i.toString(16)}`:i};class n{constructor(s){this.communicator=s,this.call=this.buildRequest({call:t.RPC_CALLS.eth_call,formatters:[null,r.defaultBlockParam]}),this.getBalance=this.buildRequest({call:t.RPC_CALLS.eth_getBalance,formatters:[null,r.defaultBlockParam]}),this.getCode=this.buildRequest({call:t.RPC_CALLS.eth_getCode,formatters:[null,r.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:t.RPC_CALLS.eth_getStorageAt,formatters:[null,r.blockNumberToHex,r.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:t.RPC_CALLS.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:t.RPC_CALLS.eth_getBlockByHash,formatters:[null,r.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:t.RPC_CALLS.eth_getBlockByNumber,formatters:[r.blockNumberToHex,r.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:t.RPC_CALLS.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:t.RPC_CALLS.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:t.RPC_CALLS.eth_getTransactionCount,formatters:[null,r.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:t.RPC_CALLS.eth_gasPrice}),this.getEstimateGas=o=>this.buildRequest({call:t.RPC_CALLS.eth_estimateGas})([o]),this.setSafeSettings=this.buildRequest({call:t.RPC_CALLS.safe_setSettings})}buildRequest(s){const{call:o,formatters:a}=s;return async c=>{a&&Array.isArray(c)&&a.forEach((d,h)=>{d&&(c[h]=d(c[h]))});const u={call:o,params:c||[]};return(await this.communicator.send(e.Methods.rpcCall,u)).data}}}return uw.Eth=n,uw}var Rc={},pT={},Eb={},dw={},hw={},oM;function eIe(){return oM||(oM=1,Object.defineProperty(hw,"__esModule",{value:!0}),hw.version=void 0,hw.version="1.0.8"),hw}var aM;function w1(){if(aM)return dw;aM=1,Object.defineProperty(dw,"__esModule",{value:!0}),dw.BaseError=void 0;const t=eIe();class e extends Error{constructor(n,i={}){var c;const s=i.cause instanceof e?i.cause.details:(c=i.cause)!=null&&c.message?i.cause.message:i.details,o=i.cause instanceof e&&i.cause.docsPath||i.docsPath,a=[n||"An error occurred.","",...i.metaMessages?[...i.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...s?[`Details: ${s}`]:[],`Version: abitype@${t.version}`].join(`
- `);super(a),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),i.cause&&(this.cause=i.cause),this.details=s,this.docsPath=o,this.metaMessages=i.metaMessages,this.shortMessage=n}}return dw.BaseError=e,dw}var R3={},cM;function tIe(){if(cM)return R3;cM=1,Object.defineProperty(R3,"__esModule",{value:!0}),R3.narrow=t;function t(e){return e}return R3}var k3={},N3={},$3={},j3={},Ca={},uM;function VA(){if(uM)return Ca;uM=1,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.isTupleRegex=Ca.integerRegex=Ca.bytesRegex=void 0,Ca.execTyped=t;function t(e,r){const n=e.exec(r);return n==null?void 0:n.groups}return Ca.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ca.integerRegex=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Ca.isTupleRegex=/^\(.+?\).*?$/,Ca}var lM;function xQ(){if(lM)return j3;lM=1,Object.defineProperty(j3,"__esModule",{value:!0}),j3.formatAbiParameter=r;const t=VA(),e=/^tuple(?<array>(\[(\d*)\])*)$/;function r(n){let i=n.type;if(e.test(n.type)&&"components"in n){i="(";const s=n.components.length;for(let a=0;a<s;a++){const c=n.components[a];i+=r(c),a<s-1&&(i+=", ")}const o=(0,t.execTyped)(e,n.type);return i+=`)${(o==null?void 0:o.array)??""}`,r({...n,type:i})}return"indexed"in n&&n.indexed&&(i=`${i} indexed`),n.name?`${i} ${n.name}`:i}return j3}var dM;function SQ(){if(dM)return $3;dM=1,Object.defineProperty($3,"__esModule",{value:!0}),$3.formatAbiParameters=e;const t=xQ();function e(r){let n="";const i=r.length;for(let s=0;s<i;s++){const o=r[s];n+=(0,t.formatAbiParameter)(o),s!==i-1&&(n+=", ")}return n}return $3}var hM;function TQ(){if(hM)return N3;hM=1,Object.defineProperty(N3,"__esModule",{value:!0}),N3.formatAbiItem=e;const t=SQ();function e(r){var n;return r.type==="function"?`function ${r.name}(${(0,t.formatAbiParameters)(r.inputs)})${r.stateMutability&&r.stateMutability!=="nonpayable"?` ${r.stateMutability}`:""}${(n=r.outputs)!=null&&n.length?` returns (${(0,t.formatAbiParameters)(r.outputs)})`:""}`:r.type==="event"?`event ${r.name}(${(0,t.formatAbiParameters)(r.inputs)})`:r.type==="error"?`error ${r.name}(${(0,t.formatAbiParameters)(r.inputs)})`:r.type==="constructor"?`constructor(${(0,t.formatAbiParameters)(r.inputs)})${r.stateMutability==="payable"?" payable":""}`:r.type==="fallback"?`fallback() external${r.stateMutability==="payable"?" payable":""}`:"receive() external payable"}return N3}var fM;function rIe(){if(fM)return k3;fM=1,Object.defineProperty(k3,"__esModule",{value:!0}),k3.formatAbi=e;const t=TQ();function e(r){const n=[],i=r.length;for(let s=0;s<i;s++){const o=r[s],a=(0,t.formatAbiItem)(o);n.push(a)}return n}return k3}var B3={},Fr={},pM;function b1(){if(pM)return Fr;pM=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.functionModifiers=Fr.eventModifiers=Fr.modifiers=void 0,Fr.isErrorSignature=r,Fr.execErrorSignature=n,Fr.isEventSignature=s,Fr.execEventSignature=o,Fr.isFunctionSignature=c,Fr.execFunctionSignature=u,Fr.isStructSignature=d,Fr.execStructSignature=h,Fr.isConstructorSignature=g,Fr.execConstructorSignature=p,Fr.isFallbackSignature=b,Fr.execFallbackSignature=v,Fr.isReceiveSignature=w;const t=VA(),e=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function r(C){return e.test(C)}function n(C){return(0,t.execTyped)(e,C)}const i=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function s(C){return i.test(C)}function o(C){return(0,t.execTyped)(i,C)}const a=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function c(C){return a.test(C)}function u(C){return(0,t.execTyped)(a,C)}const l=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function d(C){return l.test(C)}function h(C){return(0,t.execTyped)(l,C)}const f=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function g(C){return f.test(C)}function p(C){return(0,t.execTyped)(f,C)}const m=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function b(C){return m.test(C)}function v(C){return(0,t.execTyped)(m,C)}const E=/^receive\(\) external payable$/;function w(C){return E.test(C)}return Fr.modifiers=new Set(["memory","indexed","storage","calldata"]),Fr.eventModifiers=new Set(["indexed"]),Fr.functionModifiers=new Set(["calldata","memory","storage"]),Fr}var D3={},kc={},gM;function GA(){if(gM)return kc;gM=1,Object.defineProperty(kc,"__esModule",{value:!0}),kc.UnknownSolidityTypeError=kc.UnknownTypeError=kc.InvalidAbiItemError=void 0;const t=w1();class e extends t.BaseError{constructor({signature:s}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(s,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}kc.InvalidAbiItemError=e;class r extends t.BaseError{constructor({type:s}){super("Unknown type.",{metaMessages:[`Type "${s}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}kc.UnknownTypeError=r;class n extends t.BaseError{constructor({type:s}){super("Unknown type.",{metaMessages:[`Type "${s}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}return kc.UnknownSolidityTypeError=n,kc}var jn={},mM;function b2(){if(mM)return jn;mM=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.InvalidAbiTypeParameterError=jn.InvalidFunctionModifierError=jn.InvalidModifierError=jn.SolidityProtectedKeywordError=jn.InvalidParameterError=jn.InvalidAbiParametersError=jn.InvalidAbiParameterError=void 0;const t=w1();class e extends t.BaseError{constructor({param:u}){super("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(u,null,2)})`,docsPath:"/api/human#parseabiparameter-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParameterError"})}}jn.InvalidAbiParameterError=e;class r extends t.BaseError{constructor({params:u}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(u,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}jn.InvalidAbiParametersError=r;class n extends t.BaseError{constructor({param:u}){super("Invalid ABI parameter.",{details:u}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}jn.InvalidParameterError=n;class i extends t.BaseError{constructor({param:u,name:l}){super("Invalid ABI parameter.",{details:u,metaMessages:[`"${l}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}jn.SolidityProtectedKeywordError=i;class s extends t.BaseError{constructor({param:u,type:l,modifier:d}){super("Invalid ABI parameter.",{details:u,metaMessages:[`Modifier "${d}" not allowed${l?` in "${l}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}jn.InvalidModifierError=s;class o extends t.BaseError{constructor({param:u,type:l,modifier:d}){super("Invalid ABI parameter.",{details:u,metaMessages:[`Modifier "${d}" not allowed${l?` in "${l}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${d}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}jn.InvalidFunctionModifierError=o;class a extends t.BaseError{constructor({abiParameter:u}){super("Invalid ABI parameter.",{details:JSON.stringify(u,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}return jn.InvalidAbiTypeParameterError=a,jn}var Nc={},wM;function hO(){if(wM)return Nc;wM=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.InvalidStructSignatureError=Nc.UnknownSignatureError=Nc.InvalidSignatureError=void 0;const t=w1();class e extends t.BaseError{constructor({signature:s,type:o}){super(`Invalid ${o} signature.`,{details:s}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}Nc.InvalidSignatureError=e;class r extends t.BaseError{constructor({signature:s}){super("Unknown signature.",{details:s}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}Nc.UnknownSignatureError=r;class n extends t.BaseError{constructor({signature:s}){super("Invalid struct signature.",{details:s,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}return Nc.InvalidStructSignatureError=n,Nc}var fw={},bM;function IQ(){if(bM)return fw;bM=1,Object.defineProperty(fw,"__esModule",{value:!0}),fw.CircularReferenceError=void 0;const t=w1();class e extends t.BaseError{constructor({type:n}){super("Circular reference detected.",{metaMessages:[`Struct "${n}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}return fw.CircularReferenceError=e,fw}var Li={},pw={},yM;function PQ(){if(yM)return pw;yM=1,Object.defineProperty(pw,"__esModule",{value:!0}),pw.InvalidParenthesisError=void 0;const t=w1();class e extends t.BaseError{constructor({current:n,depth:i}){super("Unbalanced parentheses.",{metaMessages:[`"${n.trim()}" has too many ${i>0?"opening":"closing"} parentheses.`],details:`Depth "${i}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}return pw.InvalidParenthesisError=e,pw}var m0={},vM;function nIe(){if(vM)return m0;vM=1,Object.defineProperty(m0,"__esModule",{value:!0}),m0.parameterCache=void 0,m0.getParameterCacheKey=t;function t(e,r,n){let i="";if(n)for(const s of Object.entries(n)){if(!s)continue;let o="";for(const a of s[1])o+=`[${a.type}${a.name?`:${a.name}`:""}]`;i+=`(${s[0]}{${o}})`}return r?`${r}:${e}${i}`:e}return m0.parameterCache=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),m0}var _M;function Zm(){if(_M)return Li;_M=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.parseSignature=a,Li.parseFunctionSignature=c,Li.parseEventSignature=u,Li.parseErrorSignature=l,Li.parseConstructorSignature=d,Li.parseFallbackSignature=h,Li.parseAbiParameter=m,Li.splitParameters=b,Li.isSolidityType=v,Li.isSolidityKeyword=w,Li.isValidDataLocation=C;const t=VA(),e=GA(),r=b2(),n=hO(),i=PQ(),s=nIe(),o=b1();function a(y,_={}){if((0,o.isFunctionSignature)(y))return c(y,_);if((0,o.isEventSignature)(y))return u(y,_);if((0,o.isErrorSignature)(y))return l(y,_);if((0,o.isConstructorSignature)(y))return d(y,_);if((0,o.isFallbackSignature)(y))return h(y);if((0,o.isReceiveSignature)(y))return{type:"receive",stateMutability:"payable"};throw new n.UnknownSignatureError({signature:y})}function c(y,_={}){const x=(0,o.execFunctionSignature)(y);if(!x)throw new n.InvalidSignatureError({signature:y,type:"function"});const A=b(x.parameters),T=[],O=A.length;for(let j=0;j<O;j++)T.push(m(A[j],{modifiers:o.functionModifiers,structs:_,type:"function"}));const k=[];if(x.returns){const j=b(x.returns),N=j.length;for(let S=0;S<N;S++)k.push(m(j[S],{modifiers:o.functionModifiers,structs:_,type:"function"}))}return{name:x.name,type:"function",stateMutability:x.stateMutability??"nonpayable",inputs:T,outputs:k}}function u(y,_={}){const x=(0,o.execEventSignature)(y);if(!x)throw new n.InvalidSignatureError({signature:y,type:"event"});const A=b(x.parameters),T=[],O=A.length;for(let k=0;k<O;k++)T.push(m(A[k],{modifiers:o.eventModifiers,structs:_,type:"event"}));return{name:x.name,type:"event",inputs:T}}function l(y,_={}){const x=(0,o.execErrorSignature)(y);if(!x)throw new n.InvalidSignatureError({signature:y,type:"error"});const A=b(x.parameters),T=[],O=A.length;for(let k=0;k<O;k++)T.push(m(A[k],{structs:_,type:"error"}));return{name:x.name,type:"error",inputs:T}}function d(y,_={}){const x=(0,o.execConstructorSignature)(y);if(!x)throw new n.InvalidSignatureError({signature:y,type:"constructor"});const A=b(x.parameters),T=[],O=A.length;for(let k=0;k<O;k++)T.push(m(A[k],{structs:_,type:"constructor"}));return{type:"constructor",stateMutability:x.stateMutability??"nonpayable",inputs:T}}function h(y){const _=(0,o.execFallbackSignature)(y);if(!_)throw new n.InvalidSignatureError({signature:y,type:"fallback"});return{type:"fallback",stateMutability:_.stateMutability??"nonpayable"}}const f=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,g=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,p=/^u?int$/;function m(y,_){var I,B;const x=(0,s.getParameterCacheKey)(y,_==null?void 0:_.type,_==null?void 0:_.structs);if(s.parameterCache.has(x))return s.parameterCache.get(x);const A=t.isTupleRegex.test(y),T=(0,t.execTyped)(A?g:f,y);if(!T)throw new r.InvalidParameterError({param:y});if(T.name&&w(T.name))throw new r.SolidityProtectedKeywordError({param:y,name:T.name});const O=T.name?{name:T.name}:{},k=T.modifier==="indexed"?{indexed:!0}:{},j=(_==null?void 0:_.structs)??{};let N,S={};if(A){N="tuple";const $=b(T.type),R=[],D=$.length;for(let L=0;L<D;L++)R.push(m($[L],{structs:j}));S={components:R}}else if(T.type in j)N="tuple",S={components:j[T.type]};else if(p.test(T.type))N=`${T.type}256`;else if(N=T.type,(_==null?void 0:_.type)!=="struct"&&!v(N))throw new e.UnknownSolidityTypeError({type:N});if(T.modifier){if(!((B=(I=_==null?void 0:_.modifiers)==null?void 0:I.has)!=null&&B.call(I,T.modifier)))throw new r.InvalidModifierError({param:y,type:_==null?void 0:_.type,modifier:T.modifier});if(o.functionModifiers.has(T.modifier)&&!C(N,!!T.array))throw new r.InvalidFunctionModifierError({param:y,type:_==null?void 0:_.type,modifier:T.modifier})}const P={type:`${N}${T.array??""}`,...O,...k,...S};return s.parameterCache.set(x,P),P}function b(y,_=[],x="",A=0){const T=y.trim().length;for(let O=0;O<T;O++){const k=y[O],j=y.slice(O+1);switch(k){case",":return A===0?b(j,[..._,x.trim()]):b(j,_,`${x}${k}`,A);case"(":return b(j,_,`${x}${k}`,A+1);case")":return b(j,_,`${x}${k}`,A-1);default:return b(j,_,`${x}${k}`,A)}}if(x==="")return _;if(A!==0)throw new i.InvalidParenthesisError({current:x,depth:A});return _.push(x.trim()),_}function v(y){return y==="address"||y==="bool"||y==="function"||y==="string"||t.bytesRegex.test(y)||t.integerRegex.test(y)}const E=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function w(y){return y==="address"||y==="bool"||y==="function"||y==="string"||y==="tuple"||t.bytesRegex.test(y)||t.integerRegex.test(y)||E.test(y)}function C(y,_){return _||y==="bytes"||y==="string"||y==="tuple"}return Li}var EM;function KA(){if(EM)return D3;EM=1,Object.defineProperty(D3,"__esModule",{value:!0}),D3.parseStructs=a;const t=VA(),e=GA(),r=b2(),n=hO(),i=IQ(),s=b1(),o=Zm();function a(l){const d={},h=l.length;for(let m=0;m<h;m++){const b=l[m];if(!(0,s.isStructSignature)(b))continue;const v=(0,s.execStructSignature)(b);if(!v)throw new n.InvalidSignatureError({signature:b,type:"struct"});const E=v.properties.split(";"),w=[],C=E.length;for(let y=0;y<C;y++){const x=E[y].trim();if(!x)continue;const A=(0,o.parseAbiParameter)(x,{type:"struct"});w.push(A)}if(!w.length)throw new n.InvalidStructSignatureError({signature:b});d[v.name]=w}const f={},g=Object.entries(d),p=g.length;for(let m=0;m<p;m++){const[b,v]=g[m];f[b]=u(v,d)}return f}const c=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function u(l,d,h=new Set){const f=[],g=l.length;for(let p=0;p<g;p++){const m=l[p];if(t.isTupleRegex.test(m.type))f.push(m);else{const v=(0,t.execTyped)(c,m.type);if(!(v!=null&&v.type))throw new r.InvalidAbiTypeParameterError({abiParameter:m});const{array:E,type:w}=v;if(w in d){if(h.has(w))throw new i.CircularReferenceError({type:w});f.push({...m,type:`tuple${E??""}`,components:u(d[w]??[],d,new Set([...h,w]))})}else if((0,o.isSolidityType)(w))f.push(m);else throw new e.UnknownTypeError({type:w})}}return f}return D3}var CM;function iIe(){if(CM)return B3;CM=1,Object.defineProperty(B3,"__esModule",{value:!0}),B3.parseAbi=n;const t=b1(),e=KA(),r=Zm();function n(i){const s=(0,e.parseStructs)(i),o=[],a=i.length;for(let c=0;c<a;c++){const u=i[c];(0,t.isStructSignature)(u)||o.push((0,r.parseSignature)(u,s))}return o}return B3}var M3={},AM;function sIe(){if(AM)return M3;AM=1,Object.defineProperty(M3,"__esModule",{value:!0}),M3.parseAbiItem=i;const t=GA(),e=b1(),r=KA(),n=Zm();function i(s){let o;if(typeof s=="string")o=(0,n.parseSignature)(s);else{const a=(0,r.parseStructs)(s),c=s.length;for(let u=0;u<c;u++){const l=s[u];if(!(0,e.isStructSignature)(l)){o=(0,n.parseSignature)(l,a);break}}}if(!o)throw new t.InvalidAbiItemError({signature:s});return o}return M3}var L3={},xM;function oIe(){if(xM)return L3;xM=1,Object.defineProperty(L3,"__esModule",{value:!0}),L3.parseAbiParameter=i;const t=b2(),e=b1(),r=KA(),n=Zm();function i(s){let o;if(typeof s=="string")o=(0,n.parseAbiParameter)(s,{modifiers:e.modifiers});else{const a=(0,r.parseStructs)(s),c=s.length;for(let u=0;u<c;u++){const l=s[u];if(!(0,e.isStructSignature)(l)){o=(0,n.parseAbiParameter)(l,{modifiers:e.modifiers,structs:a});break}}}if(!o)throw new t.InvalidAbiParameterError({param:s});return o}return L3}var U3={},SM;function aIe(){if(SM)return U3;SM=1,Object.defineProperty(U3,"__esModule",{value:!0}),U3.parseAbiParameters=s;const t=b2(),e=b1(),r=KA(),n=Zm(),i=Zm();function s(o){const a=[];if(typeof o=="string"){const c=(0,n.splitParameters)(o),u=c.length;for(let l=0;l<u;l++)a.push((0,i.parseAbiParameter)(c[l],{modifiers:e.modifiers}))}else{const c=(0,r.parseStructs)(o),u=o.length;for(let l=0;l<u;l++){const d=o[l];if((0,e.isStructSignature)(d))continue;const h=(0,n.splitParameters)(d),f=h.length;for(let g=0;g<f;g++)a.push((0,i.parseAbiParameter)(h[g],{modifiers:e.modifiers,structs:c}))}}if(a.length===0)throw new t.InvalidAbiParametersError({params:o});return a}return U3}var TM;function Kd(){return TM||(TM=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CircularReferenceError=t.InvalidParenthesisError=t.UnknownSignatureError=t.InvalidSignatureError=t.InvalidStructSignatureError=t.InvalidAbiParameterError=t.InvalidAbiParametersError=t.InvalidParameterError=t.SolidityProtectedKeywordError=t.InvalidModifierError=t.InvalidFunctionModifierError=t.InvalidAbiTypeParameterError=t.UnknownSolidityTypeError=t.InvalidAbiItemError=t.UnknownTypeError=t.parseAbiParameters=t.parseAbiParameter=t.parseAbiItem=t.parseAbi=t.formatAbiParameters=t.formatAbiParameter=t.formatAbiItem=t.formatAbi=t.narrow=t.BaseError=void 0;var e=w1();Object.defineProperty(t,"BaseError",{enumerable:!0,get:function(){return e.BaseError}});var r=tIe();Object.defineProperty(t,"narrow",{enumerable:!0,get:function(){return r.narrow}});var n=rIe();Object.defineProperty(t,"formatAbi",{enumerable:!0,get:function(){return n.formatAbi}});var i=TQ();Object.defineProperty(t,"formatAbiItem",{enumerable:!0,get:function(){return i.formatAbiItem}});var s=xQ();Object.defineProperty(t,"formatAbiParameter",{enumerable:!0,get:function(){return s.formatAbiParameter}});var o=SQ();Object.defineProperty(t,"formatAbiParameters",{enumerable:!0,get:function(){return o.formatAbiParameters}});var a=iIe();Object.defineProperty(t,"parseAbi",{enumerable:!0,get:function(){return a.parseAbi}});var c=sIe();Object.defineProperty(t,"parseAbiItem",{enumerable:!0,get:function(){return c.parseAbiItem}});var u=oIe();Object.defineProperty(t,"parseAbiParameter",{enumerable:!0,get:function(){return u.parseAbiParameter}});var l=aIe();Object.defineProperty(t,"parseAbiParameters",{enumerable:!0,get:function(){return l.parseAbiParameters}});var d=GA();Object.defineProperty(t,"UnknownTypeError",{enumerable:!0,get:function(){return d.UnknownTypeError}}),Object.defineProperty(t,"InvalidAbiItemError",{enumerable:!0,get:function(){return d.InvalidAbiItemError}}),Object.defineProperty(t,"UnknownSolidityTypeError",{enumerable:!0,get:function(){return d.UnknownSolidityTypeError}});var h=b2();Object.defineProperty(t,"InvalidAbiTypeParameterError",{enumerable:!0,get:function(){return h.InvalidAbiTypeParameterError}}),Object.defineProperty(t,"InvalidFunctionModifierError",{enumerable:!0,get:function(){return h.InvalidFunctionModifierError}}),Object.defineProperty(t,"InvalidModifierError",{enumerable:!0,get:function(){return h.InvalidModifierError}}),Object.defineProperty(t,"SolidityProtectedKeywordError",{enumerable:!0,get:function(){return h.SolidityProtectedKeywordError}}),Object.defineProperty(t,"InvalidParameterError",{enumerable:!0,get:function(){return h.InvalidParameterError}}),Object.defineProperty(t,"InvalidAbiParametersError",{enumerable:!0,get:function(){return h.InvalidAbiParametersError}}),Object.defineProperty(t,"InvalidAbiParameterError",{enumerable:!0,get:function(){return h.InvalidAbiParameterError}});var f=hO();Object.defineProperty(t,"InvalidStructSignatureError",{enumerable:!0,get:function(){return f.InvalidStructSignatureError}}),Object.defineProperty(t,"InvalidSignatureError",{enumerable:!0,get:function(){return f.InvalidSignatureError}}),Object.defineProperty(t,"UnknownSignatureError",{enumerable:!0,get:function(){return f.UnknownSignatureError}});var g=PQ();Object.defineProperty(t,"InvalidParenthesisError",{enumerable:!0,get:function(){return g.InvalidParenthesisError}});var p=IQ();Object.defineProperty(t,"CircularReferenceError",{enumerable:!0,get:function(){return p.CircularReferenceError}})}(Eb)),Eb}var w0={},F3={},IM;function ur(){if(IM)return F3;IM=1,Object.defineProperty(F3,"__esModule",{value:!0}),F3.getAction=t;function t(e,r,n){const i=e[r.name];if(typeof i=="function")return i;const s=e[n];return typeof s=="function"?s:o=>r(e,o)}return F3}var H3={},q3={},it={},gw={},PM;function el(){if(PM)return gw;PM=1,Object.defineProperty(gw,"__esModule",{value:!0}),gw.formatAbiItem=e,gw.formatAbiParams=r;const t=$r();function e(i,{includeName:s=!1}={}){if(i.type!=="function"&&i.type!=="event"&&i.type!=="error")throw new t.InvalidDefinitionTypeError(i.type);return`${i.name}(${r(i.inputs,{includeName:s})})`}function r(i,{includeName:s=!1}={}){return i?i.map(o=>n(o,{includeName:s})).join(s?", ":","):""}function n(i,{includeName:s}){return i.type.startsWith("tuple")?`(${r(i.components,{includeName:s})})${i.type.slice(5)}`:i.type+(s&&i.name?` ${i.name}`:"")}return gw}var z3={},W3={},OM;function ki(){if(OM)return W3;OM=1,Object.defineProperty(W3,"__esModule",{value:!0}),W3.isHex=t;function t(e,{strict:r=!0}={}){return!e||typeof e!="string"?!1:r?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}return W3}var RM;function rs(){if(RM)return z3;RM=1,Object.defineProperty(z3,"__esModule",{value:!0}),z3.size=e;const t=ki();function e(r){return(0,t.isHex)(r,{strict:!1})?Math.ceil((r.length-2)/2):r.length}return z3}var b0={},mw={},kM;function cIe(){return kM||(kM=1,Object.defineProperty(mw,"__esModule",{value:!0}),mw.version=void 0,mw.version="2.31.0"),mw}var NM;function _t(){if(NM)return b0;NM=1,Object.defineProperty(b0,"__esModule",{value:!0}),b0.BaseError=void 0,b0.setErrorConfig=r;const t=cIe();let e={getDocsUrl:({docsBaseUrl:s,docsPath:o="",docsSlug:a})=>o?`${s??"https://viem.sh"}${o}${a?`#${a}`:""}`:void 0,version:`viem@${t.version}`};function r(s){e=s}class n extends Error{constructor(o,a={}){var h;const c=(()=>{var f;return a.cause instanceof n?a.cause.details:(f=a.cause)!=null&&f.message?a.cause.message:a.details})(),u=a.cause instanceof n&&a.cause.docsPath||a.docsPath,l=(h=e.getDocsUrl)==null?void 0:h.call(e,{...a,docsPath:u}),d=[o||"An error occurred.","",...a.metaMessages?[...a.metaMessages,""]:[],...l?[`Docs: ${l}`]:[],...c?[`Details: ${c}`]:[],...e.version?[`Version: ${e.version}`]:[]].join(`
- `);super(d,a.cause?{cause:a.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=c,this.docsPath=u,this.metaMessages=a.metaMessages,this.name=a.name??this.name,this.shortMessage=o,this.version=t.version}walk(o){return i(this,o)}}b0.BaseError=n;function i(s,o){return o!=null&&o(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause!==void 0?i(s.cause,o):o?null:s}return b0}var $M;function $r(){if($M)return it;$M=1,Object.defineProperty(it,"__esModule",{value:!0}),it.UnsupportedPackedAbiType=it.InvalidDefinitionTypeError=it.InvalidArrayError=it.InvalidAbiDecodingTypeError=it.InvalidAbiEncodingTypeError=it.DecodeLogTopicsMismatch=it.DecodeLogDataMismatch=it.BytesSizeMismatchError=it.AbiItemAmbiguityError=it.AbiFunctionSignatureNotFoundError=it.AbiFunctionOutputsNotFoundError=it.AbiFunctionNotFoundError=it.AbiEventNotFoundError=it.AbiEventSignatureNotFoundError=it.AbiEventSignatureEmptyTopicsError=it.AbiErrorSignatureNotFoundError=it.AbiErrorNotFoundError=it.AbiErrorInputsNotFoundError=it.AbiEncodingLengthMismatchError=it.AbiEncodingBytesSizeMismatchError=it.AbiEncodingArrayLengthMismatchError=it.AbiDecodingZeroDataError=it.AbiDecodingDataSizeTooSmallError=it.AbiDecodingDataSizeInvalidError=it.AbiConstructorParamsNotFoundError=it.AbiConstructorNotFoundError=void 0;const t=el(),e=rs(),r=_t();class n extends r.BaseError{constructor({docsPath:N}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
- `),{docsPath:N,name:"AbiConstructorNotFoundError"})}}it.AbiConstructorNotFoundError=n;class i extends r.BaseError{constructor({docsPath:N}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
- `),{docsPath:N,name:"AbiConstructorParamsNotFoundError"})}}it.AbiConstructorParamsNotFoundError=i;class s extends r.BaseError{constructor({data:N,size:S}){super([`Data size of ${S} bytes is invalid.`,"Size must be in increments of 32 bytes (size % 32 === 0)."].join(`
- `),{metaMessages:[`Data: ${N} (${S} bytes)`],name:"AbiDecodingDataSizeInvalidError"})}}it.AbiDecodingDataSizeInvalidError=s;class o extends r.BaseError{constructor({data:N,params:S,size:P}){super([`Data size of ${P} bytes is too small for given parameters.`].join(`
- `),{metaMessages:[`Params: (${(0,t.formatAbiParams)(S,{includeName:!0})})`,`Data: ${N} (${P} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=N,this.params=S,this.size=P}}it.AbiDecodingDataSizeTooSmallError=o;class a extends r.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}it.AbiDecodingZeroDataError=a;class c extends r.BaseError{constructor({expectedLength:N,givenLength:S,type:P}){super([`ABI encoding array length mismatch for type ${P}.`,`Expected length: ${N}`,`Given length: ${S}`].join(`
- `),{name:"AbiEncodingArrayLengthMismatchError"})}}it.AbiEncodingArrayLengthMismatchError=c;class u extends r.BaseError{constructor({expectedSize:N,value:S}){super(`Size of bytes "${S}" (bytes${(0,e.size)(S)}) does not match expected size (bytes${N}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}it.AbiEncodingBytesSizeMismatchError=u;class l extends r.BaseError{constructor({expectedLength:N,givenLength:S}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${N}`,`Given length (values): ${S}`].join(`
- `),{name:"AbiEncodingLengthMismatchError"})}}it.AbiEncodingLengthMismatchError=l;class d extends r.BaseError{constructor(N,{docsPath:S}){super([`Arguments (\`args\`) were provided to "${N}", but "${N}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
- `),{docsPath:S,name:"AbiErrorInputsNotFoundError"})}}it.AbiErrorInputsNotFoundError=d;class h extends r.BaseError{constructor(N,{docsPath:S}={}){super([`Error ${N?`"${N}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
- `),{docsPath:S,name:"AbiErrorNotFoundError"})}}it.AbiErrorNotFoundError=h;class f extends r.BaseError{constructor(N,{docsPath:S}){super([`Encoded error signature "${N}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${N}.`].join(`
- `),{docsPath:S,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=N}}it.AbiErrorSignatureNotFoundError=f;class g extends r.BaseError{constructor({docsPath:N}){super("Cannot extract event signature from empty topics.",{docsPath:N,name:"AbiEventSignatureEmptyTopicsError"})}}it.AbiEventSignatureEmptyTopicsError=g;class p extends r.BaseError{constructor(N,{docsPath:S}){super([`Encoded event signature "${N}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${N}.`].join(`
- `),{docsPath:S,name:"AbiEventSignatureNotFoundError"})}}it.AbiEventSignatureNotFoundError=p;class m extends r.BaseError{constructor(N,{docsPath:S}={}){super([`Event ${N?`"${N}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
- `),{docsPath:S,name:"AbiEventNotFoundError"})}}it.AbiEventNotFoundError=m;class b extends r.BaseError{constructor(N,{docsPath:S}={}){super([`Function ${N?`"${N}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
- `),{docsPath:S,name:"AbiFunctionNotFoundError"})}}it.AbiFunctionNotFoundError=b;class v extends r.BaseError{constructor(N,{docsPath:S}){super([`Function "${N}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
- `),{docsPath:S,name:"AbiFunctionOutputsNotFoundError"})}}it.AbiFunctionOutputsNotFoundError=v;class E extends r.BaseError{constructor(N,{docsPath:S}){super([`Encoded function signature "${N}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${N}.`].join(`
- `),{docsPath:S,name:"AbiFunctionSignatureNotFoundError"})}}it.AbiFunctionSignatureNotFoundError=E;class w extends r.BaseError{constructor(N,S){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${N.type}\` in \`${(0,t.formatAbiItem)(N.abiItem)}\`, and`,`\`${S.type}\` in \`${(0,t.formatAbiItem)(S.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}it.AbiItemAmbiguityError=w;class C extends r.BaseError{constructor({expectedSize:N,givenSize:S}){super(`Expected bytes${N}, got bytes${S}.`,{name:"BytesSizeMismatchError"})}}it.BytesSizeMismatchError=C;class y extends r.BaseError{constructor({abiItem:N,data:S,params:P,size:I}){super([`Data size of ${I} bytes is too small for non-indexed event parameters.`].join(`
- `),{metaMessages:[`Params: (${(0,t.formatAbiParams)(P,{includeName:!0})})`,`Data: ${S} (${I} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=N,this.data=S,this.params=P,this.size=I}}it.DecodeLogDataMismatch=y;class _ extends r.BaseError{constructor({abiItem:N,param:S}){super([`Expected a topic for indexed event parameter${S.name?` "${S.name}"`:""} on event "${(0,t.formatAbiItem)(N,{includeName:!0})}".`].join(`
- `),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=N}}it.DecodeLogTopicsMismatch=_;class x extends r.BaseError{constructor(N,{docsPath:S}){super([`Type "${N}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
- `),{docsPath:S,name:"InvalidAbiEncodingType"})}}it.InvalidAbiEncodingTypeError=x;class A extends r.BaseError{constructor(N,{docsPath:S}){super([`Type "${N}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
- `),{docsPath:S,name:"InvalidAbiDecodingType"})}}it.InvalidAbiDecodingTypeError=A;class T extends r.BaseError{constructor(N){super([`Value "${N}" is not a valid array.`].join(`
- `),{name:"InvalidArrayError"})}}it.InvalidArrayError=T;class O extends r.BaseError{constructor(N){super([`"${N}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
- `),{name:"InvalidDefinitionTypeError"})}}it.InvalidDefinitionTypeError=O;class k extends r.BaseError{constructor(N){super(`Type "${N}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}return it.UnsupportedPackedAbiType=k,it}var ww={},jM;function OQ(){if(jM)return ww;jM=1,Object.defineProperty(ww,"__esModule",{value:!0}),ww.FilterTypeNotSupportedError=void 0;const t=_t();class e extends t.BaseError{constructor(n){super(`Filter type "${n}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}return ww.FilterTypeNotSupportedError=e,ww}var xl={},y0={},$c={},BM;function ZA(){if(BM)return $c;BM=1,Object.defineProperty($c,"__esModule",{value:!0}),$c.InvalidBytesLengthError=$c.SizeExceedsPaddingSizeError=$c.SliceOffsetOutOfBoundsError=void 0;const t=_t();class e extends t.BaseError{constructor({offset:s,position:o,size:a}){super(`Slice ${o==="start"?"starting":"ending"} at offset "${s}" is out-of-bounds (size: ${a}).`,{name:"SliceOffsetOutOfBoundsError"})}}$c.SliceOffsetOutOfBoundsError=e;class r extends t.BaseError{constructor({size:s,targetSize:o,type:a}){super(`${a.charAt(0).toUpperCase()}${a.slice(1).toLowerCase()} size (${s}) exceeds padding size (${o}).`,{name:"SizeExceedsPaddingSizeError"})}}$c.SizeExceedsPaddingSizeError=r;class n extends t.BaseError{constructor({size:s,targetSize:o,type:a}){super(`${a.charAt(0).toUpperCase()}${a.slice(1).toLowerCase()} is expected to be ${o} ${a} long, but is ${s} ${a} long.`,{name:"InvalidBytesLengthError"})}}return $c.InvalidBytesLengthError=n,$c}var DM;function Zd(){if(DM)return y0;DM=1,Object.defineProperty(y0,"__esModule",{value:!0}),y0.pad=e,y0.padHex=r,y0.padBytes=n;const t=ZA();function e(i,{dir:s,size:o=32}={}){return typeof i=="string"?r(i,{dir:s,size:o}):n(i,{dir:s,size:o})}function r(i,{dir:s,size:o=32}={}){if(o===null)return i;const a=i.replace("0x","");if(a.length>o*2)throw new t.SizeExceedsPaddingSizeError({size:Math.ceil(a.length/2),targetSize:o,type:"hex"});return`0x${a[s==="right"?"padEnd":"padStart"](o*2,"0")}`}function n(i,{dir:s,size:o=32}={}){if(o===null)return i;if(i.length>o)throw new t.SizeExceedsPaddingSizeError({size:i.length,targetSize:o,type:"bytes"});const a=new Uint8Array(o);for(let c=0;c<o;c++){const u=s==="right";a[u?c:o-c-1]=i[u?c:i.length-c-1]}return a}return y0}var jc={},as={},MM;function y1(){if(MM)return as;MM=1,Object.defineProperty(as,"__esModule",{value:!0}),as.SizeOverflowError=as.InvalidHexValueError=as.InvalidHexBooleanError=as.InvalidBytesBooleanError=as.IntegerOutOfRangeError=void 0;const t=_t();class e extends t.BaseError{constructor({max:a,min:c,signed:u,size:l,value:d}){super(`Number "${d}" is not in safe ${l?`${l*8}-bit ${u?"signed":"unsigned"} `:""}integer range ${a?`(${c} to ${a})`:`(above ${c})`}`,{name:"IntegerOutOfRangeError"})}}as.IntegerOutOfRangeError=e;class r extends t.BaseError{constructor(a){super(`Bytes value "${a}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}as.InvalidBytesBooleanError=r;class n extends t.BaseError{constructor(a){super(`Hex value "${a}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}as.InvalidHexBooleanError=n;class i extends t.BaseError{constructor(a){super(`Hex value "${a}" is an odd length (${a.length}). It must be an even length.`,{name:"InvalidHexValueError"})}}as.InvalidHexValueError=i;class s extends t.BaseError{constructor({givenSize:a,maxSize:c}){super(`Size cannot exceed ${c} bytes. Given size: ${a} bytes.`,{name:"SizeOverflowError"})}}return as.SizeOverflowError=s,as}var V3={},LM;function tl(){if(LM)return V3;LM=1,Object.defineProperty(V3,"__esModule",{value:!0}),V3.trim=t;function t(e,{dir:r="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,i=0;for(let s=0;s<n.length-1&&n[r==="left"?s:n.length-s-1].toString()==="0";s++)i++;return n=r==="left"?n.slice(i):n.slice(0,n.length-i),typeof e=="string"?(n.length===1&&r==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}return V3}var UM;function nn(){if(UM)return jc;UM=1,Object.defineProperty(jc,"__esModule",{value:!0}),jc.assertSize=i,jc.fromHex=s,jc.hexToBigInt=o,jc.hexToBool=a,jc.hexToNumber=c,jc.hexToString=u;const t=y1(),e=rs(),r=tl(),n=Tr();function i(l,{size:d}){if((0,e.size)(l)>d)throw new t.SizeOverflowError({givenSize:(0,e.size)(l),maxSize:d})}function s(l,d){const h=typeof d=="string"?{to:d}:d,f=h.to;return f==="number"?c(l,h):f==="bigint"?o(l,h):f==="string"?u(l,h):f==="boolean"?a(l,h):(0,n.hexToBytes)(l,h)}function o(l,d={}){const{signed:h}=d;d.size&&i(l,{size:d.size});const f=BigInt(l);if(!h)return f;const g=(l.length-2)/2,p=(1n<<BigInt(g)*8n-1n)-1n;return f<=p?f:f-BigInt(`0x${"f".padStart(g*2,"f")}`)-1n}function a(l,d={}){let h=l;if(d.size&&(i(h,{size:d.size}),h=(0,r.trim)(h)),(0,r.trim)(h)==="0x00")return!1;if((0,r.trim)(h)==="0x01")return!0;throw new t.InvalidHexBooleanError(h)}function c(l,d={}){return Number(o(l,d))}function u(l,d={}){let h=(0,n.hexToBytes)(l);return d.size&&(i(h,{size:d.size}),h=(0,r.trim)(h,{dir:"right"})),new TextDecoder().decode(h)}return jc}var Sl={},FM;function ze(){if(FM)return Sl;FM=1,Object.defineProperty(Sl,"__esModule",{value:!0}),Sl.toHex=i,Sl.boolToHex=s,Sl.bytesToHex=o,Sl.numberToHex=a,Sl.stringToHex=u;const t=y1(),e=Zd(),r=nn(),n=Array.from({length:256},(l,d)=>d.toString(16).padStart(2,"0"));function i(l,d={}){return typeof l=="number"||typeof l=="bigint"?a(l,d):typeof l=="string"?u(l,d):typeof l=="boolean"?s(l,d):o(l,d)}function s(l,d={}){const h=`0x${Number(l)}`;return typeof d.size=="number"?((0,r.assertSize)(h,{size:d.size}),(0,e.pad)(h,{size:d.size})):h}function o(l,d={}){let h="";for(let g=0;g<l.length;g++)h+=n[l[g]];const f=`0x${h}`;return typeof d.size=="number"?((0,r.assertSize)(f,{size:d.size}),(0,e.pad)(f,{dir:"right",size:d.size})):f}function a(l,d={}){const{signed:h,size:f}=d,g=BigInt(l);let p;f?h?p=(1n<<BigInt(f)*8n-1n)-1n:p=2n**(BigInt(f)*8n)-1n:typeof l=="number"&&(p=BigInt(Number.MAX_SAFE_INTEGER));const m=typeof p=="bigint"&&h?-p-1n:0;if(p&&g>p||g<m){const v=typeof l=="bigint"?"n":"";throw new t.IntegerOutOfRangeError({max:p?`${p}${v}`:void 0,min:`${m}${v}`,signed:h,size:f,value:`${l}${v}`})}const b=`0x${(h&&g<0?(1n<<BigInt(f*8))+BigInt(g):g).toString(16)}`;return f?(0,e.pad)(b,{size:f}):b}const c=new TextEncoder;function u(l,d={}){const h=c.encode(l);return o(h,d)}return Sl}var HM;function Tr(){if(HM)return xl;HM=1,Object.defineProperty(xl,"__esModule",{value:!0}),xl.toBytes=o,xl.boolToBytes=a,xl.hexToBytes=l,xl.numberToBytes=d,xl.stringToBytes=h;const t=_t(),e=ki(),r=Zd(),n=nn(),i=ze(),s=new TextEncoder;function o(f,g={}){return typeof f=="number"||typeof f=="bigint"?d(f,g):typeof f=="boolean"?a(f,g):(0,e.isHex)(f)?l(f,g):h(f,g)}function a(f,g={}){const p=new Uint8Array(1);return p[0]=Number(f),typeof g.size=="number"?((0,n.assertSize)(p,{size:g.size}),(0,r.pad)(p,{size:g.size})):p}const c={zero:48,nine:57,A:65,F:70,a:97,f:102};function u(f){if(f>=c.zero&&f<=c.nine)return f-c.zero;if(f>=c.A&&f<=c.F)return f-(c.A-10);if(f>=c.a&&f<=c.f)return f-(c.a-10)}function l(f,g={}){let p=f;g.size&&((0,n.assertSize)(p,{size:g.size}),p=(0,r.pad)(p,{dir:"right",size:g.size}));let m=p.slice(2);m.length%2&&(m=`0${m}`);const b=m.length/2,v=new Uint8Array(b);for(let E=0,w=0;E<b;E++){const C=u(m.charCodeAt(w++)),y=u(m.charCodeAt(w++));if(C===void 0||y===void 0)throw new t.BaseError(`Invalid byte sequence ("${m[w-2]}${m[w-1]}" in "${m}").`);v[E]=C*16+y}return v}function d(f,g){const p=(0,i.numberToHex)(f,g);return l(p)}function h(f,g={}){const p=s.encode(f);return typeof g.size=="number"?((0,n.assertSize)(p,{size:g.size}),(0,r.pad)(p,{dir:"right",size:g.size})):p}return xl}var G3={},Sr={},ht={},qM;function RQ(){if(qM)return ht;qM=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.toBig=ht.shrSL=ht.shrSH=ht.rotrSL=ht.rotrSH=ht.rotrBL=ht.rotrBH=ht.rotr32L=ht.rotr32H=ht.rotlSL=ht.rotlSH=ht.rotlBL=ht.rotlBH=ht.add5L=ht.add5H=ht.add4L=ht.add4H=ht.add3L=ht.add3H=void 0,ht.add=b,ht.fromBig=r,ht.split=n;const t=BigInt(2**32-1),e=BigInt(32);function r(A,T=!1){return T?{h:Number(A&t),l:Number(A>>e&t)}:{h:Number(A>>e&t)|0,l:Number(A&t)|0}}function n(A,T=!1){const O=A.length;let k=new Uint32Array(O),j=new Uint32Array(O);for(let N=0;N<O;N++){const{h:S,l:P}=r(A[N],T);[k[N],j[N]]=[S,P]}return[k,j]}const i=(A,T)=>BigInt(A>>>0)<<e|BigInt(T>>>0);ht.toBig=i;const s=(A,T,O)=>A>>>O;ht.shrSH=s;const o=(A,T,O)=>A<<32-O|T>>>O;ht.shrSL=o;const a=(A,T,O)=>A>>>O|T<<32-O;ht.rotrSH=a;const c=(A,T,O)=>A<<32-O|T>>>O;ht.rotrSL=c;const u=(A,T,O)=>A<<64-O|T>>>O-32;ht.rotrBH=u;const l=(A,T,O)=>A>>>O-32|T<<64-O;ht.rotrBL=l;const d=(A,T)=>T;ht.rotr32H=d;const h=(A,T)=>A;ht.rotr32L=h;const f=(A,T,O)=>A<<O|T>>>32-O;ht.rotlSH=f;const g=(A,T,O)=>T<<O|A>>>32-O;ht.rotlSL=g;const p=(A,T,O)=>T<<O-32|A>>>64-O;ht.rotlBH=p;const m=(A,T,O)=>A<<O-32|T>>>64-O;ht.rotlBL=m;function b(A,T,O,k){const j=(T>>>0)+(k>>>0);return{h:A+O+(j/2**32|0)|0,l:j|0}}const v=(A,T,O)=>(A>>>0)+(T>>>0)+(O>>>0);ht.add3L=v;const E=(A,T,O,k)=>T+O+k+(A/2**32|0)|0;ht.add3H=E;const w=(A,T,O,k)=>(A>>>0)+(T>>>0)+(O>>>0)+(k>>>0);ht.add4L=w;const C=(A,T,O,k,j)=>T+O+k+j+(A/2**32|0)|0;ht.add4H=C;const y=(A,T,O,k,j)=>(A>>>0)+(T>>>0)+(O>>>0)+(k>>>0)+(j>>>0);ht.add5L=y;const _=(A,T,O,k,j,N)=>T+O+k+j+N+(A/2**32|0)|0;ht.add5H=_;const x={fromBig:r,split:n,toBig:i,shrSH:s,shrSL:o,rotrSH:a,rotrSL:c,rotrBH:u,rotrBL:l,rotr32H:d,rotr32L:h,rotlSH:f,rotlSL:g,rotlBH:p,rotlBL:m,add:b,add3L:v,add3H:E,add4L:w,add4H:C,add5H:_,add5L:y};return ht.default=x,ht}var gT={},bw={},zM;function uIe(){return zM||(zM=1,Object.defineProperty(bw,"__esModule",{value:!0}),bw.crypto=void 0,bw.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),bw}var WM;function Yd(){return WM||(WM=1,function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.Hash=t.nextTick=t.swap32IfBE=t.byteSwapIfBE=t.swap8IfBE=t.isLE=void 0,t.isBytes=r,t.anumber=n,t.abytes=i,t.ahash=s,t.aexists=o,t.aoutput=a,t.u8=c,t.u32=u,t.clean=l,t.createView=d,t.rotr=h,t.rotl=f,t.byteSwap=g,t.byteSwap32=p,t.bytesToHex=v,t.hexToBytes=C,t.asyncLoop=_,t.utf8ToBytes=x,t.bytesToUtf8=A,t.toBytes=T,t.kdfInputToBytes=O,t.concatBytes=k,t.checkOpts=j,t.createHasher=S,t.createOptHasher=P,t.createXOFer=I,t.randomBytes=B;const e=uIe();function r($){return $ instanceof Uint8Array||ArrayBuffer.isView($)&&$.constructor.name==="Uint8Array"}function n($){if(!Number.isSafeInteger($)||$<0)throw new Error("positive integer expected, got "+$)}function i($,...R){if(!r($))throw new Error("Uint8Array expected");if(R.length>0&&!R.includes($.length))throw new Error("Uint8Array expected of length "+R+", got length="+$.length)}function s($){if(typeof $!="function"||typeof $.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");n($.outputLen),n($.blockLen)}function o($,R=!0){if($.destroyed)throw new Error("Hash instance has been destroyed");if(R&&$.finished)throw new Error("Hash#digest() has already been called")}function a($,R){i($);const D=R.outputLen;if($.length<D)throw new Error("digestInto() expects output buffer of length at least "+D)}function c($){return new Uint8Array($.buffer,$.byteOffset,$.byteLength)}function u($){return new Uint32Array($.buffer,$.byteOffset,Math.floor($.byteLength/4))}function l(...$){for(let R=0;R<$.length;R++)$[R].fill(0)}function d($){return new DataView($.buffer,$.byteOffset,$.byteLength)}function h($,R){return $<<32-R|$>>>R}function f($,R){return $<<R|$>>>32-R>>>0}t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function g($){return $<<24&4278190080|$<<8&16711680|$>>>8&65280|$>>>24&255}t.swap8IfBE=t.isLE?$=>$:$=>g($),t.byteSwapIfBE=t.swap8IfBE;function p($){for(let R=0;R<$.length;R++)$[R]=g($[R]);return $}t.swap32IfBE=t.isLE?$=>$:p;const m=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",b=Array.from({length:256},($,R)=>R.toString(16).padStart(2,"0"));function v($){if(i($),m)return $.toHex();let R="";for(let D=0;D<$.length;D++)R+=b[$[D]];return R}const E={_0:48,_9:57,A:65,F:70,a:97,f:102};function w($){if($>=E._0&&$<=E._9)return $-E._0;if($>=E.A&&$<=E.F)return $-(E.A-10);if($>=E.a&&$<=E.f)return $-(E.a-10)}function C($){if(typeof $!="string")throw new Error("hex string expected, got "+typeof $);if(m)return Uint8Array.fromHex($);const R=$.length,D=R/2;if(R%2)throw new Error("hex string expected, got unpadded hex of length "+R);const L=new Uint8Array(D);for(let U=0,z=0;U<D;U++,z+=2){const W=w($.charCodeAt(z)),K=w($.charCodeAt(z+1));if(W===void 0||K===void 0){const J=$[z]+$[z+1];throw new Error('hex string expected, got non-hex character "'+J+'" at index '+z)}L[U]=W*16+K}return L}const y=async()=>{};t.nextTick=y;async function _($,R,D){let L=Date.now();for(let U=0;U<$;U++){D(U);const z=Date.now()-L;z>=0&&z<R||(await(0,t.nextTick)(),L+=z)}}function x($){if(typeof $!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode($))}function A($){return new TextDecoder().decode($)}function T($){return typeof $=="string"&&($=x($)),i($),$}function O($){return typeof $=="string"&&($=x($)),i($),$}function k(...$){let R=0;for(let L=0;L<$.length;L++){const U=$[L];i(U),R+=U.length}const D=new Uint8Array(R);for(let L=0,U=0;L<$.length;L++){const z=$[L];D.set(z,U),U+=z.length}return D}function j($,R){if(R!==void 0&&{}.toString.call(R)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign($,R)}class N{}t.Hash=N;function S($){const R=L=>$().update(T(L)).digest(),D=$();return R.outputLen=D.outputLen,R.blockLen=D.blockLen,R.create=()=>$(),R}function P($){const R=(L,U)=>$(U).update(T(L)).digest(),D=$({});return R.outputLen=D.outputLen,R.blockLen=D.blockLen,R.create=L=>$(L),R}function I($){const R=(L,U)=>$(U).update(T(L)).digest(),D=$({});return R.outputLen=D.outputLen,R.blockLen=D.blockLen,R.create=L=>$(L),R}t.wrapConstructor=S,t.wrapConstructorWithOpts=P,t.wrapXOFConstructorWithOpts=I;function B($=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array($));if(e.crypto&&typeof e.crypto.randomBytes=="function")return Uint8Array.from(e.crypto.randomBytes($));throw new Error("crypto.getRandomValues must be defined")}}(gT)),gT}var VM;function fO(){if(VM)return Sr;VM=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.shake256=Sr.shake128=Sr.keccak_512=Sr.keccak_384=Sr.keccak_256=Sr.keccak_224=Sr.sha3_512=Sr.sha3_384=Sr.sha3_256=Sr.sha3_224=Sr.Keccak=void 0,Sr.keccakP=m;const t=RQ(),e=Yd(),r=BigInt(0),n=BigInt(1),i=BigInt(2),s=BigInt(7),o=BigInt(256),a=BigInt(113),c=[],u=[],l=[];for(let w=0,C=n,y=1,_=0;w<24;w++){[y,_]=[_,(2*y+3*_)%5],c.push(2*(5*_+y)),u.push((w+1)*(w+2)/2%64);let x=r;for(let A=0;A<7;A++)C=(C<<n^(C>>s)*a)%o,C&i&&(x^=n<<(n<<BigInt(A))-n);l.push(x)}const d=(0,t.split)(l,!0),h=d[0],f=d[1],g=(w,C,y)=>y>32?(0,t.rotlBH)(w,C,y):(0,t.rotlSH)(w,C,y),p=(w,C,y)=>y>32?(0,t.rotlBL)(w,C,y):(0,t.rotlSL)(w,C,y);function m(w,C=24){const y=new Uint32Array(10);for(let _=24-C;_<24;_++){for(let T=0;T<10;T++)y[T]=w[T]^w[T+10]^w[T+20]^w[T+30]^w[T+40];for(let T=0;T<10;T+=2){const O=(T+8)%10,k=(T+2)%10,j=y[k],N=y[k+1],S=g(j,N,1)^y[O],P=p(j,N,1)^y[O+1];for(let I=0;I<50;I+=10)w[T+I]^=S,w[T+I+1]^=P}let x=w[2],A=w[3];for(let T=0;T<24;T++){const O=u[T],k=g(x,A,O),j=p(x,A,O),N=c[T];x=w[N],A=w[N+1],w[N]=k,w[N+1]=j}for(let T=0;T<50;T+=10){for(let O=0;O<10;O++)y[O]=w[T+O];for(let O=0;O<10;O++)w[T+O]^=~y[(O+2)%10]&y[(O+4)%10]}w[0]^=h[_],w[1]^=f[_]}(0,e.clean)(y)}class b extends e.Hash{constructor(C,y,_,x=!1,A=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=C,this.suffix=y,this.outputLen=_,this.enableXOF=x,this.rounds=A,(0,e.anumber)(_),!(0<C&&C<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,e.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,e.swap32IfBE)(this.state32),m(this.state32,this.rounds),(0,e.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(C){(0,e.aexists)(this),C=(0,e.toBytes)(C),(0,e.abytes)(C);const{blockLen:y,state:_}=this,x=C.length;for(let A=0;A<x;){const T=Math.min(y-this.pos,x-A);for(let O=0;O<T;O++)_[this.pos++]^=C[A++];this.pos===y&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:C,suffix:y,pos:_,blockLen:x}=this;C[_]^=y,(y&128)!==0&&_===x-1&&this.keccak(),C[x-1]^=128,this.keccak()}writeInto(C){(0,e.aexists)(this,!1),(0,e.abytes)(C),this.finish();const y=this.state,{blockLen:_}=this;for(let x=0,A=C.length;x<A;){this.posOut>=_&&this.keccak();const T=Math.min(_-this.posOut,A-x);C.set(y.subarray(this.posOut,this.posOut+T),x),this.posOut+=T,x+=T}return C}xofInto(C){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(C)}xof(C){return(0,e.anumber)(C),this.xofInto(new Uint8Array(C))}digestInto(C){if((0,e.aoutput)(C,this),this.finished)throw new Error("digest() was already called");return this.writeInto(C),this.destroy(),C}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,e.clean)(this.state)}_cloneInto(C){const{blockLen:y,suffix:_,outputLen:x,rounds:A,enableXOF:T}=this;return C||(C=new b(y,_,x,T,A)),C.state32.set(this.state32),C.pos=this.pos,C.posOut=this.posOut,C.finished=this.finished,C.rounds=A,C.suffix=_,C.outputLen=x,C.enableXOF=T,C.destroyed=this.destroyed,C}}Sr.Keccak=b;const v=(w,C,y)=>(0,e.createHasher)(()=>new b(C,w,y));Sr.sha3_224=v(6,144,224/8),Sr.sha3_256=v(6,136,256/8),Sr.sha3_384=v(6,104,384/8),Sr.sha3_512=v(6,72,512/8),Sr.keccak_224=v(1,144,224/8),Sr.keccak_256=v(1,136,256/8),Sr.keccak_384=v(1,104,384/8),Sr.keccak_512=v(1,72,512/8);const E=(w,C,y)=>(0,e.createXOFer)((_={})=>new b(C,w,_.dkLen===void 0?y:_.dkLen,!0));return Sr.shake128=E(31,168,128/8),Sr.shake256=E(31,136,256/8),Sr}var GM;function ns(){if(GM)return G3;GM=1,Object.defineProperty(G3,"__esModule",{value:!0}),G3.keccak256=i;const t=fO(),e=ki(),r=Tr(),n=ze();function i(s,o){const a=o||"hex",c=(0,t.keccak_256)((0,e.isHex)(s,{strict:!1})?(0,r.toBytes)(s):s);return a==="bytes"?c:(0,n.toHex)(c)}return G3}var yw={},K3={},Z3={},KM;function lIe(){if(KM)return Z3;KM=1,Object.defineProperty(Z3,"__esModule",{value:!0}),Z3.hashSignature=n;const t=Tr(),e=ns(),r=i=>(0,e.keccak256)((0,t.toBytes)(i));function n(i){return r(i)}return Z3}var vw={},Y3={},ZM;function dIe(){if(ZM)return Y3;ZM=1,Object.defineProperty(Y3,"__esModule",{value:!0}),Y3.normalizeSignature=e;const t=_t();function e(r){let n=!0,i="",s=0,o="",a=!1;for(let c=0;c<r.length;c++){const u=r[c];if(["(",")",","].includes(u)&&(n=!0),u==="("&&s++,u===")"&&s--,!!n){if(s===0){if(u===" "&&["event","function",""].includes(o))o="";else if(o+=u,u===")"){a=!0;break}continue}if(u===" "){r[c-1]!==","&&i!==","&&i!==",("&&(i="",n=!1);continue}o+=u,i+=u}}if(!a)throw new t.BaseError("Unable to normalize signature.");return o}return Y3}var YM;function pO(){if(YM)return vw;YM=1,Object.defineProperty(vw,"__esModule",{value:!0}),vw.toSignature=void 0;const t=Kd(),e=dIe(),r=n=>{const i=typeof n=="string"?n:(0,t.formatAbiItem)(n);return(0,e.normalizeSignature)(i)};return vw.toSignature=r,vw}var JM;function YA(){if(JM)return K3;JM=1,Object.defineProperty(K3,"__esModule",{value:!0}),K3.toSignatureHash=r;const t=lIe(),e=pO();function r(n){return(0,t.hashSignature)((0,e.toSignature)(n))}return K3}var QM;function v1(){if(QM)return yw;QM=1,Object.defineProperty(yw,"__esModule",{value:!0}),yw.toEventSelector=void 0;const t=YA();return yw.toEventSelector=t.toSignatureHash,yw}var _w={},Ew={},XM;function la(){if(XM)return Ew;XM=1,Object.defineProperty(Ew,"__esModule",{value:!0}),Ew.InvalidAddressError=void 0;const t=_t();class e extends t.BaseError{constructor({address:n}){super(`Address "${n}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}return Ew.InvalidAddressError=e,Ew}var mT={},Cw={},eL;function y2(){if(eL)return Cw;eL=1,Object.defineProperty(Cw,"__esModule",{value:!0}),Cw.LruMap=void 0;class t extends Map{constructor(r){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=r}get(r){const n=super.get(r);return super.has(r)&&n!==void 0&&(this.delete(r),super.set(r,n)),n}set(r,n){if(super.set(r,n),this.maxSize&&this.size>this.maxSize){const i=this.keys().next().value;i&&this.delete(i)}return this}}return Cw.LruMap=t,Cw}var Aw={},tL;function js(){if(tL)return Aw;tL=1,Object.defineProperty(Aw,"__esModule",{value:!0}),Aw.checksumAddress=o,Aw.getAddress=a;const t=la(),e=Tr(),r=ns(),n=y2(),i=is(),s=new n.LruMap(8192);function o(c,u){if(s.has(`${c}.${u}`))return s.get(`${c}.${u}`);const l=u?`${u}${c.toLowerCase()}`:c.substring(2).toLowerCase(),d=(0,r.keccak256)((0,e.stringToBytes)(l),"bytes"),h=(u?l.substring(`${u}0x`.length):l).split("");for(let g=0;g<40;g+=2)d[g>>1]>>4>=8&&h[g]&&(h[g]=h[g].toUpperCase()),(d[g>>1]&15)>=8&&h[g+1]&&(h[g+1]=h[g+1].toUpperCase());const f=`0x${h.join("")}`;return s.set(`${c}.${u}`,f),f}function a(c,u){if(!(0,i.isAddress)(c,{strict:!1}))throw new t.InvalidAddressError({address:c});return o(c,u)}return Aw}var rL;function is(){return rL||(rL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isAddressCache=void 0,t.isAddress=i;const e=y2(),r=js(),n=/^0x[a-fA-F0-9]{40}$/;t.isAddressCache=new e.LruMap(8192);function i(s,o){const{strict:a=!0}=o??{},c=`${s}.${a}`;if(t.isAddressCache.has(c))return t.isAddressCache.get(c);const u=n.test(s)?s.toLowerCase()===s?!0:a?(0,r.checksumAddress)(s)===s:!0:!1;return t.isAddressCache.set(c,u),u}}(mT)),mT}var v0={},nL;function oi(){if(nL)return v0;nL=1,Object.defineProperty(v0,"__esModule",{value:!0}),v0.concat=t,v0.concatBytes=e,v0.concatHex=r;function t(n){return typeof n[0]=="string"?r(n):e(n)}function e(n){let i=0;for(const a of n)i+=a.length;const s=new Uint8Array(i);let o=0;for(const a of n)s.set(a,o),o+=a.length;return s}function r(n){return`0x${n.reduce((i,s)=>i+s.replace("0x",""),"")}`}return v0}var _0={},iL;function go(){if(iL)return _0;iL=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.slice=n,_0.sliceBytes=o,_0.sliceHex=a;const t=ZA(),e=ki(),r=rs();function n(c,u,l,{strict:d}={}){return(0,e.isHex)(c,{strict:!1})?a(c,u,l,{strict:d}):o(c,u,l,{strict:d})}function i(c,u){if(typeof u=="number"&&u>0&&u>(0,r.size)(c)-1)throw new t.SliceOffsetOutOfBoundsError({offset:u,position:"start",size:(0,r.size)(c)})}function s(c,u,l){if(typeof u=="number"&&typeof l=="number"&&(0,r.size)(c)!==l-u)throw new t.SliceOffsetOutOfBoundsError({offset:l,position:"end",size:(0,r.size)(c)})}function o(c,u,l,{strict:d}={}){i(c,u);const h=c.slice(u,l);return d&&s(h,u,l),h}function a(c,u,l,{strict:d}={}){i(c,u);const h=`0x${c.replace("0x","").slice((u??0)*2,(l??c.length)*2)}`;return d&&s(h,u,l),h}return _0}var Bc={},sL;function JA(){return sL||(sL=1,Object.defineProperty(Bc,"__esModule",{value:!0}),Bc.integerRegex=Bc.bytesRegex=Bc.arrayRegex=void 0,Bc.arrayRegex=/^(.*)\[([0-9]*)\]$/,Bc.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Bc.integerRegex=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/),Bc}var oL;function da(){if(oL)return _w;oL=1,Object.defineProperty(_w,"__esModule",{value:!0}),_w.encodeAbiParameters=d,_w.getArrayComponents=y;const t=$r(),e=la(),r=_t(),n=y1(),i=is(),s=oi(),o=Zd(),a=rs(),c=go(),u=ze(),l=JA();function d(_,x){if(_.length!==x.length)throw new t.AbiEncodingLengthMismatchError({expectedLength:_.length,givenLength:x.length});const A=h({params:_,values:x}),T=g(A);return T.length===0?"0x":T}function h({params:_,values:x}){const A=[];for(let T=0;T<_.length;T++)A.push(f({param:_[T],value:x[T]}));return A}function f({param:_,value:x}){const A=y(_.type);if(A){const[T,O]=A;return m(x,{length:T,param:{..._,type:O}})}if(_.type==="tuple")return C(x,{param:_});if(_.type==="address")return p(x);if(_.type==="bool")return v(x);if(_.type.startsWith("uint")||_.type.startsWith("int")){const T=_.type.startsWith("int"),[,,O="256"]=l.integerRegex.exec(_.type)??[];return E(x,{signed:T,size:Number(O)})}if(_.type.startsWith("bytes"))return b(x,{param:_});if(_.type==="string")return w(x);throw new t.InvalidAbiEncodingTypeError(_.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function g(_){let x=0;for(let k=0;k<_.length;k++){const{dynamic:j,encoded:N}=_[k];j?x+=32:x+=(0,a.size)(N)}const A=[],T=[];let O=0;for(let k=0;k<_.length;k++){const{dynamic:j,encoded:N}=_[k];j?(A.push((0,u.numberToHex)(x+O,{size:32})),T.push(N),O+=(0,a.size)(N)):A.push(N)}return(0,s.concat)([...A,...T])}function p(_){if(!(0,i.isAddress)(_))throw new e.InvalidAddressError({address:_});return{dynamic:!1,encoded:(0,o.padHex)(_.toLowerCase())}}function m(_,{length:x,param:A}){const T=x===null;if(!Array.isArray(_))throw new t.InvalidArrayError(_);if(!T&&_.length!==x)throw new t.AbiEncodingArrayLengthMismatchError({expectedLength:x,givenLength:_.length,type:`${A.type}[${x}]`});let O=!1;const k=[];for(let j=0;j<_.length;j++){const N=f({param:A,value:_[j]});N.dynamic&&(O=!0),k.push(N)}if(T||O){const j=g(k);if(T){const N=(0,u.numberToHex)(k.length,{size:32});return{dynamic:!0,encoded:k.length>0?(0,s.concat)([N,j]):N}}if(O)return{dynamic:!0,encoded:j}}return{dynamic:!1,encoded:(0,s.concat)(k.map(({encoded:j})=>j))}}function b(_,{param:x}){const[,A]=x.type.split("bytes"),T=(0,a.size)(_);if(!A){let O=_;return T%32!==0&&(O=(0,o.padHex)(O,{dir:"right",size:Math.ceil((_.length-2)/2/32)*32})),{dynamic:!0,encoded:(0,s.concat)([(0,o.padHex)((0,u.numberToHex)(T,{size:32})),O])}}if(T!==Number.parseInt(A))throw new t.AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(A),value:_});return{dynamic:!1,encoded:(0,o.padHex)(_,{dir:"right"})}}function v(_){if(typeof _!="boolean")throw new r.BaseError(`Invalid boolean value: "${_}" (type: ${typeof _}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,o.padHex)((0,u.boolToHex)(_))}}function E(_,{signed:x,size:A=256}){if(typeof A=="number"){const T=2n**(BigInt(A)-(x?1n:0n))-1n,O=x?-T-1n:0n;if(_>T||_<O)throw new n.IntegerOutOfRangeError({max:T.toString(),min:O.toString(),signed:x,size:A/8,value:_.toString()})}return{dynamic:!1,encoded:(0,u.numberToHex)(_,{size:32,signed:x})}}function w(_){const x=(0,u.stringToHex)(_),A=Math.ceil((0,a.size)(x)/32),T=[];for(let O=0;O<A;O++)T.push((0,o.padHex)((0,c.slice)(x,O*32,(O+1)*32),{dir:"right"}));return{dynamic:!0,encoded:(0,s.concat)([(0,o.padHex)((0,u.numberToHex)((0,a.size)(x),{size:32})),...T])}}function C(_,{param:x}){let A=!1;const T=[];for(let O=0;O<x.components.length;O++){const k=x.components[O],j=Array.isArray(_)?O:k.name,N=f({param:k,value:_[j]});T.push(N),N.dynamic&&(A=!0)}return{dynamic:A,encoded:A?g(T):(0,s.concat)(T.map(({encoded:O})=>O))}}function y(_){const x=_.match(/^(.*)\[(\d+)?\]$/);return x?[x[2]?Number(x[2]):null,x[1]]:void 0}return _w}var E0={},xw={},aL;function Lp(){if(aL)return xw;aL=1,Object.defineProperty(xw,"__esModule",{value:!0}),xw.toFunctionSelector=void 0;const t=go(),e=YA(),r=n=>(0,t.slice)((0,e.toSignatureHash)(n),0,4);return xw.toFunctionSelector=r,xw}var cL;function rl(){if(cL)return E0;cL=1,Object.defineProperty(E0,"__esModule",{value:!0}),E0.getAbiItem=s,E0.isArgOfType=o,E0.getAmbiguousTypes=a;const t=$r(),e=ki(),r=is(),n=v1(),i=Lp();function s(c){const{abi:u,args:l=[],name:d}=c,h=(0,e.isHex)(d,{strict:!1}),f=u.filter(p=>h?p.type==="function"?(0,i.toFunctionSelector)(p)===d:p.type==="event"?(0,n.toEventSelector)(p)===d:!1:"name"in p&&p.name===d);if(f.length===0)return;if(f.length===1)return f[0];let g;for(const p of f){if(!("inputs"in p))continue;if(!l||l.length===0){if(!p.inputs||p.inputs.length===0)return p;continue}if(!p.inputs||p.inputs.length===0||p.inputs.length!==l.length)continue;if(l.every((b,v)=>{const E="inputs"in p&&p.inputs[v];return E?o(b,E):!1})){if(g&&"inputs"in g&&g.inputs){const b=a(p.inputs,g.inputs,l);if(b)throw new t.AbiItemAmbiguityError({abiItem:p,type:b[0]},{abiItem:g,type:b[1]})}g=p}}return g||f[0]}function o(c,u){const l=typeof c,d=u.type;switch(d){case"address":return(0,r.isAddress)(c,{strict:!1});case"bool":return l==="boolean";case"function":return l==="string";case"string":return l==="string";default:return d==="tuple"&&"components"in u?Object.values(u.components).every((h,f)=>o(Object.values(c)[f],h)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(d)?l==="number"||l==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(d)?l==="string"||c instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(d)?Array.isArray(c)&&c.every(h=>o(h,{...u,type:d.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function a(c,u,l){for(const d in c){const h=c[d],f=u[d];if(h.type==="tuple"&&f.type==="tuple"&&"components"in h&&"components"in f)return a(h.components,f.components,l[d]);const g=[h.type,f.type];if(g.includes("address")&&g.includes("bytes20")?!0:g.includes("address")&&g.includes("string")?(0,r.isAddress)(l[d],{strict:!1}):g.includes("address")&&g.includes("bytes")?(0,r.isAddress)(l[d],{strict:!1}):!1)return g}}return E0}var uL;function Up(){if(uL)return q3;uL=1,Object.defineProperty(q3,"__esModule",{value:!0}),q3.encodeEventTopics=u;const t=$r(),e=OQ(),r=Tr(),n=ns(),i=v1(),s=da(),o=el(),a=rl(),c="/docs/contract/encodeEventTopics";function u(d){var E;const{abi:h,eventName:f,args:g}=d;let p=h[0];if(f){const w=(0,a.getAbiItem)({abi:h,name:f});if(!w)throw new t.AbiEventNotFoundError(f,{docsPath:c});p=w}if(p.type!=="event")throw new t.AbiEventNotFoundError(void 0,{docsPath:c});const m=(0,o.formatAbiItem)(p),b=(0,i.toEventSelector)(m);let v=[];if(g&&"inputs"in p){const w=(E=p.inputs)==null?void 0:E.filter(y=>"indexed"in y&&y.indexed),C=Array.isArray(g)?g:Object.values(g).length>0?(w==null?void 0:w.map(y=>g[y.name]))??[]:[];C.length>0&&(v=(w==null?void 0:w.map((y,_)=>Array.isArray(C[_])?C[_].map((x,A)=>l({param:y,value:C[_][A]})):typeof C[_]<"u"&&C[_]!==null?l({param:y,value:C[_]}):null))??[])}return[b,...v]}function l({param:d,value:h}){if(d.type==="string"||d.type==="bytes")return(0,n.keccak256)((0,r.toBytes)(h));if(d.type==="tuple"||d.type.match(/^(.*)\[(\d+)?\]$/))throw new e.FilterTypeNotSupportedError(d.type);return(0,s.encodeAbiParameters)([d],[h])}return q3}var J3={},lL;function QA(){if(lL)return J3;lL=1,Object.defineProperty(J3,"__esModule",{value:!0}),J3.createFilterRequestScope=t;function t(e,{method:r}){var i,s;const n={};return e.transport.type==="fallback"&&((s=(i=e.transport).onResponse)==null||s.call(i,({method:o,response:a,status:c,transport:u})=>{c==="success"&&r===o&&(n[a]=u.request)})),o=>n[o]||e.request}return J3}var dL;function gO(){if(dL)return H3;dL=1,Object.defineProperty(H3,"__esModule",{value:!0}),H3.createContractEventFilter=n;const t=Up(),e=ze(),r=QA();async function n(i,s){const{address:o,abi:a,args:c,eventName:u,fromBlock:l,strict:d,toBlock:h}=s,f=(0,r.createFilterRequestScope)(i,{method:"eth_newFilter"}),g=u?(0,t.encodeEventTopics)({abi:a,args:c,eventName:u}):void 0,p=await i.request({method:"eth_newFilter",params:[{address:o,fromBlock:typeof l=="bigint"?(0,e.numberToHex)(l):l,toBlock:typeof h=="bigint"?(0,e.numberToHex)(h):h,topics:g}]});return{abi:a,args:c,eventName:u,id:p,request:f(p),strict:!!d,type:"event"}}return H3}var Q3={},X3={},hL;function sn(){if(hL)return X3;hL=1,Object.defineProperty(X3,"__esModule",{value:!0}),X3.parseAccount=t;function t(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}return X3}var e_={},t_={},fL;function kQ(){if(fL)return t_;fL=1,Object.defineProperty(t_,"__esModule",{value:!0}),t_.prepareEncodeFunctionData=s;const t=$r(),e=Lp(),r=el(),n=rl(),i="/docs/contract/encodeFunctionData";function s(o){const{abi:a,args:c,functionName:u}=o;let l=a[0];if(u){const d=(0,n.getAbiItem)({abi:a,args:c,name:u});if(!d)throw new t.AbiFunctionNotFoundError(u,{docsPath:i});l=d}if(l.type!=="function")throw new t.AbiFunctionNotFoundError(void 0,{docsPath:i});return{abi:[l],functionName:(0,e.toFunctionSelector)((0,r.formatAbiItem)(l))}}return t_}var pL;function Bs(){if(pL)return e_;pL=1,Object.defineProperty(e_,"__esModule",{value:!0}),e_.encodeFunctionData=n;const t=oi(),e=da(),r=kQ();function n(i){const{args:s}=i,{abi:o,functionName:a}=(()=>{var d;return i.abi.length===1&&((d=i.functionName)!=null&&d.startsWith("0x"))?i:(0,r.prepareEncodeFunctionData)(i)})(),c=o[0],u=a,l="inputs"in c&&c.inputs?(0,e.encodeAbiParameters)(c.inputs,s??[]):void 0;return(0,t.concatHex)([u,l??"0x"])}return e_}var r_={},ui={},Dc={},gL;function XA(){return gL||(gL=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.solidityPanic=Dc.solidityError=Dc.panicReasons=void 0,Dc.panicReasons={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Dc.solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Dc.solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}),Dc}var n_={},i_={},s_={},Mc={},mL;function NQ(){if(mL)return Mc;mL=1,Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.RecursiveReadLimitExceededError=Mc.PositionOutOfBoundsError=Mc.NegativeOffsetError=void 0;const t=_t();class e extends t.BaseError{constructor({offset:s}){super(`Offset \`${s}\` cannot be negative.`,{name:"NegativeOffsetError"})}}Mc.NegativeOffsetError=e;class r extends t.BaseError{constructor({length:s,position:o}){super(`Position \`${o}\` is out of bounds (\`0 < position < ${s}\`).`,{name:"PositionOutOfBoundsError"})}}Mc.PositionOutOfBoundsError=r;class n extends t.BaseError{constructor({count:s,limit:o}){super(`Recursive read limit of \`${o}\` exceeded (recursive read count: \`${s}\`).`,{name:"RecursiveReadLimitExceededError"})}}return Mc.RecursiveReadLimitExceededError=n,Mc}var wL;function v2(){if(wL)return s_;wL=1,Object.defineProperty(s_,"__esModule",{value:!0}),s_.createCursor=r;const t=NQ(),e={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new t.RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(n){if(n<0||n>this.bytes.length-1)throw new t.PositionOutOfBoundsError({length:this.bytes.length,position:n})},decrementPosition(n){if(n<0)throw new t.NegativeOffsetError({offset:n});const i=this.position-n;this.assertPosition(i),this.position=i},getReadCount(n){return this.positionReadCount.get(n||this.position)||0},incrementPosition(n){if(n<0)throw new t.NegativeOffsetError({offset:n});const i=this.position+n;this.assertPosition(i),this.position=i},inspectByte(n){const i=n??this.position;return this.assertPosition(i),this.bytes[i]},inspectBytes(n,i){const s=i??this.position;return this.assertPosition(s+n-1),this.bytes.subarray(s,s+n)},inspectUint8(n){const i=n??this.position;return this.assertPosition(i),this.bytes[i]},inspectUint16(n){const i=n??this.position;return this.assertPosition(i+1),this.dataView.getUint16(i)},inspectUint24(n){const i=n??this.position;return this.assertPosition(i+2),(this.dataView.getUint16(i)<<8)+this.dataView.getUint8(i+2)},inspectUint32(n){const i=n??this.position;return this.assertPosition(i+3),this.dataView.getUint32(i)},pushByte(n){this.assertPosition(this.position),this.bytes[this.position]=n,this.position++},pushBytes(n){this.assertPosition(this.position+n.length-1),this.bytes.set(n,this.position),this.position+=n.length},pushUint8(n){this.assertPosition(this.position),this.bytes[this.position]=n,this.position++},pushUint16(n){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,n),this.position+=2},pushUint24(n){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,n>>8),this.dataView.setUint8(this.position+2,n&255),this.position+=3},pushUint32(n){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,n),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const n=this.inspectByte();return this.position++,n},readBytes(n,i){this.assertReadLimit(),this._touch();const s=this.inspectBytes(n);return this.position+=i??n,s},readUint8(){this.assertReadLimit(),this._touch();const n=this.inspectUint8();return this.position+=1,n},readUint16(){this.assertReadLimit(),this._touch();const n=this.inspectUint16();return this.position+=2,n},readUint24(){this.assertReadLimit(),this._touch();const n=this.inspectUint24();return this.position+=3,n},readUint32(){this.assertReadLimit(),this._touch();const n=this.inspectUint32();return this.position+=4,n},get remaining(){return this.bytes.length-this.position},setPosition(n){const i=this.position;return this.assertPosition(n),this.position=n,()=>this.position=i},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const n=this.getReadCount();this.positionReadCount.set(this.position,n+1),n>0&&this.recursiveReadCount++}};function r(n,{recursiveReadLimit:i=8192}={}){const s=Object.create(e);return s.bytes=n,s.dataView=new DataView(n.buffer,n.byteOffset,n.byteLength),s.positionReadCount=new Map,s.recursiveReadLimit=i,s}return s_}var Tl={},bL;function mO(){if(bL)return Tl;bL=1,Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.fromBytes=i,Tl.bytesToBigInt=s,Tl.bytesToBool=o,Tl.bytesToNumber=a,Tl.bytesToString=c;const t=y1(),e=tl(),r=nn(),n=ze();function i(u,l){const d=typeof l=="string"?{to:l}:l,h=d.to;return h==="number"?a(u,d):h==="bigint"?s(u,d):h==="boolean"?o(u,d):h==="string"?c(u,d):(0,n.bytesToHex)(u,d)}function s(u,l={}){typeof l.size<"u"&&(0,r.assertSize)(u,{size:l.size});const d=(0,n.bytesToHex)(u,l);return(0,r.hexToBigInt)(d,l)}function o(u,l={}){let d=u;if(typeof l.size<"u"&&((0,r.assertSize)(d,{size:l.size}),d=(0,e.trim)(d)),d.length>1||d[0]>1)throw new t.InvalidBytesBooleanError(d);return!!d[0]}function a(u,l={}){typeof l.size<"u"&&(0,r.assertSize)(u,{size:l.size});const d=(0,n.bytesToHex)(u,l);return(0,r.hexToNumber)(d,l)}function c(u,l={}){let d=u;return typeof l.size<"u"&&((0,r.assertSize)(d,{size:l.size}),d=(0,e.trim)(d,{dir:"right"})),new TextDecoder().decode(d)}return Tl}var yL;function Jd(){if(yL)return i_;yL=1,Object.defineProperty(i_,"__esModule",{value:!0}),i_.decodeAbiParameters=l;const t=$r(),e=js(),r=v2(),n=rs(),i=go(),s=tl(),o=mO(),a=Tr(),c=ze(),u=da();function l(y,_){const x=typeof _=="string"?(0,a.hexToBytes)(_):_,A=(0,r.createCursor)(x);if((0,n.size)(x)===0&&y.length>0)throw new t.AbiDecodingZeroDataError;if((0,n.size)(_)&&(0,n.size)(_)<32)throw new t.AbiDecodingDataSizeTooSmallError({data:typeof _=="string"?_:(0,c.bytesToHex)(_),params:y,size:(0,n.size)(_)});let T=0;const O=[];for(let k=0;k<y.length;++k){const j=y[k];A.setPosition(T);const[N,S]=d(A,j,{staticPosition:0});T+=S,O.push(N)}return O}function d(y,_,{staticPosition:x}){const A=(0,u.getArrayComponents)(_.type);if(A){const[T,O]=A;return p(y,{..._,type:O},{length:T,staticPosition:x})}if(_.type==="tuple")return E(y,_,{staticPosition:x});if(_.type==="address")return g(y);if(_.type==="bool")return m(y);if(_.type.startsWith("bytes"))return b(y,_,{staticPosition:x});if(_.type.startsWith("uint")||_.type.startsWith("int"))return v(y,_);if(_.type==="string")return w(y,{staticPosition:x});throw new t.InvalidAbiDecodingTypeError(_.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const h=32,f=32;function g(y){const _=y.readBytes(32);return[(0,e.checksumAddress)((0,c.bytesToHex)((0,i.sliceBytes)(_,-20))),32]}function p(y,_,{length:x,staticPosition:A}){if(!x){const k=(0,o.bytesToNumber)(y.readBytes(f)),j=A+k,N=j+h;y.setPosition(j);const S=(0,o.bytesToNumber)(y.readBytes(h)),P=C(_);let I=0;const B=[];for(let $=0;$<S;++$){y.setPosition(N+(P?$*32:I));const[R,D]=d(y,_,{staticPosition:N});I+=D,B.push(R)}return y.setPosition(A+32),[B,32]}if(C(_)){const k=(0,o.bytesToNumber)(y.readBytes(f)),j=A+k,N=[];for(let S=0;S<x;++S){y.setPosition(j+S*32);const[P]=d(y,_,{staticPosition:j});N.push(P)}return y.setPosition(A+32),[N,32]}let T=0;const O=[];for(let k=0;k<x;++k){const[j,N]=d(y,_,{staticPosition:A+T});T+=N,O.push(j)}return[O,T]}function m(y){return[(0,o.bytesToBool)(y.readBytes(32),{size:32}),32]}function b(y,_,{staticPosition:x}){const[A,T]=_.type.split("bytes");if(!T){const k=(0,o.bytesToNumber)(y.readBytes(32));y.setPosition(x+k);const j=(0,o.bytesToNumber)(y.readBytes(32));if(j===0)return y.setPosition(x+32),["0x",32];const N=y.readBytes(j);return y.setPosition(x+32),[(0,c.bytesToHex)(N),32]}return[(0,c.bytesToHex)(y.readBytes(Number.parseInt(T),32)),32]}function v(y,_){const x=_.type.startsWith("int"),A=Number.parseInt(_.type.split("int")[1]||"256"),T=y.readBytes(32);return[A>48?(0,o.bytesToBigInt)(T,{signed:x}):(0,o.bytesToNumber)(T,{signed:x}),32]}function E(y,_,{staticPosition:x}){const A=_.components.length===0||_.components.some(({name:k})=>!k),T=A?[]:{};let O=0;if(C(_)){const k=(0,o.bytesToNumber)(y.readBytes(f)),j=x+k;for(let N=0;N<_.components.length;++N){const S=_.components[N];y.setPosition(j+O);const[P,I]=d(y,S,{staticPosition:j});O+=I,T[A?N:S==null?void 0:S.name]=P}return y.setPosition(x+32),[T,32]}for(let k=0;k<_.components.length;++k){const j=_.components[k],[N,S]=d(y,j,{staticPosition:x});T[A?k:j==null?void 0:j.name]=N,O+=S}return[T,O]}function w(y,{staticPosition:_}){const x=(0,o.bytesToNumber)(y.readBytes(32)),A=_+x;y.setPosition(A);const T=(0,o.bytesToNumber)(y.readBytes(32));if(T===0)return y.setPosition(_+32),["",32];const O=y.readBytes(T,32),k=(0,o.bytesToString)((0,s.trim)(O));return y.setPosition(_+32),[k,32]}function C(y){var A;const{type:_}=y;if(_==="string"||_==="bytes"||_.endsWith("[]"))return!0;if(_==="tuple")return(A=y.components)==null?void 0:A.some(C);const x=(0,u.getArrayComponents)(y.type);return!!(x&&C({...y,type:x[1]}))}return i_}var vL;function ex(){if(vL)return n_;vL=1,Object.defineProperty(n_,"__esModule",{value:!0}),n_.decodeErrorResult=o;const t=XA(),e=$r(),r=go(),n=Lp(),i=Jd(),s=el();function o(a){const{abi:c,data:u}=a,l=(0,r.slice)(u,0,4);if(l==="0x")throw new e.AbiDecodingZeroDataError;const h=[...c||[],t.solidityError,t.solidityPanic].find(f=>f.type==="error"&&l===(0,n.toFunctionSelector)((0,s.formatAbiItem)(f)));if(!h)throw new e.AbiErrorSignatureNotFoundError(l,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:h,args:"inputs"in h&&h.inputs&&h.inputs.length>0?(0,i.decodeAbiParameters)(h.inputs,(0,r.slice)(u,4)):void 0,errorName:h.name}}return n_}var o_={},Sw={},_L;function Gn(){if(_L)return Sw;_L=1,Object.defineProperty(Sw,"__esModule",{value:!0}),Sw.stringify=void 0;const t=(e,r,n)=>JSON.stringify(e,(i,s)=>{const o=typeof s=="bigint"?s.toString():s;return typeof r=="function"?r(i,o):o},n);return Sw.stringify=t,Sw}var EL;function $Q(){if(EL)return o_;EL=1,Object.defineProperty(o_,"__esModule",{value:!0}),o_.formatAbiItemWithArgs=e;const t=Gn();function e({abiItem:r,args:n,includeFunctionName:i=!0,includeName:s=!1}){if("name"in r&&"inputs"in r&&r.inputs)return`${i?r.name:""}(${r.inputs.map((o,a)=>`${s&&o.name?`${o.name}: `:""}${typeof n[a]=="object"?(0,t.stringify)(n[a]):n[a]}`).join(", ")})`}return o_}var a_={},Lc={},CL;function _2(){return CL||(CL=1,Object.defineProperty(Lc,"__esModule",{value:!0}),Lc.weiUnits=Lc.gweiUnits=Lc.etherUnits=void 0,Lc.etherUnits={gwei:9,wei:18},Lc.gweiUnits={ether:-9,wei:9},Lc.weiUnits={ether:-18,gwei:-9}),Lc}var c_={},AL;function tx(){if(AL)return c_;AL=1,Object.defineProperty(c_,"__esModule",{value:!0}),c_.formatUnits=t;function t(e,r){let n=e.toString();const i=n.startsWith("-");i&&(n=n.slice(1)),n=n.padStart(r,"0");let[s,o]=[n.slice(0,n.length-r),n.slice(n.length-r)];return o=o.replace(/(0+)$/,""),`${i?"-":""}${s||"0"}${o?`.${o}`:""}`}return c_}var xL;function E2(){if(xL)return a_;xL=1,Object.defineProperty(a_,"__esModule",{value:!0}),a_.formatEther=r;const t=_2(),e=tx();function r(n,i="wei"){return(0,e.formatUnits)(n,t.etherUnits[i])}return a_}var u_={},SL;function Fp(){if(SL)return u_;SL=1,Object.defineProperty(u_,"__esModule",{value:!0}),u_.formatGwei=r;const t=_2(),e=tx();function r(n,i="wei"){return(0,e.formatUnits)(n,t.gweiUnits[i])}return u_}var Uc={},TL;function wO(){if(TL)return Uc;TL=1,Object.defineProperty(Uc,"__esModule",{value:!0}),Uc.StateAssignmentConflictError=Uc.AccountStateConflictError=void 0,Uc.prettyStateMapping=n,Uc.prettyStateOverride=i;const t=_t();class e extends t.BaseError{constructor({address:o}){super(`State for account "${o}" is set multiple times.`,{name:"AccountStateConflictError"})}}Uc.AccountStateConflictError=e;class r extends t.BaseError{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}Uc.StateAssignmentConflictError=r;function n(s){return s.reduce((o,{slot:a,value:c})=>`${o} ${a}: ${c}
- `,"")}function i(s){return s.reduce((o,{address:a,...c})=>{let u=`${o} ${a}:
- `;return c.nonce&&(u+=` nonce: ${c.nonce}
- `),c.balance&&(u+=` balance: ${c.balance}
- `),c.code&&(u+=` code: ${c.code}
- `),c.state&&(u+=` state:
- `,u+=n(c.state)),c.stateDiff&&(u+=` stateDiff:
- `,u+=n(c.stateDiff)),u},` State Override:
- `).slice(0,-1)}return Uc}var Nr={},IL;function Ds(){if(IL)return Nr;IL=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.WaitForTransactionReceiptTimeoutError=Nr.TransactionReceiptNotFoundError=Nr.TransactionNotFoundError=Nr.TransactionExecutionError=Nr.InvalidStorageKeySizeError=Nr.InvalidSerializedTransactionError=Nr.InvalidSerializedTransactionTypeError=Nr.InvalidSerializableTransactionError=Nr.InvalidLegacyVError=Nr.FeeConflictError=void 0,Nr.prettyPrint=n;const t=E2(),e=Fp(),r=_t();function n(g){const p=Object.entries(g).map(([b,v])=>v===void 0||v===!1?null:[b,v]).filter(Boolean),m=p.reduce((b,[v])=>Math.max(b,v.length),0);return p.map(([b,v])=>` ${`${b}:`.padEnd(m+1)} ${v}`).join(`
- `)}class i extends r.BaseError{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
- `),{name:"FeeConflictError"})}}Nr.FeeConflictError=i;class s extends r.BaseError{constructor({v:p}){super(`Invalid \`v\` value "${p}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}Nr.InvalidLegacyVError=s;class o extends r.BaseError{constructor({transaction:p}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",n(p),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}Nr.InvalidSerializableTransactionError=o;class a extends r.BaseError{constructor({serializedType:p}){super(`Serialized transaction type "${p}" is invalid.`,{name:"InvalidSerializedTransactionType"}),Object.defineProperty(this,"serializedType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedType=p}}Nr.InvalidSerializedTransactionTypeError=a;class c extends r.BaseError{constructor({attributes:p,serializedTransaction:m,type:b}){const v=Object.entries(p).map(([E,w])=>typeof w>"u"?E:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${b}" was provided.`,{metaMessages:[`Serialized Transaction: "${m}"`,v.length>0?`Missing Attributes: ${v.join(", ")}`:""].filter(Boolean),name:"InvalidSerializedTransactionError"}),Object.defineProperty(this,"serializedTransaction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedTransaction=m,this.type=b}}Nr.InvalidSerializedTransactionError=c;class u extends r.BaseError{constructor({storageKey:p}){super(`Size for storage key "${p}" is invalid. Expected 32 bytes. Got ${Math.floor((p.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}Nr.InvalidStorageKeySizeError=u;class l extends r.BaseError{constructor(p,{account:m,docsPath:b,chain:v,data:E,gas:w,gasPrice:C,maxFeePerGas:y,maxPriorityFeePerGas:_,nonce:x,to:A,value:T}){var k;const O=n({chain:v&&`${v==null?void 0:v.name} (id: ${v==null?void 0:v.id})`,from:m==null?void 0:m.address,to:A,value:typeof T<"u"&&`${(0,t.formatEther)(T)} ${((k=v==null?void 0:v.nativeCurrency)==null?void 0:k.symbol)||"ETH"}`,data:E,gas:w,gasPrice:typeof C<"u"&&`${(0,e.formatGwei)(C)} gwei`,maxFeePerGas:typeof y<"u"&&`${(0,e.formatGwei)(y)} gwei`,maxPriorityFeePerGas:typeof _<"u"&&`${(0,e.formatGwei)(_)} gwei`,nonce:x});super(p.shortMessage,{cause:p,docsPath:b,metaMessages:[...p.metaMessages?[...p.metaMessages," "]:[],"Request Arguments:",O].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=p}}Nr.TransactionExecutionError=l;class d extends r.BaseError{constructor({blockHash:p,blockNumber:m,blockTag:b,hash:v,index:E}){let w="Transaction";b&&E!==void 0&&(w=`Transaction at block time "${b}" at index "${E}"`),p&&E!==void 0&&(w=`Transaction at block hash "${p}" at index "${E}"`),m&&E!==void 0&&(w=`Transaction at block number "${m}" at index "${E}"`),v&&(w=`Transaction with hash "${v}"`),super(`${w} could not be found.`,{name:"TransactionNotFoundError"})}}Nr.TransactionNotFoundError=d;class h extends r.BaseError{constructor({hash:p}){super(`Transaction receipt with hash "${p}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}Nr.TransactionReceiptNotFoundError=h;class f extends r.BaseError{constructor({hash:p}){super(`Timed out while waiting for transaction with hash "${p}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}return Nr.WaitForTransactionReceiptTimeoutError=f,Nr}var Eh={},PL;function bO(){if(PL)return Eh;PL=1,Object.defineProperty(Eh,"__esModule",{value:!0}),Eh.getUrl=Eh.getContractAddress=void 0;const t=r=>r;Eh.getContractAddress=t;const e=r=>r;return Eh.getUrl=e,Eh}var OL;function Qd(){if(OL)return ui;OL=1,Object.defineProperty(ui,"__esModule",{value:!0}),ui.RawContractError=ui.CounterfactualDeploymentFailedError=ui.ContractFunctionZeroDataError=ui.ContractFunctionRevertedError=ui.ContractFunctionExecutionError=ui.CallExecutionError=void 0;const t=sn(),e=XA(),r=ex(),n=el(),i=$Q(),s=rl(),o=E2(),a=Fp(),c=$r(),u=_t(),l=wO(),d=Ds(),h=bO();class f extends u.BaseError{constructor(w,{account:C,docsPath:y,chain:_,data:x,gas:A,gasPrice:T,maxFeePerGas:O,maxPriorityFeePerGas:k,nonce:j,to:N,value:S,stateOverride:P}){var $;const I=C?(0,t.parseAccount)(C):void 0;let B=(0,d.prettyPrint)({from:I==null?void 0:I.address,to:N,value:typeof S<"u"&&`${(0,o.formatEther)(S)} ${(($=_==null?void 0:_.nativeCurrency)==null?void 0:$.symbol)||"ETH"}`,data:x,gas:A,gasPrice:typeof T<"u"&&`${(0,a.formatGwei)(T)} gwei`,maxFeePerGas:typeof O<"u"&&`${(0,a.formatGwei)(O)} gwei`,maxPriorityFeePerGas:typeof k<"u"&&`${(0,a.formatGwei)(k)} gwei`,nonce:j});P&&(B+=`
- ${(0,l.prettyStateOverride)(P)}`),super(w.shortMessage,{cause:w,docsPath:y,metaMessages:[...w.metaMessages?[...w.metaMessages," "]:[],"Raw Call Arguments:",B].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=w}}ui.CallExecutionError=f;class g extends u.BaseError{constructor(w,{abi:C,args:y,contractAddress:_,docsPath:x,functionName:A,sender:T}){const O=(0,s.getAbiItem)({abi:C,args:y,name:A}),k=O?(0,i.formatAbiItemWithArgs)({abiItem:O,args:y,includeFunctionName:!1,includeName:!1}):void 0,j=O?(0,n.formatAbiItem)(O,{includeName:!0}):void 0,N=(0,d.prettyPrint)({address:_&&(0,h.getContractAddress)(_),function:j,args:k&&k!=="()"&&`${[...Array((A==null?void 0:A.length)??0).keys()].map(()=>" ").join("")}${k}`,sender:T});super(w.shortMessage||`An unknown error occurred while executing the contract function "${A}".`,{cause:w,docsPath:x,metaMessages:[...w.metaMessages?[...w.metaMessages," "]:[],N&&"Contract Call:",N].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=C,this.args=y,this.cause=w,this.contractAddress=_,this.functionName=A,this.sender=T}}ui.ContractFunctionExecutionError=g;class p extends u.BaseError{constructor({abi:w,data:C,functionName:y,message:_}){let x,A,T,O;if(C&&C!=="0x")try{A=(0,r.decodeErrorResult)({abi:w,data:C});const{abiItem:j,errorName:N,args:S}=A;if(N==="Error")O=S[0];else if(N==="Panic"){const[P]=S;O=e.panicReasons[P]}else{const P=j?(0,n.formatAbiItem)(j,{includeName:!0}):void 0,I=j&&S?(0,i.formatAbiItemWithArgs)({abiItem:j,args:S,includeFunctionName:!1,includeName:!1}):void 0;T=[P?`Error: ${P}`:"",I&&I!=="()"?` ${[...Array((N==null?void 0:N.length)??0).keys()].map(()=>" ").join("")}${I}`:""]}}catch(j){x=j}else _&&(O=_);let k;x instanceof c.AbiErrorSignatureNotFoundError&&(k=x.signature,T=[`Unable to decode signature "${k}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${k}.`]),super(O&&O!=="execution reverted"||k?[`The contract function "${y}" reverted with the following ${k?"signature":"reason"}:`,O||k].join(`
- `):`The contract function "${y}" reverted.`,{cause:x,metaMessages:T,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=A,this.raw=C,this.reason=O,this.signature=k}}ui.ContractFunctionRevertedError=p;class m extends u.BaseError{constructor({functionName:w}){super(`The contract function "${w}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${w}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}ui.ContractFunctionZeroDataError=m;class b extends u.BaseError{constructor({factory:w}){super(`Deployment for counterfactual contract call failed${w?` for factory "${w}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}ui.CounterfactualDeploymentFailedError=b;class v extends u.BaseError{constructor({data:w,message:C}){super(C||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=w}}return ui.RawContractError=v,ui}var cs={},RL;function ha(){if(RL)return cs;RL=1,Object.defineProperty(cs,"__esModule",{value:!0}),cs.TimeoutError=cs.SocketClosedError=cs.RpcRequestError=cs.WebSocketRequestError=cs.HttpRequestError=void 0;const t=Gn(),e=_t(),r=bO();class n extends e.BaseError{constructor({body:u,cause:l,details:d,headers:h,status:f,url:g}){super("HTTP request failed.",{cause:l,details:d,metaMessages:[f&&`Status: ${f}`,`URL: ${(0,r.getUrl)(g)}`,u&&`Request body: ${(0,t.stringify)(u)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=u,this.headers=h,this.status=f,this.url=g}}cs.HttpRequestError=n;class i extends e.BaseError{constructor({body:u,cause:l,details:d,url:h}){super("WebSocket request failed.",{cause:l,details:d,metaMessages:[`URL: ${(0,r.getUrl)(h)}`,u&&`Request body: ${(0,t.stringify)(u)}`].filter(Boolean),name:"WebSocketRequestError"})}}cs.WebSocketRequestError=i;class s extends e.BaseError{constructor({body:u,error:l,url:d}){super("RPC Request failed.",{cause:l,details:l.message,metaMessages:[`URL: ${(0,r.getUrl)(d)}`,`Request body: ${(0,t.stringify)(u)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=l.code,this.data=l.data}}cs.RpcRequestError=s;class o extends e.BaseError{constructor({url:u}={}){super("The socket has been closed.",{metaMessages:[u&&`URL: ${(0,r.getUrl)(u)}`].filter(Boolean),name:"SocketClosedError"})}}cs.SocketClosedError=o;class a extends e.BaseError{constructor({body:u,url:l}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,r.getUrl)(l)}`,`Request body: ${(0,t.stringify)(u)}`],name:"TimeoutError"})}}return cs.TimeoutError=a,cs}var tt={},kL;function Xd(){if(kL)return tt;kL=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.UnknownRpcError=tt.AtomicityNotSupportedError=tt.AtomicReadyWalletRejectedUpgradeError=tt.BundleTooLargeError=tt.UnknownBundleIdError=tt.DuplicateIdError=tt.UnsupportedChainIdError=tt.UnsupportedNonOptionalCapabilityError=tt.SwitchChainError=tt.ChainDisconnectedError=tt.ProviderDisconnectedError=tt.UnsupportedProviderMethodError=tt.UnauthorizedProviderError=tt.UserRejectedRequestError=tt.JsonRpcVersionUnsupportedError=tt.LimitExceededRpcError=tt.MethodNotSupportedRpcError=tt.TransactionRejectedRpcError=tt.ResourceUnavailableRpcError=tt.ResourceNotFoundRpcError=tt.InvalidInputRpcError=tt.InternalRpcError=tt.InvalidParamsRpcError=tt.MethodNotFoundRpcError=tt.InvalidRequestRpcError=tt.ParseRpcError=tt.ProviderRpcError=tt.RpcError=void 0;const t=_t(),e=ha(),r=-1;class n extends t.BaseError{constructor(P,{code:I,docsPath:B,metaMessages:$,name:R,shortMessage:D}){super(D,{cause:P,docsPath:B,metaMessages:$||(P==null?void 0:P.metaMessages),name:R||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=R||P.name,this.code=P instanceof e.RpcRequestError?P.code:I??r}}tt.RpcError=n;class i extends n{constructor(P,I){super(P,I),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=I.data}}tt.ProviderRpcError=i;class s extends n{constructor(P){super(P,{code:s.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}tt.ParseRpcError=s,Object.defineProperty(s,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class o extends n{constructor(P){super(P,{code:o.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}tt.InvalidRequestRpcError=o,Object.defineProperty(o,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class a extends n{constructor(P,{method:I}={}){super(P,{code:a.code,name:"MethodNotFoundRpcError",shortMessage:`The method${I?` "${I}"`:""} does not exist / is not available.`})}}tt.MethodNotFoundRpcError=a,Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class c extends n{constructor(P){super(P,{code:c.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
- `)})}}tt.InvalidParamsRpcError=c,Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class u extends n{constructor(P){super(P,{code:u.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}tt.InternalRpcError=u,Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class l extends n{constructor(P){super(P,{code:l.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
- `)})}}tt.InvalidInputRpcError=l,Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class d extends n{constructor(P){super(P,{code:d.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}tt.ResourceNotFoundRpcError=d,Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class h extends n{constructor(P){super(P,{code:h.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}tt.ResourceUnavailableRpcError=h,Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class f extends n{constructor(P){super(P,{code:f.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}tt.TransactionRejectedRpcError=f,Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class g extends n{constructor(P,{method:I}={}){super(P,{code:g.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${I?` "${I}"`:""} is not supported.`})}}tt.MethodNotSupportedRpcError=g,Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class p extends n{constructor(P){super(P,{code:p.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}tt.LimitExceededRpcError=p,Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class m extends n{constructor(P){super(P,{code:m.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}tt.JsonRpcVersionUnsupportedError=m,Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class b extends i{constructor(P){super(P,{code:b.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}tt.UserRejectedRequestError=b,Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class v extends i{constructor(P){super(P,{code:v.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}tt.UnauthorizedProviderError=v,Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class E extends i{constructor(P,{method:I}={}){super(P,{code:E.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${I?` " ${I}"`:""}.`})}}tt.UnsupportedProviderMethodError=E,Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class w extends i{constructor(P){super(P,{code:w.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}tt.ProviderDisconnectedError=w,Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class C extends i{constructor(P){super(P,{code:C.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}tt.ChainDisconnectedError=C,Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class y extends i{constructor(P){super(P,{code:y.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}tt.SwitchChainError=y,Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class _ extends i{constructor(P){super(P,{code:_.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}tt.UnsupportedNonOptionalCapabilityError=_,Object.defineProperty(_,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class x extends i{constructor(P){super(P,{code:x.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}tt.UnsupportedChainIdError=x,Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class A extends i{constructor(P){super(P,{code:A.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}tt.DuplicateIdError=A,Object.defineProperty(A,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class T extends i{constructor(P){super(P,{code:T.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}tt.UnknownBundleIdError=T,Object.defineProperty(T,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class O extends i{constructor(P){super(P,{code:O.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}tt.BundleTooLargeError=O,Object.defineProperty(O,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class k extends i{constructor(P){super(P,{code:k.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}tt.AtomicReadyWalletRejectedUpgradeError=k,Object.defineProperty(k,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class j extends i{constructor(P){super(P,{code:j.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}tt.AtomicityNotSupportedError=j,Object.defineProperty(j,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class N extends n{constructor(P){super(P,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}return tt.UnknownRpcError=N,tt}var NL;function eh(){if(NL)return r_;NL=1,Object.defineProperty(r_,"__esModule",{value:!0}),r_.getContractError=o;const t=$r(),e=_t(),r=Qd(),n=ha(),i=Xd(),s=3;function o(a,{abi:c,address:u,args:l,docsPath:d,functionName:h,sender:f}){const g=a instanceof r.RawContractError?a:a instanceof e.BaseError?a.walk(C=>"data"in C)||a.walk():{},{code:p,data:m,details:b,message:v,shortMessage:E}=g,w=a instanceof t.AbiDecodingZeroDataError?new r.ContractFunctionZeroDataError({functionName:h}):[s,i.InternalRpcError.code].includes(p)&&(m||b||v||E)?new r.ContractFunctionRevertedError({abi:c,data:typeof m=="object"?m.data:m,functionName:h,message:g instanceof n.RpcRequestError?b:E??v}):a;return new r.ContractFunctionExecutionError(w,{abi:c,args:l,contractAddress:u,docsPath:d,functionName:h,sender:f})}return r_}var l_={},d_={},h_={},f_={},$L;function jQ(){if($L)return f_;$L=1,Object.defineProperty(f_,"__esModule",{value:!0}),f_.publicKeyToAddress=r;const t=js(),e=ns();function r(n){const i=(0,e.keccak256)(`0x${n.substring(4)}`).substring(26);return(0,t.checksumAddress)(`0x${i}`)}return f_}var p_={},wT={},br={},Zn={},jL;function BQ(){if(jL)return Zn;jL=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.SHA512_IV=Zn.SHA384_IV=Zn.SHA224_IV=Zn.SHA256_IV=Zn.HashMD=void 0,Zn.setBigUint64=e,Zn.Chi=r,Zn.Maj=n;const t=Yd();function e(s,o,a,c){if(typeof s.setBigUint64=="function")return s.setBigUint64(o,a,c);const u=BigInt(32),l=BigInt(4294967295),d=Number(a>>u&l),h=Number(a&l),f=c?4:0,g=c?0:4;s.setUint32(o+f,d,c),s.setUint32(o+g,h,c)}function r(s,o,a){return s&o^~s&a}function n(s,o,a){return s&o^s&a^o&a}class i extends t.Hash{constructor(o,a,c,u){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=o,this.outputLen=a,this.padOffset=c,this.isLE=u,this.buffer=new Uint8Array(o),this.view=(0,t.createView)(this.buffer)}update(o){(0,t.aexists)(this),o=(0,t.toBytes)(o),(0,t.abytes)(o);const{view:a,buffer:c,blockLen:u}=this,l=o.length;for(let d=0;d<l;){const h=Math.min(u-this.pos,l-d);if(h===u){const f=(0,t.createView)(o);for(;u<=l-d;d+=u)this.process(f,d);continue}c.set(o.subarray(d,d+h),this.pos),this.pos+=h,d+=h,this.pos===u&&(this.process(a,0),this.pos=0)}return this.length+=o.length,this.roundClean(),this}digestInto(o){(0,t.aexists)(this),(0,t.aoutput)(o,this),this.finished=!0;const{buffer:a,view:c,blockLen:u,isLE:l}=this;let{pos:d}=this;a[d++]=128,(0,t.clean)(this.buffer.subarray(d)),this.padOffset>u-d&&(this.process(c,0),d=0);for(let m=d;m<u;m++)a[m]=0;e(c,u-8,BigInt(this.length*8),l),this.process(c,0);const h=(0,t.createView)(o),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const g=f/4,p=this.get();if(g>p.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<g;m++)h.setUint32(4*m,p[m],l)}digest(){const{buffer:o,outputLen:a}=this;this.digestInto(o);const c=o.slice(0,a);return this.destroy(),c}_cloneInto(o){o||(o=new this.constructor),o.set(...this.get());const{blockLen:a,buffer:c,length:u,finished:l,destroyed:d,pos:h}=this;return o.destroyed=d,o.finished=l,o.length=u,o.pos=h,u%a&&o.buffer.set(c),o}clone(){return this._cloneInto()}}return Zn.HashMD=i,Zn.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Zn.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Zn.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Zn.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Zn}var BL;function DQ(){if(BL)return br;BL=1,Object.defineProperty(br,"__esModule",{value:!0}),br.sha512_224=br.sha512_256=br.sha384=br.sha512=br.sha224=br.sha256=br.SHA512_256=br.SHA512_224=br.SHA384=br.SHA512=br.SHA224=br.SHA256=void 0;const t=BQ(),e=RQ(),r=Yd(),n=Uint32Array.from([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]),i=new Uint32Array(64);class s extends t.HashMD{constructor(E=32){super(64,E,8,!1),this.A=t.SHA256_IV[0]|0,this.B=t.SHA256_IV[1]|0,this.C=t.SHA256_IV[2]|0,this.D=t.SHA256_IV[3]|0,this.E=t.SHA256_IV[4]|0,this.F=t.SHA256_IV[5]|0,this.G=t.SHA256_IV[6]|0,this.H=t.SHA256_IV[7]|0}get(){const{A:E,B:w,C,D:y,E:_,F:x,G:A,H:T}=this;return[E,w,C,y,_,x,A,T]}set(E,w,C,y,_,x,A,T){this.A=E|0,this.B=w|0,this.C=C|0,this.D=y|0,this.E=_|0,this.F=x|0,this.G=A|0,this.H=T|0}process(E,w){for(let j=0;j<16;j++,w+=4)i[j]=E.getUint32(w,!1);for(let j=16;j<64;j++){const N=i[j-15],S=i[j-2],P=(0,r.rotr)(N,7)^(0,r.rotr)(N,18)^N>>>3,I=(0,r.rotr)(S,17)^(0,r.rotr)(S,19)^S>>>10;i[j]=I+i[j-7]+P+i[j-16]|0}let{A:C,B:y,C:_,D:x,E:A,F:T,G:O,H:k}=this;for(let j=0;j<64;j++){const N=(0,r.rotr)(A,6)^(0,r.rotr)(A,11)^(0,r.rotr)(A,25),S=k+N+(0,t.Chi)(A,T,O)+n[j]+i[j]|0,I=((0,r.rotr)(C,2)^(0,r.rotr)(C,13)^(0,r.rotr)(C,22))+(0,t.Maj)(C,y,_)|0;k=O,O=T,T=A,A=x+S|0,x=_,_=y,y=C,C=S+I|0}C=C+this.A|0,y=y+this.B|0,_=_+this.C|0,x=x+this.D|0,A=A+this.E|0,T=T+this.F|0,O=O+this.G|0,k=k+this.H|0,this.set(C,y,_,x,A,T,O,k)}roundClean(){(0,r.clean)(i)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,r.clean)(this.buffer)}}br.SHA256=s;class o extends s{constructor(){super(28),this.A=t.SHA224_IV[0]|0,this.B=t.SHA224_IV[1]|0,this.C=t.SHA224_IV[2]|0,this.D=t.SHA224_IV[3]|0,this.E=t.SHA224_IV[4]|0,this.F=t.SHA224_IV[5]|0,this.G=t.SHA224_IV[6]|0,this.H=t.SHA224_IV[7]|0}}br.SHA224=o;const a=e.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(v=>BigInt(v))),c=a[0],u=a[1],l=new Uint32Array(80),d=new Uint32Array(80);class h extends t.HashMD{constructor(E=64){super(128,E,16,!1),this.Ah=t.SHA512_IV[0]|0,this.Al=t.SHA512_IV[1]|0,this.Bh=t.SHA512_IV[2]|0,this.Bl=t.SHA512_IV[3]|0,this.Ch=t.SHA512_IV[4]|0,this.Cl=t.SHA512_IV[5]|0,this.Dh=t.SHA512_IV[6]|0,this.Dl=t.SHA512_IV[7]|0,this.Eh=t.SHA512_IV[8]|0,this.El=t.SHA512_IV[9]|0,this.Fh=t.SHA512_IV[10]|0,this.Fl=t.SHA512_IV[11]|0,this.Gh=t.SHA512_IV[12]|0,this.Gl=t.SHA512_IV[13]|0,this.Hh=t.SHA512_IV[14]|0,this.Hl=t.SHA512_IV[15]|0}get(){const{Ah:E,Al:w,Bh:C,Bl:y,Ch:_,Cl:x,Dh:A,Dl:T,Eh:O,El:k,Fh:j,Fl:N,Gh:S,Gl:P,Hh:I,Hl:B}=this;return[E,w,C,y,_,x,A,T,O,k,j,N,S,P,I,B]}set(E,w,C,y,_,x,A,T,O,k,j,N,S,P,I,B){this.Ah=E|0,this.Al=w|0,this.Bh=C|0,this.Bl=y|0,this.Ch=_|0,this.Cl=x|0,this.Dh=A|0,this.Dl=T|0,this.Eh=O|0,this.El=k|0,this.Fh=j|0,this.Fl=N|0,this.Gh=S|0,this.Gl=P|0,this.Hh=I|0,this.Hl=B|0}process(E,w){for(let D=0;D<16;D++,w+=4)l[D]=E.getUint32(w),d[D]=E.getUint32(w+=4);for(let D=16;D<80;D++){const L=l[D-15]|0,U=d[D-15]|0,z=e.rotrSH(L,U,1)^e.rotrSH(L,U,8)^e.shrSH(L,U,7),W=e.rotrSL(L,U,1)^e.rotrSL(L,U,8)^e.shrSL(L,U,7),K=l[D-2]|0,J=d[D-2]|0,ne=e.rotrSH(K,J,19)^e.rotrBH(K,J,61)^e.shrSH(K,J,6),ae=e.rotrSL(K,J,19)^e.rotrBL(K,J,61)^e.shrSL(K,J,6),he=e.add4L(W,ae,d[D-7],d[D-16]),ie=e.add4H(he,z,ne,l[D-7],l[D-16]);l[D]=ie|0,d[D]=he|0}let{Ah:C,Al:y,Bh:_,Bl:x,Ch:A,Cl:T,Dh:O,Dl:k,Eh:j,El:N,Fh:S,Fl:P,Gh:I,Gl:B,Hh:$,Hl:R}=this;for(let D=0;D<80;D++){const L=e.rotrSH(j,N,14)^e.rotrSH(j,N,18)^e.rotrBH(j,N,41),U=e.rotrSL(j,N,14)^e.rotrSL(j,N,18)^e.rotrBL(j,N,41),z=j&S^~j&I,W=N&P^~N&B,K=e.add5L(R,U,W,u[D],d[D]),J=e.add5H(K,$,L,z,c[D],l[D]),ne=K|0,ae=e.rotrSH(C,y,28)^e.rotrBH(C,y,34)^e.rotrBH(C,y,39),he=e.rotrSL(C,y,28)^e.rotrBL(C,y,34)^e.rotrBL(C,y,39),ie=C&_^C&A^_&A,Ee=y&x^y&T^x&T;$=I|0,R=B|0,I=S|0,B=P|0,S=j|0,P=N|0,{h:j,l:N}=e.add(O|0,k|0,J|0,ne|0),O=A|0,k=T|0,A=_|0,T=x|0,_=C|0,x=y|0;const pe=e.add3L(ne,he,Ee);C=e.add3H(pe,J,ae,ie),y=pe|0}({h:C,l:y}=e.add(this.Ah|0,this.Al|0,C|0,y|0)),{h:_,l:x}=e.add(this.Bh|0,this.Bl|0,_|0,x|0),{h:A,l:T}=e.add(this.Ch|0,this.Cl|0,A|0,T|0),{h:O,l:k}=e.add(this.Dh|0,this.Dl|0,O|0,k|0),{h:j,l:N}=e.add(this.Eh|0,this.El|0,j|0,N|0),{h:S,l:P}=e.add(this.Fh|0,this.Fl|0,S|0,P|0),{h:I,l:B}=e.add(this.Gh|0,this.Gl|0,I|0,B|0),{h:$,l:R}=e.add(this.Hh|0,this.Hl|0,$|0,R|0),this.set(C,y,_,x,A,T,O,k,j,N,S,P,I,B,$,R)}roundClean(){(0,r.clean)(l,d)}destroy(){(0,r.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}br.SHA512=h;class f extends h{constructor(){super(48),this.Ah=t.SHA384_IV[0]|0,this.Al=t.SHA384_IV[1]|0,this.Bh=t.SHA384_IV[2]|0,this.Bl=t.SHA384_IV[3]|0,this.Ch=t.SHA384_IV[4]|0,this.Cl=t.SHA384_IV[5]|0,this.Dh=t.SHA384_IV[6]|0,this.Dl=t.SHA384_IV[7]|0,this.Eh=t.SHA384_IV[8]|0,this.El=t.SHA384_IV[9]|0,this.Fh=t.SHA384_IV[10]|0,this.Fl=t.SHA384_IV[11]|0,this.Gh=t.SHA384_IV[12]|0,this.Gl=t.SHA384_IV[13]|0,this.Hh=t.SHA384_IV[14]|0,this.Hl=t.SHA384_IV[15]|0}}br.SHA384=f;const g=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),p=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class m extends h{constructor(){super(28),this.Ah=g[0]|0,this.Al=g[1]|0,this.Bh=g[2]|0,this.Bl=g[3]|0,this.Ch=g[4]|0,this.Cl=g[5]|0,this.Dh=g[6]|0,this.Dl=g[7]|0,this.Eh=g[8]|0,this.El=g[9]|0,this.Fh=g[10]|0,this.Fl=g[11]|0,this.Gh=g[12]|0,this.Gl=g[13]|0,this.Hh=g[14]|0,this.Hl=g[15]|0}}br.SHA512_224=m;class b extends h{constructor(){super(32),this.Ah=p[0]|0,this.Al=p[1]|0,this.Bh=p[2]|0,this.Bl=p[3]|0,this.Ch=p[4]|0,this.Cl=p[5]|0,this.Dh=p[6]|0,this.Dl=p[7]|0,this.Eh=p[8]|0,this.El=p[9]|0,this.Fh=p[10]|0,this.Fl=p[11]|0,this.Gh=p[12]|0,this.Gl=p[13]|0,this.Hh=p[14]|0,this.Hl=p[15]|0}}return br.SHA512_256=b,br.sha256=(0,r.createHasher)(()=>new s),br.sha224=(0,r.createHasher)(()=>new o),br.sha512=(0,r.createHasher)(()=>new h),br.sha384=(0,r.createHasher)(()=>new f),br.sha512_256=(0,r.createHasher)(()=>new b),br.sha512_224=(0,r.createHasher)(()=>new m),br}var Tw={},bT={},DL;function hIe(){return DL||(DL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const e=Yd();class r extends e.Hash{constructor(s,o){super(),this.finished=!1,this.destroyed=!1,(0,e.ahash)(s);const a=(0,e.toBytes)(o);if(this.iHash=s.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const c=this.blockLen,u=new Uint8Array(c);u.set(a.length>c?s.create().update(a).digest():a);for(let l=0;l<u.length;l++)u[l]^=54;this.iHash.update(u),this.oHash=s.create();for(let l=0;l<u.length;l++)u[l]^=106;this.oHash.update(u),(0,e.clean)(u)}update(s){return(0,e.aexists)(this),this.iHash.update(s),this}digestInto(s){(0,e.aexists)(this),(0,e.abytes)(s,this.outputLen),this.finished=!0,this.iHash.digestInto(s),this.oHash.update(s),this.oHash.digestInto(s),this.destroy()}digest(){const s=new Uint8Array(this.oHash.outputLen);return this.digestInto(s),s}_cloneInto(s){s||(s=Object.create(Object.getPrototypeOf(this),{}));const{oHash:o,iHash:a,finished:c,destroyed:u,blockLen:l,outputLen:d}=this;return s=s,s.finished=c,s.destroyed=u,s.blockLen=l,s.outputLen=d,s.oHash=o._cloneInto(s.oHash),s.iHash=a._cloneInto(s.iHash),s}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=r;const n=(i,s,o)=>new r(i,s).update(o).digest();t.hmac=n,t.hmac.create=(i,s)=>new r(i,s)}(bT)),bT}var yT={},Ch={},Ir={},Vt={},ML;function C2(){if(ML)return Vt;ML=1;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.notImplemented=Vt.bitMask=void 0,Vt.isBytes=r,Vt.abytes=n,Vt.abool=i,Vt.numberToHexUnpadded=s,Vt.hexToNumber=o,Vt.bytesToHex=u,Vt.hexToBytes=h,Vt.bytesToNumberBE=f,Vt.bytesToNumberLE=g,Vt.numberToBytesBE=p,Vt.numberToBytesLE=m,Vt.numberToVarBytesBE=b,Vt.ensureBytes=v,Vt.concatBytes=E,Vt.equalBytes=w,Vt.utf8ToBytes=C,Vt.inRange=_,Vt.aInRange=x,Vt.bitLen=A,Vt.bitGet=T,Vt.bitSet=O,Vt.createHmacDrbg=S,Vt.validateObject=I,Vt.memoized=$;const t=BigInt(0),e=BigInt(1);function r(R){return R instanceof Uint8Array||ArrayBuffer.isView(R)&&R.constructor.name==="Uint8Array"}function n(R){if(!r(R))throw new Error("Uint8Array expected")}function i(R,D){if(typeof D!="boolean")throw new Error(R+" boolean expected, got "+D)}function s(R){const D=R.toString(16);return D.length&1?"0"+D:D}function o(R){if(typeof R!="string")throw new Error("hex string expected, got "+typeof R);return R===""?t:BigInt("0x"+R)}const a=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",c=Array.from({length:256},(R,D)=>D.toString(16).padStart(2,"0"));function u(R){if(n(R),a)return R.toHex();let D="";for(let L=0;L<R.length;L++)D+=c[R[L]];return D}const l={_0:48,_9:57,A:65,F:70,a:97,f:102};function d(R){if(R>=l._0&&R<=l._9)return R-l._0;if(R>=l.A&&R<=l.F)return R-(l.A-10);if(R>=l.a&&R<=l.f)return R-(l.a-10)}function h(R){if(typeof R!="string")throw new Error("hex string expected, got "+typeof R);if(a)return Uint8Array.fromHex(R);const D=R.length,L=D/2;if(D%2)throw new Error("hex string expected, got unpadded hex of length "+D);const U=new Uint8Array(L);for(let z=0,W=0;z<L;z++,W+=2){const K=d(R.charCodeAt(W)),J=d(R.charCodeAt(W+1));if(K===void 0||J===void 0){const ne=R[W]+R[W+1];throw new Error('hex string expected, got non-hex character "'+ne+'" at index '+W)}U[z]=K*16+J}return U}function f(R){return o(u(R))}function g(R){return n(R),o(u(Uint8Array.from(R).reverse()))}function p(R,D){return h(R.toString(16).padStart(D*2,"0"))}function m(R,D){return p(R,D).reverse()}function b(R){return h(s(R))}function v(R,D,L){let U;if(typeof D=="string")try{U=h(D)}catch(W){throw new Error(R+" must be hex string or Uint8Array, cause: "+W)}else if(r(D))U=Uint8Array.from(D);else throw new Error(R+" must be hex string or Uint8Array");const z=U.length;if(typeof L=="number"&&z!==L)throw new Error(R+" of length "+L+" expected, got "+z);return U}function E(...R){let D=0;for(let U=0;U<R.length;U++){const z=R[U];n(z),D+=z.length}const L=new Uint8Array(D);for(let U=0,z=0;U<R.length;U++){const W=R[U];L.set(W,z),z+=W.length}return L}function w(R,D){if(R.length!==D.length)return!1;let L=0;for(let U=0;U<R.length;U++)L|=R[U]^D[U];return L===0}function C(R){if(typeof R!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(R))}const y=R=>typeof R=="bigint"&&t<=R;function _(R,D,L){return y(R)&&y(D)&&y(L)&&D<=R&&R<L}function x(R,D,L,U){if(!_(D,L,U))throw new Error("expected valid "+R+": "+L+" <= n < "+U+", got "+D)}function A(R){let D;for(D=0;R>t;R>>=e,D+=1);return D}function T(R,D){return R>>BigInt(D)&e}function O(R,D,L){return R|(L?e:t)<<BigInt(D)}const k=R=>(e<<BigInt(R))-e;Vt.bitMask=k;const j=R=>new Uint8Array(R),N=R=>Uint8Array.from(R);function S(R,D,L){if(typeof R!="number"||R<2)throw new Error("hashLen must be a number");if(typeof D!="number"||D<2)throw new Error("qByteLen must be a number");if(typeof L!="function")throw new Error("hmacFn must be a function");let U=j(R),z=j(R),W=0;const K=()=>{U.fill(1),z.fill(0),W=0},J=(...ie)=>L(z,U,...ie),ne=(ie=j(0))=>{z=J(N([0]),ie),U=J(),ie.length!==0&&(z=J(N([1]),ie),U=J())},ae=()=>{if(W++>=1e3)throw new Error("drbg: tried 1000 values");let ie=0;const Ee=[];for(;ie<D;){U=J();const pe=U.slice();Ee.push(pe),ie+=U.length}return E(...Ee)};return(ie,Ee)=>{K(),ne(ie);let pe;for(;!(pe=Ee(ae()));)ne();return K(),pe}}const P={bigint:R=>typeof R=="bigint",function:R=>typeof R=="function",boolean:R=>typeof R=="boolean",string:R=>typeof R=="string",stringOrUint8Array:R=>typeof R=="string"||r(R),isSafeInteger:R=>Number.isSafeInteger(R),array:R=>Array.isArray(R),field:(R,D)=>D.Fp.isValid(R),hash:R=>typeof R=="function"&&Number.isSafeInteger(R.outputLen)};function I(R,D,L={}){const U=(z,W,K)=>{const J=P[W];if(typeof J!="function")throw new Error("invalid validator function");const ne=R[z];if(!(K&&ne===void 0)&&!J(ne,R))throw new Error("param "+String(z)+" is invalid. Expected "+W+", got "+ne)};for(const[z,W]of Object.entries(D))U(z,W,!1);for(const[z,W]of Object.entries(L))U(z,W,!0);return R}const B=()=>{throw new Error("not implemented")};Vt.notImplemented=B;function $(R){const D=new WeakMap;return(L,...U)=>{const z=D.get(L);if(z!==void 0)return z;const W=R(L,...U);return D.set(L,W),W}}return Vt}var LL;function rx(){if(LL)return Ir;LL=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.isNegativeLE=void 0,Ir.mod=u,Ir.pow=l,Ir.pow2=d,Ir.invert=h,Ir.tonelliShanks=p,Ir.FpSqrt=m,Ir.validateField=E,Ir.FpPow=w,Ir.FpInvertBatch=C,Ir.FpDiv=y,Ir.FpLegendre=_,Ir.FpIsSquare=x,Ir.nLength=A,Ir.Field=T,Ir.FpSqrtOdd=O,Ir.FpSqrtEven=k,Ir.hashToPrivateScalar=j,Ir.getFieldBytesLength=N,Ir.getMinHashLength=S,Ir.mapHashToField=P;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Yd(),e=C2(),r=BigInt(0),n=BigInt(1),i=BigInt(2),s=BigInt(3),o=BigInt(4),a=BigInt(5),c=BigInt(8);function u(I,B){const $=I%B;return $>=r?$:B+$}function l(I,B,$){return w(T($),I,B)}function d(I,B,$){let R=I;for(;B-- >r;)R*=R,R%=$;return R}function h(I,B){if(I===r)throw new Error("invert: expected non-zero number");if(B<=r)throw new Error("invert: expected positive modulus, got "+B);let $=u(I,B),R=B,D=r,L=n;for(;$!==r;){const z=R/$,W=R%$,K=D-L*z;R=$,$=W,D=L,L=K}if(R!==n)throw new Error("invert: does not exist");return u(D,B)}function f(I,B){const $=(I.ORDER+n)/o,R=I.pow(B,$);if(!I.eql(I.sqr(R),B))throw new Error("Cannot find square root");return R}function g(I,B){const $=(I.ORDER-a)/c,R=I.mul(B,i),D=I.pow(R,$),L=I.mul(B,D),U=I.mul(I.mul(L,i),D),z=I.mul(L,I.sub(U,I.ONE));if(!I.eql(I.sqr(z),B))throw new Error("Cannot find square root");return z}function p(I){if(I<BigInt(3))throw new Error("sqrt is not defined for small field");let B=I-n,$=0;for(;B%i===r;)B/=i,$++;let R=i;const D=T(I);for(;_(D,R)===1;)if(R++>1e3)throw new Error("Cannot find square root: probably non-prime P");if($===1)return f;let L=D.pow(R,B);const U=(B+n)/i;return function(W,K){if(W.is0(K))return K;if(_(W,K)!==1)throw new Error("Cannot find square root");let J=$,ne=W.mul(W.ONE,L),ae=W.pow(K,B),he=W.pow(K,U);for(;!W.eql(ae,W.ONE);){if(W.is0(ae))return W.ZERO;let ie=1,Ee=W.sqr(ae);for(;!W.eql(Ee,W.ONE);)if(ie++,Ee=W.sqr(Ee),ie===J)throw new Error("Cannot find square root");const pe=n<<BigInt(J-ie-1),ve=W.pow(ne,pe);J=ie,ne=W.sqr(ve),ae=W.mul(ae,ne),he=W.mul(he,ve)}return he}}function m(I){return I%o===s?f:I%c===a?g:p(I)}const b=(I,B)=>(u(I,B)&n)===n;Ir.isNegativeLE=b;const v=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function E(I){const B={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},$=v.reduce((R,D)=>(R[D]="function",R),B);return(0,e.validateObject)(I,$)}function w(I,B,$){if($<r)throw new Error("invalid exponent, negatives unsupported");if($===r)return I.ONE;if($===n)return B;let R=I.ONE,D=B;for(;$>r;)$&n&&(R=I.mul(R,D)),D=I.sqr(D),$>>=n;return R}function C(I,B,$=!1){const R=new Array(B.length).fill($?I.ZERO:void 0),D=B.reduce((U,z,W)=>I.is0(z)?U:(R[W]=U,I.mul(U,z)),I.ONE),L=I.inv(D);return B.reduceRight((U,z,W)=>I.is0(z)?U:(R[W]=I.mul(U,R[W]),I.mul(U,z)),L),R}function y(I,B,$){return I.mul(B,typeof $=="bigint"?h($,I.ORDER):I.inv($))}function _(I,B){const $=(I.ORDER-n)/i,R=I.pow(B,$),D=I.eql(R,I.ONE),L=I.eql(R,I.ZERO),U=I.eql(R,I.neg(I.ONE));if(!D&&!L&&!U)throw new Error("invalid Legendre symbol result");return D?1:L?0:-1}function x(I,B){return _(I,B)===1}function A(I,B){B!==void 0&&(0,t.anumber)(B);const $=B!==void 0?B:I.toString(2).length,R=Math.ceil($/8);return{nBitLength:$,nByteLength:R}}function T(I,B,$=!1,R={}){if(I<=r)throw new Error("invalid field: expected ORDER > 0, got "+I);const{nBitLength:D,nByteLength:L}=A(I,B);if(L>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let U;const z=Object.freeze({ORDER:I,isLE:$,BITS:D,BYTES:L,MASK:(0,e.bitMask)(D),ZERO:r,ONE:n,create:W=>u(W,I),isValid:W=>{if(typeof W!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof W);return r<=W&&W<I},is0:W=>W===r,isOdd:W=>(W&n)===n,neg:W=>u(-W,I),eql:(W,K)=>W===K,sqr:W=>u(W*W,I),add:(W,K)=>u(W+K,I),sub:(W,K)=>u(W-K,I),mul:(W,K)=>u(W*K,I),pow:(W,K)=>w(z,W,K),div:(W,K)=>u(W*h(K,I),I),sqrN:W=>W*W,addN:(W,K)=>W+K,subN:(W,K)=>W-K,mulN:(W,K)=>W*K,inv:W=>h(W,I),sqrt:R.sqrt||(W=>(U||(U=m(I)),U(z,W))),toBytes:W=>$?(0,e.numberToBytesLE)(W,L):(0,e.numberToBytesBE)(W,L),fromBytes:W=>{if(W.length!==L)throw new Error("Field.fromBytes: expected "+L+" bytes, got "+W.length);return $?(0,e.bytesToNumberLE)(W):(0,e.bytesToNumberBE)(W)},invertBatch:W=>C(z,W),cmov:(W,K,J)=>J?K:W});return Object.freeze(z)}function O(I,B){if(!I.isOdd)throw new Error("Field doesn't have isOdd");const $=I.sqrt(B);return I.isOdd($)?$:I.neg($)}function k(I,B){if(!I.isOdd)throw new Error("Field doesn't have isOdd");const $=I.sqrt(B);return I.isOdd($)?I.neg($):$}function j(I,B,$=!1){I=(0,e.ensureBytes)("privateHash",I);const R=I.length,D=A(B).nByteLength+8;if(D<24||R<D||R>1024)throw new Error("hashToPrivateScalar: expected "+D+"-1024 bytes of input, got "+R);const L=$?(0,e.bytesToNumberLE)(I):(0,e.bytesToNumberBE)(I);return u(L,B-n)+n}function N(I){if(typeof I!="bigint")throw new Error("field order must be bigint");const B=I.toString(2).length;return Math.ceil(B/8)}function S(I){const B=N(I);return B+Math.ceil(B/2)}function P(I,B,$=!1){const R=I.length,D=N(B),L=S(B);if(R<16||R<L||R>1024)throw new Error("expected "+L+"-1024 bytes of input, got "+R);const U=$?(0,e.bytesToNumberLE)(I):(0,e.bytesToNumberBE)(I),z=u(U,B-n)+n;return $?(0,e.numberToBytesLE)(z,D):(0,e.numberToBytesBE)(z,D)}return Ir}var UL;function fIe(){if(UL)return Ch;UL=1,Object.defineProperty(Ch,"__esModule",{value:!0}),Ch.wNAF=f,Ch.pippenger=g,Ch.precomputeMSMUnsafe=p,Ch.validateBasic=m;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=rx(),e=C2(),r=BigInt(0),n=BigInt(1);function i(b,v){const E=v.negate();return b?E:v}function s(b,v){if(!Number.isSafeInteger(b)||b<=0||b>v)throw new Error("invalid window size, expected [1.."+v+"], got W="+b)}function o(b,v){s(b,v);const E=Math.ceil(v/b)+1,w=2**(b-1),C=2**b,y=(0,e.bitMask)(b),_=BigInt(b);return{windows:E,windowSize:w,mask:y,maxNumber:C,shiftBy:_}}function a(b,v,E){const{windowSize:w,mask:C,maxNumber:y,shiftBy:_}=E;let x=Number(b&C),A=b>>_;x>w&&(x-=y,A+=n);const T=v*w,O=T+Math.abs(x)-1,k=x===0,j=x<0,N=v%2!==0;return{nextN:A,offset:O,isZero:k,isNeg:j,isNegF:N,offsetF:T}}function c(b,v){if(!Array.isArray(b))throw new Error("array expected");b.forEach((E,w)=>{if(!(E instanceof v))throw new Error("invalid point at index "+w)})}function u(b,v){if(!Array.isArray(b))throw new Error("array of scalars expected");b.forEach((E,w)=>{if(!v.isValid(E))throw new Error("invalid scalar at index "+w)})}const l=new WeakMap,d=new WeakMap;function h(b){return d.get(b)||1}function f(b,v){return{constTimeNegate:i,hasPrecomputes(E){return h(E)!==1},unsafeLadder(E,w,C=b.ZERO){let y=E;for(;w>r;)w&n&&(C=C.add(y)),y=y.double(),w>>=n;return C},precomputeWindow(E,w){const{windows:C,windowSize:y}=o(w,v),_=[];let x=E,A=x;for(let T=0;T<C;T++){A=x,_.push(A);for(let O=1;O<y;O++)A=A.add(x),_.push(A);x=A.double()}return _},wNAF(E,w,C){let y=b.ZERO,_=b.BASE;const x=o(E,v);for(let A=0;A<x.windows;A++){const{nextN:T,offset:O,isZero:k,isNeg:j,isNegF:N,offsetF:S}=a(C,A,x);C=T,k?_=_.add(i(N,w[S])):y=y.add(i(j,w[O]))}return{p:y,f:_}},wNAFUnsafe(E,w,C,y=b.ZERO){const _=o(E,v);for(let x=0;x<_.windows&&C!==r;x++){const{nextN:A,offset:T,isZero:O,isNeg:k}=a(C,x,_);if(C=A,!O){const j=w[T];y=y.add(k?j.negate():j)}}return y},getPrecomputes(E,w,C){let y=l.get(w);return y||(y=this.precomputeWindow(w,E),E!==1&&l.set(w,C(y))),y},wNAFCached(E,w,C){const y=h(E);return this.wNAF(y,this.getPrecomputes(y,E,C),w)},wNAFCachedUnsafe(E,w,C,y){const _=h(E);return _===1?this.unsafeLadder(E,w,y):this.wNAFUnsafe(_,this.getPrecomputes(_,E,C),w,y)},setWindowSize(E,w){s(w,v),d.set(E,w),l.delete(E)}}}function g(b,v,E,w){c(E,b),u(w,v);const C=E.length,y=w.length;if(C!==y)throw new Error("arrays of points and scalars must have equal length");const _=b.ZERO,x=(0,e.bitLen)(BigInt(C));let A=1;x>12?A=x-3:x>4?A=x-2:x>0&&(A=2);const T=(0,e.bitMask)(A),O=new Array(Number(T)+1).fill(_),k=Math.floor((v.BITS-1)/A)*A;let j=_;for(let N=k;N>=0;N-=A){O.fill(_);for(let P=0;P<y;P++){const I=w[P],B=Number(I>>BigInt(N)&T);O[B]=O[B].add(E[P])}let S=_;for(let P=O.length-1,I=_;P>0;P--)I=I.add(O[P]),S=S.add(I);if(j=j.add(S),N!==0)for(let P=0;P<A;P++)j=j.double()}return j}function p(b,v,E,w){s(w,v.BITS),c(E,b);const C=b.ZERO,y=2**w-1,_=Math.ceil(v.BITS/w),x=(0,e.bitMask)(w),A=E.map(T=>{const O=[];for(let k=0,j=T;k<y;k++)O.push(j),j=j.add(T);return O});return T=>{if(u(T,v),T.length>E.length)throw new Error("array of scalars must be smaller than array of points");let O=C;for(let k=0;k<_;k++){if(O!==C)for(let N=0;N<w;N++)O=O.double();const j=BigInt(_*w-(k+1)*w);for(let N=0;N<T.length;N++){const S=T[N],P=Number(S>>j&x);P&&(O=O.add(A[N][P-1]))}}return O}}function m(b){return(0,t.validateField)(b.Fp),(0,e.validateObject)(b,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,t.nLength)(b.n,b.nBitLength),...b,p:b.Fp.ORDER})}return Ch}var FL;function MQ(){return FL||(FL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DER=t.DERErr=void 0,t.weierstrassPoints=f,t.weierstrass=p,t.SWUFpSqrtRatio=m,t.mapToCurveSimpleSWU=b;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=fIe(),r=rx(),n=C2();function i(v){v.lowS!==void 0&&(0,n.abool)("lowS",v.lowS),v.prehash!==void 0&&(0,n.abool)("prehash",v.prehash)}function s(v){const E=(0,e.validateBasic)(v);(0,n.validateObject)(E,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:w,Fp:C,a:y}=E;if(w){if(!C.eql(y,C.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof w!="object"||typeof w.beta!="bigint"||typeof w.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...E})}class o extends Error{constructor(E=""){super(E)}}t.DERErr=o,t.DER={Err:o,_tlv:{encode:(v,E)=>{const{Err:w}=t.DER;if(v<0||v>256)throw new w("tlv.encode: wrong tag");if(E.length&1)throw new w("tlv.encode: unpadded data");const C=E.length/2,y=(0,n.numberToHexUnpadded)(C);if(y.length/2&128)throw new w("tlv.encode: long form length too big");const _=C>127?(0,n.numberToHexUnpadded)(y.length/2|128):"";return(0,n.numberToHexUnpadded)(v)+_+y+E},decode(v,E){const{Err:w}=t.DER;let C=0;if(v<0||v>256)throw new w("tlv.encode: wrong tag");if(E.length<2||E[C++]!==v)throw new w("tlv.decode: wrong tlv");const y=E[C++],_=!!(y&128);let x=0;if(!_)x=y;else{const T=y&127;if(!T)throw new w("tlv.decode(long): indefinite length not supported");if(T>4)throw new w("tlv.decode(long): byte length is too big");const O=E.subarray(C,C+T);if(O.length!==T)throw new w("tlv.decode: length bytes not complete");if(O[0]===0)throw new w("tlv.decode(long): zero leftmost byte");for(const k of O)x=x<<8|k;if(C+=T,x<128)throw new w("tlv.decode(long): not minimal encoding")}const A=E.subarray(C,C+x);if(A.length!==x)throw new w("tlv.decode: wrong value length");return{v:A,l:E.subarray(C+x)}}},_int:{encode(v){const{Err:E}=t.DER;if(v<c)throw new E("integer: negative integers are not allowed");let w=(0,n.numberToHexUnpadded)(v);if(Number.parseInt(w[0],16)&8&&(w="00"+w),w.length&1)throw new E("unexpected DER parsing assertion: unpadded hex");return w},decode(v){const{Err:E}=t.DER;if(v[0]&128)throw new E("invalid signature integer: negative");if(v[0]===0&&!(v[1]&128))throw new E("invalid signature integer: unnecessary leading zero");return(0,n.bytesToNumberBE)(v)}},toSig(v){const{Err:E,_int:w,_tlv:C}=t.DER,y=(0,n.ensureBytes)("signature",v),{v:_,l:x}=C.decode(48,y);if(x.length)throw new E("invalid signature: left bytes after parsing");const{v:A,l:T}=C.decode(2,_),{v:O,l:k}=C.decode(2,T);if(k.length)throw new E("invalid signature: left bytes after parsing");return{r:w.decode(A),s:w.decode(O)}},hexFromSig(v){const{_tlv:E,_int:w}=t.DER,C=E.encode(2,w.encode(v.r)),y=E.encode(2,w.encode(v.s)),_=C+y;return E.encode(48,_)}};function a(v,E){return(0,n.bytesToHex)((0,n.numberToBytesBE)(v,E))}const c=BigInt(0),u=BigInt(1),l=BigInt(2),d=BigInt(3),h=BigInt(4);function f(v){const E=s(v),{Fp:w}=E,C=(0,r.Field)(E.n,E.nBitLength),y=E.toBytes||((D,L,U)=>{const z=L.toAffine();return(0,n.concatBytes)(Uint8Array.from([4]),w.toBytes(z.x),w.toBytes(z.y))}),_=E.fromBytes||(D=>{const L=D.subarray(1),U=w.fromBytes(L.subarray(0,w.BYTES)),z=w.fromBytes(L.subarray(w.BYTES,2*w.BYTES));return{x:U,y:z}});function x(D){const{a:L,b:U}=E,z=w.sqr(D),W=w.mul(z,D);return w.add(w.add(W,w.mul(D,L)),U)}function A(D,L){const U=w.sqr(L),z=x(D);return w.eql(U,z)}if(!A(E.Gx,E.Gy))throw new Error("bad curve params: generator point");const T=w.mul(w.pow(E.a,d),h),O=w.mul(w.sqr(E.b),BigInt(27));if(w.is0(w.add(T,O)))throw new Error("bad curve params: a or b");function k(D){return(0,n.inRange)(D,u,E.n)}function j(D){const{allowedPrivateKeyLengths:L,nByteLength:U,wrapPrivateKey:z,n:W}=E;if(L&&typeof D!="bigint"){if((0,n.isBytes)(D)&&(D=(0,n.bytesToHex)(D)),typeof D!="string"||!L.includes(D.length))throw new Error("invalid private key");D=D.padStart(U*2,"0")}let K;try{K=typeof D=="bigint"?D:(0,n.bytesToNumberBE)((0,n.ensureBytes)("private key",D,U))}catch{throw new Error("invalid private key, expected hex or "+U+" bytes, got "+typeof D)}return z&&(K=(0,r.mod)(K,W)),(0,n.aInRange)("private key",K,u,W),K}function N(D){if(!(D instanceof I))throw new Error("ProjectivePoint expected")}const S=(0,n.memoized)((D,L)=>{const{px:U,py:z,pz:W}=D;if(w.eql(W,w.ONE))return{x:U,y:z};const K=D.is0();L==null&&(L=K?w.ONE:w.inv(W));const J=w.mul(U,L),ne=w.mul(z,L),ae=w.mul(W,L);if(K)return{x:w.ZERO,y:w.ZERO};if(!w.eql(ae,w.ONE))throw new Error("invZ was invalid");return{x:J,y:ne}}),P=(0,n.memoized)(D=>{if(D.is0()){if(E.allowInfinityPoint&&!w.is0(D.py))return;throw new Error("bad point: ZERO")}const{x:L,y:U}=D.toAffine();if(!w.isValid(L)||!w.isValid(U))throw new Error("bad point: x or y not FE");if(!A(L,U))throw new Error("bad point: equation left != right");if(!D.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class I{constructor(L,U,z){if(L==null||!w.isValid(L))throw new Error("x required");if(U==null||!w.isValid(U)||w.is0(U))throw new Error("y required");if(z==null||!w.isValid(z))throw new Error("z required");this.px=L,this.py=U,this.pz=z,Object.freeze(this)}static fromAffine(L){const{x:U,y:z}=L||{};if(!L||!w.isValid(U)||!w.isValid(z))throw new Error("invalid affine point");if(L instanceof I)throw new Error("projective point not allowed");const W=K=>w.eql(K,w.ZERO);return W(U)&&W(z)?I.ZERO:new I(U,z,w.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(L){const U=(0,r.FpInvertBatch)(w,L.map(z=>z.pz));return L.map((z,W)=>z.toAffine(U[W])).map(I.fromAffine)}static fromHex(L){const U=I.fromAffine(_((0,n.ensureBytes)("pointHex",L)));return U.assertValidity(),U}static fromPrivateKey(L){return I.BASE.multiply(j(L))}static msm(L,U){return(0,e.pippenger)(I,C,L,U)}_setWindowSize(L){R.setWindowSize(this,L)}assertValidity(){P(this)}hasEvenY(){const{y:L}=this.toAffine();if(w.isOdd)return!w.isOdd(L);throw new Error("Field doesn't support isOdd")}equals(L){N(L);const{px:U,py:z,pz:W}=this,{px:K,py:J,pz:ne}=L,ae=w.eql(w.mul(U,ne),w.mul(K,W)),he=w.eql(w.mul(z,ne),w.mul(J,W));return ae&&he}negate(){return new I(this.px,w.neg(this.py),this.pz)}double(){const{a:L,b:U}=E,z=w.mul(U,d),{px:W,py:K,pz:J}=this;let ne=w.ZERO,ae=w.ZERO,he=w.ZERO,ie=w.mul(W,W),Ee=w.mul(K,K),pe=w.mul(J,J),ve=w.mul(W,K);return ve=w.add(ve,ve),he=w.mul(W,J),he=w.add(he,he),ne=w.mul(L,he),ae=w.mul(z,pe),ae=w.add(ne,ae),ne=w.sub(Ee,ae),ae=w.add(Ee,ae),ae=w.mul(ne,ae),ne=w.mul(ve,ne),he=w.mul(z,he),pe=w.mul(L,pe),ve=w.sub(ie,pe),ve=w.mul(L,ve),ve=w.add(ve,he),he=w.add(ie,ie),ie=w.add(he,ie),ie=w.add(ie,pe),ie=w.mul(ie,ve),ae=w.add(ae,ie),pe=w.mul(K,J),pe=w.add(pe,pe),ie=w.mul(pe,ve),ne=w.sub(ne,ie),he=w.mul(pe,Ee),he=w.add(he,he),he=w.add(he,he),new I(ne,ae,he)}add(L){N(L);const{px:U,py:z,pz:W}=this,{px:K,py:J,pz:ne}=L;let ae=w.ZERO,he=w.ZERO,ie=w.ZERO;const Ee=E.a,pe=w.mul(E.b,d);let ve=w.mul(U,K),je=w.mul(z,J),rt=w.mul(W,ne),Ce=w.add(U,z),fe=w.add(K,J);Ce=w.mul(Ce,fe),fe=w.add(ve,je),Ce=w.sub(Ce,fe),fe=w.add(U,W);let ft=w.add(K,ne);return fe=w.mul(fe,ft),ft=w.add(ve,rt),fe=w.sub(fe,ft),ft=w.add(z,W),ae=w.add(J,ne),ft=w.mul(ft,ae),ae=w.add(je,rt),ft=w.sub(ft,ae),ie=w.mul(Ee,fe),ae=w.mul(pe,rt),ie=w.add(ae,ie),ae=w.sub(je,ie),ie=w.add(je,ie),he=w.mul(ae,ie),je=w.add(ve,ve),je=w.add(je,ve),rt=w.mul(Ee,rt),fe=w.mul(pe,fe),je=w.add(je,rt),rt=w.sub(ve,rt),rt=w.mul(Ee,rt),fe=w.add(fe,rt),ve=w.mul(je,fe),he=w.add(he,ve),ve=w.mul(ft,fe),ae=w.mul(Ce,ae),ae=w.sub(ae,ve),ve=w.mul(Ce,je),ie=w.mul(ft,ie),ie=w.add(ie,ve),new I(ae,he,ie)}subtract(L){return this.add(L.negate())}is0(){return this.equals(I.ZERO)}wNAF(L){return R.wNAFCached(this,L,I.normalizeZ)}multiplyUnsafe(L){const{endo:U,n:z}=E;(0,n.aInRange)("scalar",L,c,z);const W=I.ZERO;if(L===c)return W;if(this.is0()||L===u)return this;if(!U||R.hasPrecomputes(this))return R.wNAFCachedUnsafe(this,L,I.normalizeZ);let{k1neg:K,k1:J,k2neg:ne,k2:ae}=U.splitScalar(L),he=W,ie=W,Ee=this;for(;J>c||ae>c;)J&u&&(he=he.add(Ee)),ae&u&&(ie=ie.add(Ee)),Ee=Ee.double(),J>>=u,ae>>=u;return K&&(he=he.negate()),ne&&(ie=ie.negate()),ie=new I(w.mul(ie.px,U.beta),ie.py,ie.pz),he.add(ie)}multiply(L){const{endo:U,n:z}=E;(0,n.aInRange)("scalar",L,u,z);let W,K;if(U){const{k1neg:J,k1:ne,k2neg:ae,k2:he}=U.splitScalar(L);let{p:ie,f:Ee}=this.wNAF(ne),{p:pe,f:ve}=this.wNAF(he);ie=R.constTimeNegate(J,ie),pe=R.constTimeNegate(ae,pe),pe=new I(w.mul(pe.px,U.beta),pe.py,pe.pz),W=ie.add(pe),K=Ee.add(ve)}else{const{p:J,f:ne}=this.wNAF(L);W=J,K=ne}return I.normalizeZ([W,K])[0]}multiplyAndAddUnsafe(L,U,z){const W=I.BASE,K=(ne,ae)=>ae===c||ae===u||!ne.equals(W)?ne.multiplyUnsafe(ae):ne.multiply(ae),J=K(this,U).add(K(L,z));return J.is0()?void 0:J}toAffine(L){return S(this,L)}isTorsionFree(){const{h:L,isTorsionFree:U}=E;if(L===u)return!0;if(U)return U(I,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:L,clearCofactor:U}=E;return L===u?this:U?U(I,this):this.multiplyUnsafe(E.h)}toRawBytes(L=!0){return(0,n.abool)("isCompressed",L),this.assertValidity(),y(I,this,L)}toHex(L=!0){return(0,n.abool)("isCompressed",L),(0,n.bytesToHex)(this.toRawBytes(L))}}I.BASE=new I(E.Gx,E.Gy,w.ONE),I.ZERO=new I(w.ZERO,w.ONE,w.ZERO);const{endo:B,nBitLength:$}=E,R=(0,e.wNAF)(I,B?Math.ceil($/2):$);return{CURVE:E,ProjectivePoint:I,normPrivateKeyToScalar:j,weierstrassEquation:x,isWithinCurveOrder:k}}function g(v){const E=(0,e.validateBasic)(v);return(0,n.validateObject)(E,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...E})}function p(v){const E=g(v),{Fp:w,n:C,nByteLength:y,nBitLength:_}=E,x=w.BYTES+1,A=2*w.BYTES+1;function T(pe){return(0,r.mod)(pe,C)}function O(pe){return(0,r.invert)(pe,C)}const{ProjectivePoint:k,normPrivateKeyToScalar:j,weierstrassEquation:N,isWithinCurveOrder:S}=f({...E,toBytes(pe,ve,je){const rt=ve.toAffine(),Ce=w.toBytes(rt.x),fe=n.concatBytes;return(0,n.abool)("isCompressed",je),je?fe(Uint8Array.from([ve.hasEvenY()?2:3]),Ce):fe(Uint8Array.from([4]),Ce,w.toBytes(rt.y))},fromBytes(pe){const ve=pe.length,je=pe[0],rt=pe.subarray(1);if(ve===x&&(je===2||je===3)){const Ce=(0,n.bytesToNumberBE)(rt);if(!(0,n.inRange)(Ce,u,w.ORDER))throw new Error("Point is not on curve");const fe=N(Ce);let ft;try{ft=w.sqrt(fe)}catch(dr){const hr=dr instanceof Error?": "+dr.message:"";throw new Error("Point is not on curve"+hr)}const Wt=(ft&u)===u;return(je&1)===1!==Wt&&(ft=w.neg(ft)),{x:Ce,y:ft}}else if(ve===A&&je===4){const Ce=w.fromBytes(rt.subarray(0,w.BYTES)),fe=w.fromBytes(rt.subarray(w.BYTES,2*w.BYTES));return{x:Ce,y:fe}}else{const Ce=x,fe=A;throw new Error("invalid Point, expected length of "+Ce+", or uncompressed "+fe+", got "+ve)}}});function P(pe){const ve=C>>u;return pe>ve}function I(pe){return P(pe)?T(-pe):pe}const B=(pe,ve,je)=>(0,n.bytesToNumberBE)(pe.slice(ve,je));class ${constructor(ve,je,rt){(0,n.aInRange)("r",ve,u,C),(0,n.aInRange)("s",je,u,C),this.r=ve,this.s=je,rt!=null&&(this.recovery=rt),Object.freeze(this)}static fromCompact(ve){const je=y;return ve=(0,n.ensureBytes)("compactSignature",ve,je*2),new $(B(ve,0,je),B(ve,je,2*je))}static fromDER(ve){const{r:je,s:rt}=t.DER.toSig((0,n.ensureBytes)("DER",ve));return new $(je,rt)}assertValidity(){}addRecoveryBit(ve){return new $(this.r,this.s,ve)}recoverPublicKey(ve){const{r:je,s:rt,recovery:Ce}=this,fe=W((0,n.ensureBytes)("msgHash",ve));if(Ce==null||![0,1,2,3].includes(Ce))throw new Error("recovery id invalid");const ft=Ce===2||Ce===3?je+E.n:je;if(ft>=w.ORDER)throw new Error("recovery id 2 or 3 invalid");const Wt=(Ce&1)===0?"02":"03",lr=k.fromHex(Wt+a(ft,w.BYTES)),dr=O(ft),hr=T(-fe*dr),Er=T(rt*dr),be=k.BASE.multiplyAndAddUnsafe(lr,hr,Er);if(!be)throw new Error("point at infinify");return be.assertValidity(),be}hasHighS(){return P(this.s)}normalizeS(){return this.hasHighS()?new $(this.r,T(-this.s),this.recovery):this}toDERRawBytes(){return(0,n.hexToBytes)(this.toDERHex())}toDERHex(){return t.DER.hexFromSig(this)}toCompactRawBytes(){return(0,n.hexToBytes)(this.toCompactHex())}toCompactHex(){const ve=y;return a(this.r,ve)+a(this.s,ve)}}const R={isValidPrivateKey(pe){try{return j(pe),!0}catch{return!1}},normPrivateKeyToScalar:j,randomPrivateKey:()=>{const pe=(0,r.getMinHashLength)(E.n);return(0,r.mapHashToField)(E.randomBytes(pe),E.n)},precompute(pe=8,ve=k.BASE){return ve._setWindowSize(pe),ve.multiply(BigInt(3)),ve}};function D(pe,ve=!0){return k.fromPrivateKey(pe).toRawBytes(ve)}function L(pe){if(typeof pe=="bigint")return!1;if(pe instanceof k)return!0;const je=(0,n.ensureBytes)("key",pe).length,rt=w.BYTES,Ce=rt+1,fe=2*rt+1;if(!(E.allowedPrivateKeyLengths||y===Ce))return je===Ce||je===fe}function U(pe,ve,je=!0){if(L(pe)===!0)throw new Error("first arg must be private key");if(L(ve)===!1)throw new Error("second arg must be public key");return k.fromHex(ve).multiply(j(pe)).toRawBytes(je)}const z=E.bits2int||function(pe){if(pe.length>8192)throw new Error("input is too large");const ve=(0,n.bytesToNumberBE)(pe),je=pe.length*8-_;return je>0?ve>>BigInt(je):ve},W=E.bits2int_modN||function(pe){return T(z(pe))},K=(0,n.bitMask)(_);function J(pe){return(0,n.aInRange)("num < 2^"+_,pe,c,K),(0,n.numberToBytesBE)(pe,y)}function ne(pe,ve,je=ae){if(["recovered","canonical"].some(Me=>Me in je))throw new Error("sign() legacy options not supported");const{hash:rt,randomBytes:Ce}=E;let{lowS:fe,prehash:ft,extraEntropy:Wt}=je;fe==null&&(fe=!0),pe=(0,n.ensureBytes)("msgHash",pe),i(je),ft&&(pe=(0,n.ensureBytes)("prehashed msgHash",rt(pe)));const lr=W(pe),dr=j(ve),hr=[J(dr),J(lr)];if(Wt!=null&&Wt!==!1){const Me=Wt===!0?Ce(w.BYTES):Wt;hr.push((0,n.ensureBytes)("extraEntropy",Me))}const Er=(0,n.concatBytes)(...hr),be=lr;function Te(Me){const st=z(Me);if(!S(st))return;const Cr=O(st),hn=k.BASE.multiply(st).toAffine(),ai=T(hn.x);if(ai===c)return;const fn=T(Cr*T(be+ai*dr));if(fn===c)return;let Ms=(hn.x===ai?0:2)|Number(hn.y&u),mo=fn;return fe&&P(fn)&&(mo=I(fn),Ms^=1),new $(ai,mo,Ms)}return{seed:Er,k2sig:Te}}const ae={lowS:E.lowS,prehash:!1},he={lowS:E.lowS,prehash:!1};function ie(pe,ve,je=ae){const{seed:rt,k2sig:Ce}=ne(pe,ve,je),fe=E;return(0,n.createHmacDrbg)(fe.hash.outputLen,fe.nByteLength,fe.hmac)(rt,Ce)}k.BASE._setWindowSize(8);function Ee(pe,ve,je,rt=he){var Ms;const Ce=pe;ve=(0,n.ensureBytes)("msgHash",ve),je=(0,n.ensureBytes)("publicKey",je);const{lowS:fe,prehash:ft,format:Wt}=rt;if(i(rt),"strict"in rt)throw new Error("options.strict was renamed to lowS");if(Wt!==void 0&&Wt!=="compact"&&Wt!=="der")throw new Error("format must be compact or der");const lr=typeof Ce=="string"||(0,n.isBytes)(Ce),dr=!lr&&!Wt&&typeof Ce=="object"&&Ce!==null&&typeof Ce.r=="bigint"&&typeof Ce.s=="bigint";if(!lr&&!dr)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let hr,Er;try{if(dr&&(hr=new $(Ce.r,Ce.s)),lr){try{Wt!=="compact"&&(hr=$.fromDER(Ce))}catch(mo){if(!(mo instanceof t.DER.Err))throw mo}!hr&&Wt!=="der"&&(hr=$.fromCompact(Ce))}Er=k.fromHex(je)}catch{return!1}if(!hr||fe&&hr.hasHighS())return!1;ft&&(ve=E.hash(ve));const{r:be,s:Te}=hr,Me=W(ve),st=O(Te),Cr=T(Me*st),hn=T(be*st),ai=(Ms=k.BASE.multiplyAndAddUnsafe(Er,Cr,hn))==null?void 0:Ms.toAffine();return ai?T(ai.x)===be:!1}return{CURVE:E,getPublicKey:D,getSharedSecret:U,sign:ie,verify:Ee,ProjectivePoint:k,Signature:$,utils:R}}function m(v,E){const w=v.ORDER;let C=c;for(let P=w-u;P%l===c;P/=l)C+=u;const y=C,_=l<<y-u-u,x=_*l,A=(w-u)/x,T=(A-u)/l,O=x-u,k=_,j=v.pow(E,A),N=v.pow(E,(A+u)/l);let S=(P,I)=>{let B=j,$=v.pow(I,O),R=v.sqr($);R=v.mul(R,I);let D=v.mul(P,R);D=v.pow(D,T),D=v.mul(D,$),$=v.mul(D,I),R=v.mul(D,P);let L=v.mul(R,$);D=v.pow(L,k);let U=v.eql(D,v.ONE);$=v.mul(R,N),D=v.mul(L,B),R=v.cmov($,R,U),L=v.cmov(D,L,U);for(let z=y;z>u;z--){let W=z-l;W=l<<W-u;let K=v.pow(L,W);const J=v.eql(K,v.ONE);$=v.mul(R,B),B=v.mul(B,B),K=v.mul(L,B),R=v.cmov($,R,J),L=v.cmov(K,L,J)}return{isValid:U,value:R}};if(v.ORDER%h===d){const P=(v.ORDER-d)/h,I=v.sqrt(v.neg(E));S=(B,$)=>{let R=v.sqr($);const D=v.mul(B,$);R=v.mul(R,D);let L=v.pow(R,P);L=v.mul(L,D);const U=v.mul(L,I),z=v.mul(v.sqr(L),$),W=v.eql(z,B);let K=v.cmov(U,L,W);return{isValid:W,value:K}}}return S}function b(v,E){if((0,r.validateField)(v),!v.isValid(E.A)||!v.isValid(E.B)||!v.isValid(E.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const w=m(v,E.Z);if(!v.isOdd)throw new Error("Fp.isOdd is not implemented!");return C=>{let y,_,x,A,T,O,k,j;y=v.sqr(C),y=v.mul(y,E.Z),_=v.sqr(y),_=v.add(_,y),x=v.add(_,v.ONE),x=v.mul(x,E.B),A=v.cmov(E.Z,v.neg(_),!v.eql(_,v.ZERO)),A=v.mul(A,E.A),_=v.sqr(x),O=v.sqr(A),T=v.mul(O,E.A),_=v.add(_,T),_=v.mul(_,x),O=v.mul(O,A),T=v.mul(O,E.B),_=v.add(_,T),k=v.mul(y,x);const{isValid:N,value:S}=w(_,O);j=v.mul(y,C),j=v.mul(j,S),k=v.cmov(k,x,N),j=v.cmov(j,S,N);const P=v.isOdd(C)===v.isOdd(j);j=v.cmov(v.neg(j),j,P);const I=(0,r.FpInvertBatch)(v,[A],!0)[0];return k=v.mul(k,I),{x:k,y:j}}}}(yT)),yT}var HL;function pIe(){if(HL)return Tw;HL=1,Object.defineProperty(Tw,"__esModule",{value:!0}),Tw.getHash=n,Tw.createCurve=i;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=hIe(),e=Yd(),r=MQ();function n(s){return{hash:s,hmac:(o,...a)=>(0,t.hmac)(s,o,(0,e.concatBytes)(...a)),randomBytes:e.randomBytes}}function i(s,o){const a=c=>(0,r.weierstrass)({...s,...n(c)});return{...a(o),create:a}}return Tw}var Il={},qL;function gIe(){if(qL)return Il;qL=1,Object.defineProperty(Il,"__esModule",{value:!0}),Il.expand_message_xmd=o,Il.expand_message_xof=a,Il.hash_to_field=c,Il.isogenyMap=u,Il.createHasher=l;const t=rx(),e=C2(),r=e.bytesToNumberBE;function n(d,h){if(s(d),s(h),d<0||d>=1<<8*h)throw new Error("invalid I2OSP input: "+d);const f=Array.from({length:h}).fill(0);for(let g=h-1;g>=0;g--)f[g]=d&255,d>>>=8;return new Uint8Array(f)}function i(d,h){const f=new Uint8Array(d.length);for(let g=0;g<d.length;g++)f[g]=d[g]^h[g];return f}function s(d){if(!Number.isSafeInteger(d))throw new Error("number expected")}function o(d,h,f,g){(0,e.abytes)(d),(0,e.abytes)(h),s(f),h.length>255&&(h=g((0,e.concatBytes)((0,e.utf8ToBytes)("H2C-OVERSIZE-DST-"),h)));const{outputLen:p,blockLen:m}=g,b=Math.ceil(f/p);if(f>65535||b>255)throw new Error("expand_message_xmd: invalid lenInBytes");const v=(0,e.concatBytes)(h,n(h.length,1)),E=n(0,m),w=n(f,2),C=new Array(b),y=g((0,e.concatBytes)(E,d,w,n(0,1),v));C[0]=g((0,e.concatBytes)(y,n(1,1),v));for(let x=1;x<=b;x++){const A=[i(y,C[x-1]),n(x+1,1),v];C[x]=g((0,e.concatBytes)(...A))}return(0,e.concatBytes)(...C).slice(0,f)}function a(d,h,f,g,p){if((0,e.abytes)(d),(0,e.abytes)(h),s(f),h.length>255){const m=Math.ceil(2*g/8);h=p.create({dkLen:m}).update((0,e.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(h).digest()}if(f>65535||h.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return p.create({dkLen:f}).update(d).update(n(f,2)).update(h).update(n(h.length,1)).digest()}function c(d,h,f){(0,e.validateObject)(f,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:g,k:p,m,hash:b,expand:v,DST:E}=f;(0,e.abytes)(d),s(h);const w=typeof E=="string"?(0,e.utf8ToBytes)(E):E,C=g.toString(2).length,y=Math.ceil((C+p)/8),_=h*m*y;let x;if(v==="xmd")x=o(d,w,_,b);else if(v==="xof")x=a(d,w,_,p,b);else if(v==="_internal_pass")x=d;else throw new Error('expand must be "xmd" or "xof"');const A=new Array(h);for(let T=0;T<h;T++){const O=new Array(m);for(let k=0;k<m;k++){const j=y*(k+T*m),N=x.subarray(j,j+y);O[k]=(0,t.mod)(r(N),g)}A[T]=O}return A}function u(d,h){const f=h.map(g=>Array.from(g).reverse());return(g,p)=>{const[m,b,v,E]=f.map(y=>y.reduce((_,x)=>d.add(d.mul(_,g),x))),[w,C]=(0,t.FpInvertBatch)(d,[b,E],!0);return g=d.mul(m,w),p=d.mul(p,d.mul(v,C)),{x:g,y:p}}}function l(d,h,f){if(typeof h!="function")throw new Error("mapToCurve() must be defined");function g(m){return d.fromAffine(h(m))}function p(m){const b=m.clearCofactor();return b.equals(d.ZERO)?d.ZERO:(b.assertValidity(),b)}return{defaults:f,hashToCurve(m,b){const v=c(m,2,{...f,DST:f.DST,...b}),E=g(v[0]),w=g(v[1]);return p(E.add(w))},encodeToCurve(m,b){const v=c(m,1,{...f,DST:f.encodeDST,...b});return p(g(v[0]))},mapToCurve(m){if(!Array.isArray(m))throw new Error("expected array of bigints");for(const b of m)if(typeof b!="bigint")throw new Error("expected array of bigints");return p(g(m))}}}return Il}var zL;function A2(){return zL||(zL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.secp256k1_hasher=t.schnorr=t.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=DQ(),r=Yd(),n=pIe(),i=gIe(),s=rx(),o=C2(),a=MQ(),c=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),u=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(0),d=BigInt(1),h=BigInt(2),f=(I,B)=>(I+B/h)/B;function g(I){const B=c,$=BigInt(3),R=BigInt(6),D=BigInt(11),L=BigInt(22),U=BigInt(23),z=BigInt(44),W=BigInt(88),K=I*I*I%B,J=K*K*I%B,ne=(0,s.pow2)(J,$,B)*J%B,ae=(0,s.pow2)(ne,$,B)*J%B,he=(0,s.pow2)(ae,h,B)*K%B,ie=(0,s.pow2)(he,D,B)*he%B,Ee=(0,s.pow2)(ie,L,B)*ie%B,pe=(0,s.pow2)(Ee,z,B)*Ee%B,ve=(0,s.pow2)(pe,W,B)*pe%B,je=(0,s.pow2)(ve,z,B)*Ee%B,rt=(0,s.pow2)(je,$,B)*J%B,Ce=(0,s.pow2)(rt,U,B)*ie%B,fe=(0,s.pow2)(Ce,R,B)*K%B,ft=(0,s.pow2)(fe,h,B);if(!p.eql(p.sqr(ft),I))throw new Error("Cannot find square root");return ft}const p=(0,s.Field)(c,void 0,void 0,{sqrt:g});t.secp256k1=(0,n.createCurve)({a:l,b:BigInt(7),Fp:p,n:u,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:I=>{const B=u,$=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),R=-d*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),D=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),L=$,U=BigInt("0x100000000000000000000000000000000"),z=f(L*I,B),W=f(-R*I,B);let K=(0,s.mod)(I-z*$-W*D,B),J=(0,s.mod)(-z*R-W*L,B);const ne=K>U,ae=J>U;if(ne&&(K=B-K),ae&&(J=B-J),K>U||J>U)throw new Error("splitScalar: Endomorphism failed, k="+I);return{k1neg:ne,k1:K,k2neg:ae,k2:J}}}},e.sha256);const m={};function b(I,...B){let $=m[I];if($===void 0){const R=(0,e.sha256)(Uint8Array.from(I,D=>D.charCodeAt(0)));$=(0,o.concatBytes)(R,R),m[I]=$}return(0,e.sha256)((0,o.concatBytes)($,...B))}const v=I=>I.toRawBytes(!0).slice(1),E=I=>(0,o.numberToBytesBE)(I,32),w=I=>(0,s.mod)(I,c),C=I=>(0,s.mod)(I,u),y=t.secp256k1.ProjectivePoint,_=(I,B,$)=>y.BASE.multiplyAndAddUnsafe(I,B,$);function x(I){let B=t.secp256k1.utils.normPrivateKeyToScalar(I),$=y.fromPrivateKey(B);return{scalar:$.hasEvenY()?B:C(-B),bytes:v($)}}function A(I){(0,o.aInRange)("x",I,d,c);const B=w(I*I),$=w(B*I+BigInt(7));let R=g($);R%h!==l&&(R=w(-R));const D=new y(I,R,d);return D.assertValidity(),D}const T=o.bytesToNumberBE;function O(...I){return C(T(b("BIP0340/challenge",...I)))}function k(I){return x(I).bytes}function j(I,B,$=(0,r.randomBytes)(32)){const R=(0,o.ensureBytes)("message",I),{bytes:D,scalar:L}=x(B),U=(0,o.ensureBytes)("auxRand",$,32),z=E(L^T(b("BIP0340/aux",U))),W=b("BIP0340/nonce",z,D,R),K=C(T(W));if(K===l)throw new Error("sign failed: k is zero");const{bytes:J,scalar:ne}=x(K),ae=O(J,D,R),he=new Uint8Array(64);if(he.set(J,0),he.set(E(C(ne+ae*L)),32),!N(he,R,D))throw new Error("sign: Invalid signature produced");return he}function N(I,B,$){const R=(0,o.ensureBytes)("signature",I,64),D=(0,o.ensureBytes)("message",B),L=(0,o.ensureBytes)("publicKey",$,32);try{const U=A(T(L)),z=T(R.subarray(0,32));if(!(0,o.inRange)(z,d,c))return!1;const W=T(R.subarray(32,64));if(!(0,o.inRange)(W,d,u))return!1;const K=O(E(z),v(U),D),J=_(U,W,C(-K));return!(!J||!J.hasEvenY()||J.toAffine().x!==z)}catch{return!1}}t.schnorr={getPublicKey:k,sign:j,verify:N,utils:{randomPrivateKey:t.secp256k1.utils.randomPrivateKey,lift_x:A,pointToBytes:v,numberToBytesBE:o.numberToBytesBE,bytesToNumberBE:o.bytesToNumberBE,taggedHash:b,mod:s.mod}};const S=(0,i.isogenyMap)(p,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(I=>I.map(B=>BigInt(B)))),P=(0,a.mapToCurveSimpleSWU)(p,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:p.create(BigInt("-11"))});t.secp256k1_hasher=(0,i.createHasher)(t.secp256k1.ProjectivePoint,I=>{const{x:B,y:$}=P(p.create(I[0]));return S(B,$)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:p.ORDER,m:1,k:128,expand:"xmd",hash:e.sha256}),t.hashToCurve=t.secp256k1_hasher.hashToCurve,t.encodeToCurve=t.secp256k1_hasher.encodeToCurve}(wT)),wT}var WL;function yO(){if(WL)return p_;WL=1,Object.defineProperty(p_,"__esModule",{value:!0}),p_.recoverPublicKey=i;const t=ki(),e=rs(),r=nn(),n=ze();async function i({hash:o,signature:a}){const c=(0,t.isHex)(o)?o:(0,n.toHex)(o),{secp256k1:u}=await Promise.resolve().then(()=>A2());return`0x${(()=>{if(typeof a=="object"&&"r"in a&&"s"in a){const{r:p,s:m,v:b,yParity:v}=a,E=Number(v??b),w=s(E);return new u.Signature((0,r.hexToBigInt)(p),(0,r.hexToBigInt)(m)).addRecoveryBit(w)}const h=(0,t.isHex)(a)?a:(0,n.toHex)(a);if((0,e.size)(h)!==65)throw new Error("invalid signature length");const f=(0,r.hexToNumber)(`0x${h.slice(130)}`),g=s(f);return u.Signature.fromCompact(h.substring(2,130)).addRecoveryBit(g)})().recoverPublicKey(c.substring(2)).toHex(!1)}`}function s(o){if(o===0||o===1)return o;if(o===27)return 0;if(o===28)return 1;throw new Error("Invalid yParityOrV value")}return p_}var VL;function th(){if(VL)return h_;VL=1,Object.defineProperty(h_,"__esModule",{value:!0}),h_.recoverAddress=r;const t=jQ(),e=yO();async function r({hash:n,signature:i}){return(0,t.publicKeyToAddress)(await(0,e.recoverPublicKey)({hash:n,signature:i}))}return h_}var g_={},C0={},GL;function x2(){if(GL)return C0;GL=1,Object.defineProperty(C0,"__esModule",{value:!0}),C0.toRlp=i,C0.bytesToRlp=s,C0.hexToRlp=o;const t=_t(),e=v2(),r=Tr(),n=ze();function i(d,h="hex"){const f=a(d),g=(0,e.createCursor)(new Uint8Array(f.length));return f.encode(g),h==="hex"?(0,n.bytesToHex)(g.bytes):g.bytes}function s(d,h="bytes"){return i(d,h)}function o(d,h="hex"){return i(d,h)}function a(d){return Array.isArray(d)?c(d.map(h=>a(h))):u(d)}function c(d){const h=d.reduce((p,m)=>p+m.length,0),f=l(h);return{length:h<=55?1+h:1+f+h,encode(p){h<=55?p.pushByte(192+h):(p.pushByte(247+f),f===1?p.pushUint8(h):f===2?p.pushUint16(h):f===3?p.pushUint24(h):p.pushUint32(h));for(const{encode:m}of d)m(p)}}}function u(d){const h=typeof d=="string"?(0,r.hexToBytes)(d):d,f=l(h.length);return{length:h.length===1&&h[0]<128?1:h.length<=55?1+h.length:1+f+h.length,encode(p){h.length===1&&h[0]<128?p.pushBytes(h):h.length<=55?(p.pushByte(128+h.length),p.pushBytes(h)):(p.pushByte(183+f),f===1?p.pushUint8(h.length):f===2?p.pushUint16(h.length):f===3?p.pushUint24(h.length):p.pushUint32(h.length),p.pushBytes(h))}}}function l(d){if(d<2**8)return 1;if(d<2**16)return 2;if(d<2**24)return 3;if(d<2**32)return 4;throw new t.BaseError("Length is too large.")}return C0}var KL;function LQ(){if(KL)return g_;KL=1,Object.defineProperty(g_,"__esModule",{value:!0}),g_.hashAuthorization=s;const t=oi(),e=Tr(),r=ze(),n=x2(),i=ns();function s(o){const{chainId:a,nonce:c,to:u}=o,l=o.contractAddress??o.address,d=(0,i.keccak256)((0,t.concatHex)(["0x05",(0,n.toRlp)([a?(0,r.numberToHex)(a):"0x",l,c?(0,r.numberToHex)(c):"0x"])]));return u==="bytes"?(0,e.hexToBytes)(d):d}return g_}var ZL;function nx(){if(ZL)return d_;ZL=1,Object.defineProperty(d_,"__esModule",{value:!0}),d_.recoverAuthorizationAddress=r;const t=th(),e=LQ();async function r(n){const{authorization:i,signature:s}=n;return(0,t.recoverAddress)({hash:(0,e.hashAuthorization)(i),signature:s??i})}return d_}var m_={},Iw={},YL;function UQ(){if(YL)return Iw;YL=1,Object.defineProperty(Iw,"__esModule",{value:!0}),Iw.EstimateGasExecutionError=void 0;const t=E2(),e=Fp(),r=_t(),n=Ds();class i extends r.BaseError{constructor(o,{account:a,docsPath:c,chain:u,data:l,gas:d,gasPrice:h,maxFeePerGas:f,maxPriorityFeePerGas:g,nonce:p,to:m,value:b}){var E;const v=(0,n.prettyPrint)({from:a==null?void 0:a.address,to:m,value:typeof b<"u"&&`${(0,t.formatEther)(b)} ${((E=u==null?void 0:u.nativeCurrency)==null?void 0:E.symbol)||"ETH"}`,data:l,gas:d,gasPrice:typeof h<"u"&&`${(0,e.formatGwei)(h)} gwei`,maxFeePerGas:typeof f<"u"&&`${(0,e.formatGwei)(f)} gwei`,maxPriorityFeePerGas:typeof g<"u"&&`${(0,e.formatGwei)(g)} gwei`,nonce:p});super(o.shortMessage,{cause:o,docsPath:c,metaMessages:[...o.metaMessages?[...o.metaMessages," "]:[],"Estimate Gas Arguments:",v].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=o}}return Iw.EstimateGasExecutionError=i,Iw}var yr={},JL;function nl(){if(JL)return yr;JL=1,Object.defineProperty(yr,"__esModule",{value:!0}),yr.UnknownNodeError=yr.TipAboveFeeCapError=yr.TransactionTypeNotSupportedError=yr.IntrinsicGasTooLowError=yr.IntrinsicGasTooHighError=yr.InsufficientFundsError=yr.NonceMaxValueError=yr.NonceTooLowError=yr.NonceTooHighError=yr.FeeCapTooLowError=yr.FeeCapTooHighError=yr.ExecutionRevertedError=void 0;const t=Fp(),e=_t();class r extends e.BaseError{constructor({cause:p,message:m}={}){var v;const b=(v=m==null?void 0:m.replace("execution reverted: ",""))==null?void 0:v.replace("execution reverted","");super(`Execution reverted ${b?`with reason: ${b}`:"for an unknown reason"}.`,{cause:p,name:"ExecutionRevertedError"})}}yr.ExecutionRevertedError=r,Object.defineProperty(r,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(r,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class n extends e.BaseError{constructor({cause:p,maxFeePerGas:m}={}){super(`The fee cap (\`maxFeePerGas\`${m?` = ${(0,t.formatGwei)(m)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:p,name:"FeeCapTooHighError"})}}yr.FeeCapTooHighError=n,Object.defineProperty(n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class i extends e.BaseError{constructor({cause:p,maxFeePerGas:m}={}){super(`The fee cap (\`maxFeePerGas\`${m?` = ${(0,t.formatGwei)(m)}`:""} gwei) cannot be lower than the block base fee.`,{cause:p,name:"FeeCapTooLowError"})}}yr.FeeCapTooLowError=i,Object.defineProperty(i,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class s extends e.BaseError{constructor({cause:p,nonce:m}={}){super(`Nonce provided for the transaction ${m?`(${m}) `:""}is higher than the next one expected.`,{cause:p,name:"NonceTooHighError"})}}yr.NonceTooHighError=s,Object.defineProperty(s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class o extends e.BaseError{constructor({cause:p,nonce:m}={}){super([`Nonce provided for the transaction ${m?`(${m}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
- `),{cause:p,name:"NonceTooLowError"})}}yr.NonceTooLowError=o,Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class a extends e.BaseError{constructor({cause:p,nonce:m}={}){super(`Nonce provided for the transaction ${m?`(${m}) `:""}exceeds the maximum allowed nonce.`,{cause:p,name:"NonceMaxValueError"})}}yr.NonceMaxValueError=a,Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class c extends e.BaseError{constructor({cause:p}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
- `),{cause:p,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}yr.InsufficientFundsError=c,Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class u extends e.BaseError{constructor({cause:p,gas:m}={}){super(`The amount of gas ${m?`(${m}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:p,name:"IntrinsicGasTooHighError"})}}yr.IntrinsicGasTooHighError=u,Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class l extends e.BaseError{constructor({cause:p,gas:m}={}){super(`The amount of gas ${m?`(${m}) `:""}provided for the transaction is too low.`,{cause:p,name:"IntrinsicGasTooLowError"})}}yr.IntrinsicGasTooLowError=l,Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class d extends e.BaseError{constructor({cause:p}){super("The transaction type is not supported for this chain.",{cause:p,name:"TransactionTypeNotSupportedError"})}}yr.TransactionTypeNotSupportedError=d,Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class h extends e.BaseError{constructor({cause:p,maxPriorityFeePerGas:m,maxFeePerGas:b}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${m?` = ${(0,t.formatGwei)(m)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${b?` = ${(0,t.formatGwei)(b)} gwei`:""}).`].join(`
- `),{cause:p,name:"TipAboveFeeCapError"})}}yr.TipAboveFeeCapError=h,Object.defineProperty(h,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class f extends e.BaseError{constructor({cause:p}){super(`An error occurred while executing: ${p==null?void 0:p.shortMessage}`,{cause:p,name:"UnknownNodeError"})}}return yr.UnknownNodeError=f,yr}var Pw={},QL;function S2(){if(QL)return Pw;QL=1,Object.defineProperty(Pw,"__esModule",{value:!0}),Pw.containsNodeError=i,Pw.getNodeError=s;const t=_t(),e=nl(),r=ha(),n=Xd();function i(o){return o instanceof n.TransactionRejectedRpcError||o instanceof n.InvalidInputRpcError||o instanceof r.RpcRequestError&&o.code===e.ExecutionRevertedError.code}function s(o,a){const c=(o.details||"").toLowerCase(),u=o instanceof t.BaseError?o.walk(l=>(l==null?void 0:l.code)===e.ExecutionRevertedError.code):o;return u instanceof t.BaseError?new e.ExecutionRevertedError({cause:o,message:u.details}):e.ExecutionRevertedError.nodeMessage.test(c)?new e.ExecutionRevertedError({cause:o,message:o.details}):e.FeeCapTooHighError.nodeMessage.test(c)?new e.FeeCapTooHighError({cause:o,maxFeePerGas:a==null?void 0:a.maxFeePerGas}):e.FeeCapTooLowError.nodeMessage.test(c)?new e.FeeCapTooLowError({cause:o,maxFeePerGas:a==null?void 0:a.maxFeePerGas}):e.NonceTooHighError.nodeMessage.test(c)?new e.NonceTooHighError({cause:o,nonce:a==null?void 0:a.nonce}):e.NonceTooLowError.nodeMessage.test(c)?new e.NonceTooLowError({cause:o,nonce:a==null?void 0:a.nonce}):e.NonceMaxValueError.nodeMessage.test(c)?new e.NonceMaxValueError({cause:o,nonce:a==null?void 0:a.nonce}):e.InsufficientFundsError.nodeMessage.test(c)?new e.InsufficientFundsError({cause:o}):e.IntrinsicGasTooHighError.nodeMessage.test(c)?new e.IntrinsicGasTooHighError({cause:o,gas:a==null?void 0:a.gas}):e.IntrinsicGasTooLowError.nodeMessage.test(c)?new e.IntrinsicGasTooLowError({cause:o,gas:a==null?void 0:a.gas}):e.TransactionTypeNotSupportedError.nodeMessage.test(c)?new e.TransactionTypeNotSupportedError({cause:o}):e.TipAboveFeeCapError.nodeMessage.test(c)?new e.TipAboveFeeCapError({cause:o,maxFeePerGas:a==null?void 0:a.maxFeePerGas,maxPriorityFeePerGas:a==null?void 0:a.maxPriorityFeePerGas}):new e.UnknownNodeError({cause:o})}return Pw}var XL;function FQ(){if(XL)return m_;XL=1,Object.defineProperty(m_,"__esModule",{value:!0}),m_.getEstimateGasError=n;const t=UQ(),e=nl(),r=S2();function n(i,{docsPath:s,...o}){const a=(()=>{const c=(0,r.getNodeError)(i,o);return c instanceof e.UnknownNodeError?i:c})();return new t.EstimateGasExecutionError(a,{docsPath:s,...o})}return m_}var w_={},eU;function _1(){if(eU)return w_;eU=1,Object.defineProperty(w_,"__esModule",{value:!0}),w_.extract=t;function t(e,{format:r}){if(!r)return{};const n={};function i(o){const a=Object.keys(o);for(const c of a)c in e&&(n[c]=e[c]),o[c]&&typeof o[c]=="object"&&!Array.isArray(o[c])&&i(o[c])}const s=r(e||{});return i(s),n}return w_}var vT={},b_={},tU;function T2(){if(tU)return b_;tU=1,Object.defineProperty(b_,"__esModule",{value:!0}),b_.defineFormatter=t;function t(e,r){return({exclude:n,format:i})=>({exclude:n,format:s=>{const o=r(s);if(n)for(const a of n)delete o[a];return{...o,...i(s)}},type:e})}return b_}var rU;function il(){return rU||(rU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.defineTransactionRequest=t.rpcTransactionType=void 0,t.formatTransactionRequest=n;const e=ze(),r=T2();t.rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function n(s){const o={};return typeof s.authorizationList<"u"&&(o.authorizationList=i(s.authorizationList)),typeof s.accessList<"u"&&(o.accessList=s.accessList),typeof s.blobVersionedHashes<"u"&&(o.blobVersionedHashes=s.blobVersionedHashes),typeof s.blobs<"u"&&(typeof s.blobs[0]!="string"?o.blobs=s.blobs.map(a=>(0,e.bytesToHex)(a)):o.blobs=s.blobs),typeof s.data<"u"&&(o.data=s.data),typeof s.from<"u"&&(o.from=s.from),typeof s.gas<"u"&&(o.gas=(0,e.numberToHex)(s.gas)),typeof s.gasPrice<"u"&&(o.gasPrice=(0,e.numberToHex)(s.gasPrice)),typeof s.maxFeePerBlobGas<"u"&&(o.maxFeePerBlobGas=(0,e.numberToHex)(s.maxFeePerBlobGas)),typeof s.maxFeePerGas<"u"&&(o.maxFeePerGas=(0,e.numberToHex)(s.maxFeePerGas)),typeof s.maxPriorityFeePerGas<"u"&&(o.maxPriorityFeePerGas=(0,e.numberToHex)(s.maxPriorityFeePerGas)),typeof s.nonce<"u"&&(o.nonce=(0,e.numberToHex)(s.nonce)),typeof s.to<"u"&&(o.to=s.to),typeof s.type<"u"&&(o.type=t.rpcTransactionType[s.type]),typeof s.value<"u"&&(o.value=(0,e.numberToHex)(s.value)),o}t.defineTransactionRequest=(0,r.defineFormatter)("transactionRequest",n);function i(s){return s.map(o=>({address:o.address,r:o.r?(0,e.numberToHex)(BigInt(o.r)):o.r,s:o.s?(0,e.numberToHex)(BigInt(o.s)):o.s,chainId:(0,e.numberToHex)(o.chainId),nonce:(0,e.numberToHex)(o.nonce),...typeof o.yParity<"u"?{yParity:(0,e.numberToHex)(o.yParity)}:{},...typeof o.v<"u"&&typeof o.yParity>"u"?{v:(0,e.numberToHex)(o.v)}:{}}))}}(vT)),vT}var A0={},nU;function vO(){if(nU)return A0;nU=1,Object.defineProperty(A0,"__esModule",{value:!0}),A0.serializeStateMapping=s,A0.serializeAccountStateOverride=o,A0.serializeStateOverride=a;const t=la(),e=ZA(),r=wO(),n=is(),i=ze();function s(c){if(!(!c||c.length===0))return c.reduce((u,{slot:l,value:d})=>{if(l.length!==66)throw new e.InvalidBytesLengthError({size:l.length,targetSize:66,type:"hex"});if(d.length!==66)throw new e.InvalidBytesLengthError({size:d.length,targetSize:66,type:"hex"});return u[l]=d,u},{})}function o(c){const{balance:u,nonce:l,state:d,stateDiff:h,code:f}=c,g={};if(f!==void 0&&(g.code=f),u!==void 0&&(g.balance=(0,i.numberToHex)(u)),l!==void 0&&(g.nonce=(0,i.numberToHex)(l)),d!==void 0&&(g.state=s(d)),h!==void 0){if(g.state)throw new r.StateAssignmentConflictError;g.stateDiff=s(h)}return g}function a(c){if(!c)return;const u={};for(const{address:l,...d}of c){if(!(0,n.isAddress)(l,{strict:!1}))throw new t.InvalidAddressError({address:l});if(u[l])throw new r.AccountStateConflictError({address:l});u[l]=o(d)}return u}return A0}var y_={},Q={},iU;function _O(){return iU||(iU=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.minInt144=Q.minInt136=Q.minInt128=Q.minInt120=Q.minInt112=Q.minInt104=Q.minInt96=Q.minInt88=Q.minInt80=Q.minInt72=Q.minInt64=Q.minInt56=Q.minInt48=Q.minInt40=Q.minInt32=Q.minInt24=Q.minInt16=Q.minInt8=Q.maxInt256=Q.maxInt248=Q.maxInt240=Q.maxInt232=Q.maxInt224=Q.maxInt216=Q.maxInt208=Q.maxInt200=Q.maxInt192=Q.maxInt184=Q.maxInt176=Q.maxInt168=Q.maxInt160=Q.maxInt152=Q.maxInt144=Q.maxInt136=Q.maxInt128=Q.maxInt120=Q.maxInt112=Q.maxInt104=Q.maxInt96=Q.maxInt88=Q.maxInt80=Q.maxInt72=Q.maxInt64=Q.maxInt56=Q.maxInt48=Q.maxInt40=Q.maxInt32=Q.maxInt24=Q.maxInt16=Q.maxInt8=void 0,Q.maxUint256=Q.maxUint248=Q.maxUint240=Q.maxUint232=Q.maxUint224=Q.maxUint216=Q.maxUint208=Q.maxUint200=Q.maxUint192=Q.maxUint184=Q.maxUint176=Q.maxUint168=Q.maxUint160=Q.maxUint152=Q.maxUint144=Q.maxUint136=Q.maxUint128=Q.maxUint120=Q.maxUint112=Q.maxUint104=Q.maxUint96=Q.maxUint88=Q.maxUint80=Q.maxUint72=Q.maxUint64=Q.maxUint56=Q.maxUint48=Q.maxUint40=Q.maxUint32=Q.maxUint24=Q.maxUint16=Q.maxUint8=Q.minInt256=Q.minInt248=Q.minInt240=Q.minInt232=Q.minInt224=Q.minInt216=Q.minInt208=Q.minInt200=Q.minInt192=Q.minInt184=Q.minInt176=Q.minInt168=Q.minInt160=Q.minInt152=void 0,Q.maxInt8=2n**(8n-1n)-1n,Q.maxInt16=2n**(16n-1n)-1n,Q.maxInt24=2n**(24n-1n)-1n,Q.maxInt32=2n**(32n-1n)-1n,Q.maxInt40=2n**(40n-1n)-1n,Q.maxInt48=2n**(48n-1n)-1n,Q.maxInt56=2n**(56n-1n)-1n,Q.maxInt64=2n**(64n-1n)-1n,Q.maxInt72=2n**(72n-1n)-1n,Q.maxInt80=2n**(80n-1n)-1n,Q.maxInt88=2n**(88n-1n)-1n,Q.maxInt96=2n**(96n-1n)-1n,Q.maxInt104=2n**(104n-1n)-1n,Q.maxInt112=2n**(112n-1n)-1n,Q.maxInt120=2n**(120n-1n)-1n,Q.maxInt128=2n**(128n-1n)-1n,Q.maxInt136=2n**(136n-1n)-1n,Q.maxInt144=2n**(144n-1n)-1n,Q.maxInt152=2n**(152n-1n)-1n,Q.maxInt160=2n**(160n-1n)-1n,Q.maxInt168=2n**(168n-1n)-1n,Q.maxInt176=2n**(176n-1n)-1n,Q.maxInt184=2n**(184n-1n)-1n,Q.maxInt192=2n**(192n-1n)-1n,Q.maxInt200=2n**(200n-1n)-1n,Q.maxInt208=2n**(208n-1n)-1n,Q.maxInt216=2n**(216n-1n)-1n,Q.maxInt224=2n**(224n-1n)-1n,Q.maxInt232=2n**(232n-1n)-1n,Q.maxInt240=2n**(240n-1n)-1n,Q.maxInt248=2n**(248n-1n)-1n,Q.maxInt256=2n**(256n-1n)-1n,Q.minInt8=-(2n**(8n-1n)),Q.minInt16=-(2n**(16n-1n)),Q.minInt24=-(2n**(24n-1n)),Q.minInt32=-(2n**(32n-1n)),Q.minInt40=-(2n**(40n-1n)),Q.minInt48=-(2n**(48n-1n)),Q.minInt56=-(2n**(56n-1n)),Q.minInt64=-(2n**(64n-1n)),Q.minInt72=-(2n**(72n-1n)),Q.minInt80=-(2n**(80n-1n)),Q.minInt88=-(2n**(88n-1n)),Q.minInt96=-(2n**(96n-1n)),Q.minInt104=-(2n**(104n-1n)),Q.minInt112=-(2n**(112n-1n)),Q.minInt120=-(2n**(120n-1n)),Q.minInt128=-(2n**(128n-1n)),Q.minInt136=-(2n**(136n-1n)),Q.minInt144=-(2n**(144n-1n)),Q.minInt152=-(2n**(152n-1n)),Q.minInt160=-(2n**(160n-1n)),Q.minInt168=-(2n**(168n-1n)),Q.minInt176=-(2n**(176n-1n)),Q.minInt184=-(2n**(184n-1n)),Q.minInt192=-(2n**(192n-1n)),Q.minInt200=-(2n**(200n-1n)),Q.minInt208=-(2n**(208n-1n)),Q.minInt216=-(2n**(216n-1n)),Q.minInt224=-(2n**(224n-1n)),Q.minInt232=-(2n**(232n-1n)),Q.minInt240=-(2n**(240n-1n)),Q.minInt248=-(2n**(248n-1n)),Q.minInt256=-(2n**(256n-1n)),Q.maxUint8=2n**8n-1n,Q.maxUint16=2n**16n-1n,Q.maxUint24=2n**24n-1n,Q.maxUint32=2n**32n-1n,Q.maxUint40=2n**40n-1n,Q.maxUint48=2n**48n-1n,Q.maxUint56=2n**56n-1n,Q.maxUint64=2n**64n-1n,Q.maxUint72=2n**72n-1n,Q.maxUint80=2n**80n-1n,Q.maxUint88=2n**88n-1n,Q.maxUint96=2n**96n-1n,Q.maxUint104=2n**104n-1n,Q.maxUint112=2n**112n-1n,Q.maxUint120=2n**120n-1n,Q.maxUint128=2n**128n-1n,Q.maxUint136=2n**136n-1n,Q.maxUint144=2n**144n-1n,Q.maxUint152=2n**152n-1n,Q.maxUint160=2n**160n-1n,Q.maxUint168=2n**168n-1n,Q.maxUint176=2n**176n-1n,Q.maxUint184=2n**184n-1n,Q.maxUint192=2n**192n-1n,Q.maxUint200=2n**200n-1n,Q.maxUint208=2n**208n-1n,Q.maxUint216=2n**216n-1n,Q.maxUint224=2n**224n-1n,Q.maxUint232=2n**232n-1n,Q.maxUint240=2n**240n-1n,Q.maxUint248=2n**248n-1n,Q.maxUint256=2n**256n-1n),Q}var sU;function sl(){if(sU)return y_;sU=1,Object.defineProperty(y_,"__esModule",{value:!0}),y_.assertRequest=o;const t=sn(),e=_O(),r=la(),n=nl(),i=Ds(),s=is();function o(a){const{account:c,gasPrice:u,maxFeePerGas:l,maxPriorityFeePerGas:d,to:h}=a,f=c?(0,t.parseAccount)(c):void 0;if(f&&!(0,s.isAddress)(f.address))throw new r.InvalidAddressError({address:f.address});if(h&&!(0,s.isAddress)(h))throw new r.InvalidAddressError({address:h});if(typeof u<"u"&&(typeof l<"u"||typeof d<"u"))throw new i.FeeConflictError;if(l&&l>e.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:l});if(d&&l&&d>l)throw new n.TipAboveFeeCapError({maxFeePerGas:l,maxPriorityFeePerGas:d})}return y_}var _T={},Ow={},Fc={},oU;function ix(){if(oU)return Fc;oU=1,Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.MaxFeePerGasTooLowError=Fc.Eip1559FeesNotSupportedError=Fc.BaseFeeScalarError=void 0;const t=Fp(),e=_t();class r extends e.BaseError{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}Fc.BaseFeeScalarError=r;class n extends e.BaseError{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}Fc.Eip1559FeesNotSupportedError=n;class i extends e.BaseError{constructor({maxPriorityFeePerGas:o}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${(0,t.formatGwei)(o)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}return Fc.MaxFeePerGasTooLowError=i,Fc}var Rw={},v_={},kw={},aU;function EO(){if(aU)return kw;aU=1,Object.defineProperty(kw,"__esModule",{value:!0}),kw.BlockNotFoundError=void 0;const t=_t();class e extends t.BaseError{constructor({blockHash:n,blockNumber:i}){let s="Block";n&&(s=`Block at hash "${n}"`),i&&(s=`Block at number "${i}"`),super(`${s} could not be found.`,{name:"BlockNotFoundError"})}}return kw.BlockNotFoundError=e,kw}var x0={},ET={},cU;function I2(){return cU||(cU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.defineTransaction=t.transactionType=void 0,t.formatTransaction=n;const e=nn(),r=T2();t.transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function n(s){const o={...s,blockHash:s.blockHash?s.blockHash:null,blockNumber:s.blockNumber?BigInt(s.blockNumber):null,chainId:s.chainId?(0,e.hexToNumber)(s.chainId):void 0,gas:s.gas?BigInt(s.gas):void 0,gasPrice:s.gasPrice?BigInt(s.gasPrice):void 0,maxFeePerBlobGas:s.maxFeePerBlobGas?BigInt(s.maxFeePerBlobGas):void 0,maxFeePerGas:s.maxFeePerGas?BigInt(s.maxFeePerGas):void 0,maxPriorityFeePerGas:s.maxPriorityFeePerGas?BigInt(s.maxPriorityFeePerGas):void 0,nonce:s.nonce?(0,e.hexToNumber)(s.nonce):void 0,to:s.to?s.to:null,transactionIndex:s.transactionIndex?Number(s.transactionIndex):null,type:s.type?t.transactionType[s.type]:void 0,typeHex:s.type?s.type:void 0,value:s.value?BigInt(s.value):void 0,v:s.v?BigInt(s.v):void 0};return s.authorizationList&&(o.authorizationList=i(s.authorizationList)),o.yParity=(()=>{if(s.yParity)return Number(s.yParity);if(typeof o.v=="bigint"){if(o.v===0n||o.v===27n)return 0;if(o.v===1n||o.v===28n)return 1;if(o.v>=35n)return o.v%2n===0n?1:0}})(),o.type==="legacy"&&(delete o.accessList,delete o.maxFeePerBlobGas,delete o.maxFeePerGas,delete o.maxPriorityFeePerGas,delete o.yParity),o.type==="eip2930"&&(delete o.maxFeePerBlobGas,delete o.maxFeePerGas,delete o.maxPriorityFeePerGas),o.type==="eip1559"&&delete o.maxFeePerBlobGas,o}t.defineTransaction=(0,r.defineFormatter)("transaction",n);function i(s){return s.map(o=>({address:o.address,chainId:Number(o.chainId),nonce:Number(o.nonce),r:o.r,s:o.s,yParity:Number(o.yParity)}))}}(ET)),ET}var uU;function sx(){if(uU)return x0;uU=1,Object.defineProperty(x0,"__esModule",{value:!0}),x0.defineBlock=void 0,x0.formatBlock=r;const t=T2(),e=I2();function r(n){const i=(n.transactions??[]).map(s=>typeof s=="string"?s:(0,e.formatTransaction)(s));return{...n,baseFeePerGas:n.baseFeePerGas?BigInt(n.baseFeePerGas):null,blobGasUsed:n.blobGasUsed?BigInt(n.blobGasUsed):void 0,difficulty:n.difficulty?BigInt(n.difficulty):void 0,excessBlobGas:n.excessBlobGas?BigInt(n.excessBlobGas):void 0,gasLimit:n.gasLimit?BigInt(n.gasLimit):void 0,gasUsed:n.gasUsed?BigInt(n.gasUsed):void 0,hash:n.hash?n.hash:null,logsBloom:n.logsBloom?n.logsBloom:null,nonce:n.nonce?n.nonce:null,number:n.number?BigInt(n.number):null,size:n.size?BigInt(n.size):void 0,timestamp:n.timestamp?BigInt(n.timestamp):void 0,transactions:i,totalDifficulty:n.totalDifficulty?BigInt(n.totalDifficulty):null}}return x0.defineBlock=(0,t.defineFormatter)("block",r),x0}var lU;function E1(){if(lU)return v_;lU=1,Object.defineProperty(v_,"__esModule",{value:!0}),v_.getBlock=n;const t=EO(),e=ze(),r=sx();async function n(i,{blockHash:s,blockNumber:o,blockTag:a,includeTransactions:c}={}){var g,p,m;const u=a??"latest",l=c??!1,d=o!==void 0?(0,e.numberToHex)(o):void 0;let h=null;if(s?h=await i.request({method:"eth_getBlockByHash",params:[s,l]},{dedupe:!0}):h=await i.request({method:"eth_getBlockByNumber",params:[d||u,l]},{dedupe:!!d}),!h)throw new t.BlockNotFoundError({blockHash:s,blockNumber:o});return(((m=(p=(g=i.chain)==null?void 0:g.formatters)==null?void 0:p.block)==null?void 0:m.format)||r.formatBlock)(h)}return v_}var __={},dU;function CO(){if(dU)return __;dU=1,Object.defineProperty(__,"__esModule",{value:!0}),__.getGasPrice=t;async function t(e){const r=await e.request({method:"eth_gasPrice"});return BigInt(r)}return __}var hU;function HQ(){if(hU)return Rw;hU=1,Object.defineProperty(Rw,"__esModule",{value:!0}),Rw.estimateMaxPriorityFeePerGas=s,Rw.internal_estimateMaxPriorityFeePerGas=o;const t=ix(),e=nn(),r=ur(),n=E1(),i=CO();async function s(a,c){return o(a,c)}async function o(a,c){var h,f;const{block:u,chain:l=a.chain,request:d}=c||{};try{const g=((h=l==null?void 0:l.fees)==null?void 0:h.maxPriorityFeePerGas)??((f=l==null?void 0:l.fees)==null?void 0:f.defaultPriorityFee);if(typeof g=="function"){const m=u||await(0,r.getAction)(a,n.getBlock,"getBlock")({}),b=await g({block:m,client:a,request:d});if(b===null)throw new Error;return b}if(typeof g<"u")return g;const p=await a.request({method:"eth_maxPriorityFeePerGas"});return(0,e.hexToBigInt)(p)}catch{const[g,p]=await Promise.all([u?Promise.resolve(u):(0,r.getAction)(a,n.getBlock,"getBlock")({}),(0,r.getAction)(a,i.getGasPrice,"getGasPrice")({})]);if(typeof g.baseFeePerGas!="bigint")throw new t.Eip1559FeesNotSupportedError;const m=p-g.baseFeePerGas;return m<0n?0n:m}}return Rw}var fU;function qQ(){if(fU)return Ow;fU=1,Object.defineProperty(Ow,"__esModule",{value:!0}),Ow.estimateFeesPerGas=s,Ow.internal_estimateFeesPerGas=o;const t=ix(),e=ur(),r=HQ(),n=E1(),i=CO();async function s(a,c){return o(a,c)}async function o(a,c){var E,w;const{block:u,chain:l=a.chain,request:d,type:h="eip1559"}=c||{},f=await(async()=>{var C,y;return typeof((C=l==null?void 0:l.fees)==null?void 0:C.baseFeeMultiplier)=="function"?l.fees.baseFeeMultiplier({block:u,client:a,request:d}):((y=l==null?void 0:l.fees)==null?void 0:y.baseFeeMultiplier)??1.2})();if(f<1)throw new t.BaseFeeScalarError;const p=10**(((E=f.toString().split(".")[1])==null?void 0:E.length)??0),m=C=>C*BigInt(Math.ceil(f*p))/BigInt(p),b=u||await(0,e.getAction)(a,n.getBlock,"getBlock")({});if(typeof((w=l==null?void 0:l.fees)==null?void 0:w.estimateFeesPerGas)=="function"){const C=await l.fees.estimateFeesPerGas({block:u,client:a,multiply:m,request:d,type:h});if(C!==null)return C}if(h==="eip1559"){if(typeof b.baseFeePerGas!="bigint")throw new t.Eip1559FeesNotSupportedError;const C=typeof(d==null?void 0:d.maxPriorityFeePerGas)=="bigint"?d.maxPriorityFeePerGas:await(0,r.internal_estimateMaxPriorityFeePerGas)(a,{block:b,chain:l,request:d}),y=m(b.baseFeePerGas);return{maxFeePerGas:(d==null?void 0:d.maxFeePerGas)??y+C,maxPriorityFeePerGas:C}}return{gasPrice:(d==null?void 0:d.gasPrice)??m(await(0,e.getAction)(a,i.getGasPrice,"getGasPrice")({}))}}return Ow}var E_={},pU;function ox(){if(pU)return E_;pU=1,Object.defineProperty(E_,"__esModule",{value:!0}),E_.getTransactionCount=r;const t=nn(),e=ze();async function r(n,{address:i,blockTag:s="latest",blockNumber:o}){const a=await n.request({method:"eth_getTransactionCount",params:[i,typeof o=="bigint"?(0,e.numberToHex)(o):s]},{dedupe:!!o});return(0,t.hexToNumber)(a)}return E_}var C_={},gU;function ax(){if(gU)return C_;gU=1,Object.defineProperty(C_,"__esModule",{value:!0}),C_.blobsToCommitments=r;const t=Tr(),e=ze();function r(n){const{kzg:i}=n,s=n.to??(typeof n.blobs[0]=="string"?"hex":"bytes"),o=typeof n.blobs[0]=="string"?n.blobs.map(c=>(0,t.hexToBytes)(c)):n.blobs,a=[];for(const c of o)a.push(Uint8Array.from(i.blobToKzgCommitment(c)));return s==="bytes"?a:a.map(c=>(0,e.bytesToHex)(c))}return C_}var A_={},mU;function cx(){if(mU)return A_;mU=1,Object.defineProperty(A_,"__esModule",{value:!0}),A_.blobsToProofs=r;const t=Tr(),e=ze();function r(n){const{kzg:i}=n,s=n.to??(typeof n.blobs[0]=="string"?"hex":"bytes"),o=typeof n.blobs[0]=="string"?n.blobs.map(u=>(0,t.hexToBytes)(u)):n.blobs,a=typeof n.commitments[0]=="string"?n.commitments.map(u=>(0,t.hexToBytes)(u)):n.commitments,c=[];for(let u=0;u<o.length;u++){const l=o[u],d=a[u];c.push(Uint8Array.from(i.computeBlobKzgProof(l,d)))}return s==="bytes"?c:c.map(u=>(0,e.bytesToHex)(u))}return A_}var x_={},S_={},T_={},Eo={},wU;function zQ(){if(wU)return Eo;wU=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.sha224=Eo.SHA224=Eo.sha256=Eo.SHA256=void 0;const t=DQ();return Eo.SHA256=t.SHA256,Eo.sha256=t.sha256,Eo.SHA224=t.SHA224,Eo.sha224=t.sha224,Eo}var bU;function AO(){if(bU)return T_;bU=1,Object.defineProperty(T_,"__esModule",{value:!0}),T_.sha256=i;const t=zQ(),e=ki(),r=Tr(),n=ze();function i(s,o){const a=o||"hex",c=(0,t.sha256)((0,e.isHex)(s,{strict:!1})?(0,r.toBytes)(s):s);return a==="bytes"?c:(0,n.toHex)(c)}return T_}var yU;function xO(){if(yU)return S_;yU=1,Object.defineProperty(S_,"__esModule",{value:!0}),S_.commitmentToVersionedHash=r;const t=ze(),e=AO();function r(n){const{commitment:i,version:s=1}=n,o=n.to??(typeof i=="string"?"hex":"bytes"),a=(0,e.sha256)(i,"bytes");return a.set([s],0),o==="bytes"?a:(0,t.bytesToHex)(a)}return S_}var vU;function SO(){if(vU)return x_;vU=1,Object.defineProperty(x_,"__esModule",{value:!0}),x_.commitmentsToVersionedHashes=e;const t=xO();function e(r){const{commitments:n,version:i}=r,s=r.to??(typeof n[0]=="string"?"hex":"bytes"),o=[];for(const a of n)o.push((0,t.commitmentToVersionedHash)({commitment:a,to:s,version:i}));return o}return x_}var I_={},P_={},CT={},_U;function mIe(){return _U||(_U=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.maxBytesPerTransaction=t.bytesPerBlob=t.fieldElementsPerBlob=t.bytesPerFieldElement=void 0;const e=6;t.bytesPerFieldElement=32,t.fieldElementsPerBlob=4096,t.bytesPerBlob=t.bytesPerFieldElement*t.fieldElementsPerBlob,t.maxBytesPerTransaction=t.bytesPerBlob*e-1-1*t.fieldElementsPerBlob*e}(CT)),CT}var Co={},Nw={},EU;function WQ(){return EU||(EU=1,Object.defineProperty(Nw,"__esModule",{value:!0}),Nw.versionedHashVersionKzg=void 0,Nw.versionedHashVersionKzg=1),Nw}var CU;function VQ(){if(CU)return Co;CU=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.InvalidVersionedHashVersionError=Co.InvalidVersionedHashSizeError=Co.EmptyBlobError=Co.BlobSizeTooLargeError=void 0;const t=WQ(),e=_t();class r extends e.BaseError{constructor({maxSize:a,size:c}){super("Blob size is too large.",{metaMessages:[`Max: ${a} bytes`,`Given: ${c} bytes`],name:"BlobSizeTooLargeError"})}}Co.BlobSizeTooLargeError=r;class n extends e.BaseError{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}Co.EmptyBlobError=n;class i extends e.BaseError{constructor({hash:a,size:c}){super(`Versioned hash "${a}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${c}`],name:"InvalidVersionedHashSizeError"})}}Co.InvalidVersionedHashSizeError=i;class s extends e.BaseError{constructor({hash:a,version:c}){super(`Versioned hash "${a}" version is invalid.`,{metaMessages:[`Expected: ${t.versionedHashVersionKzg}`,`Received: ${c}`],name:"InvalidVersionedHashVersionError"})}}return Co.InvalidVersionedHashVersionError=s,Co}var AU;function GQ(){if(AU)return P_;AU=1,Object.defineProperty(P_,"__esModule",{value:!0}),P_.toBlobs=o;const t=mIe(),e=VQ(),r=v2(),n=rs(),i=Tr(),s=ze();function o(a){const c=a.to??(typeof a.data=="string"?"hex":"bytes"),u=typeof a.data=="string"?(0,i.hexToBytes)(a.data):a.data,l=(0,n.size)(u);if(!l)throw new e.EmptyBlobError;if(l>t.maxBytesPerTransaction)throw new e.BlobSizeTooLargeError({maxSize:t.maxBytesPerTransaction,size:l});const d=[];let h=!0,f=0;for(;h;){const g=(0,r.createCursor)(new Uint8Array(t.bytesPerBlob));let p=0;for(;p<t.fieldElementsPerBlob;){const m=u.slice(f,f+(t.bytesPerFieldElement-1));if(g.pushByte(0),g.pushBytes(m),m.length<31){g.pushByte(128),h=!1;break}p++,f+=31}d.push(g)}return c==="bytes"?d.map(g=>g.bytes):d.map(g=>(0,s.bytesToHex)(g.bytes))}return P_}var xU;function ux(){if(xU)return I_;xU=1,Object.defineProperty(I_,"__esModule",{value:!0}),I_.toBlobSidecars=n;const t=ax(),e=cx(),r=GQ();function n(i){const{data:s,kzg:o,to:a}=i,c=i.blobs??(0,r.toBlobs)({data:s,to:a}),u=i.commitments??(0,t.blobsToCommitments)({blobs:c,kzg:o,to:a}),l=i.proofs??(0,e.blobsToProofs)({blobs:c,commitments:u,kzg:o,to:a}),d=[];for(let h=0;h<c.length;h++)d.push({blob:c[h],commitment:u[h],proof:l[h]});return d}return I_}var O_={},SU;function lx(){if(SU)return O_;SU=1,Object.defineProperty(O_,"__esModule",{value:!0}),O_.getTransactionType=e;const t=Ds();function e(r){if(r.type)return r.type;if(typeof r.authorizationList<"u")return"eip7702";if(typeof r.blobs<"u"||typeof r.blobVersionedHashes<"u"||typeof r.maxFeePerBlobGas<"u"||typeof r.sidecars<"u")return"eip4844";if(typeof r.maxFeePerGas<"u"||typeof r.maxPriorityFeePerGas<"u")return"eip1559";if(typeof r.gasPrice<"u")return typeof r.accessList<"u"?"eip2930":"legacy";throw new t.InvalidSerializableTransactionError({transaction:r})}return O_}var R_={},TU;function C1(){if(TU)return R_;TU=1,Object.defineProperty(R_,"__esModule",{value:!0}),R_.getChainId=e;const t=nn();async function e(r){const n=await r.request({method:"eth_chainId"},{dedupe:!0});return(0,t.hexToNumber)(n)}return R_}var IU;function dx(){return IU||(IU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.eip1559NetworkCache=t.defaultParameters=void 0,t.prepareTransactionRequest=p;const e=sn(),r=qQ(),n=TO(),i=E1(),s=ox(),o=ix(),a=ax(),c=cx(),u=SO(),l=ux(),d=ur(),h=sl(),f=lx(),g=C1();t.defaultParameters=["blobVersionedHashes","chainId","fees","gas","nonce","type"],t.eip1559NetworkCache=new Map;async function p(m,b){const{account:v=m.account,blobs:E,chain:w,gas:C,kzg:y,nonce:_,nonceManager:x,parameters:A=t.defaultParameters,type:T}=b,O=v&&(0,e.parseAccount)(v),k={...b,...O?{from:O==null?void 0:O.address}:{}};let j;async function N(){return j||(j=await(0,d.getAction)(m,i.getBlock,"getBlock")({blockTag:"latest"}),j)}let S;async function P(){return S||(w?w.id:typeof b.chainId<"u"?b.chainId:(S=await(0,d.getAction)(m,g.getChainId,"getChainId")({}),S))}if(A.includes("nonce")&&typeof _>"u"&&O)if(x){const I=await P();k.nonce=await x.consume({address:O.address,chainId:I,client:m})}else k.nonce=await(0,d.getAction)(m,s.getTransactionCount,"getTransactionCount")({address:O.address,blockTag:"pending"});if((A.includes("blobVersionedHashes")||A.includes("sidecars"))&&E&&y){const I=(0,a.blobsToCommitments)({blobs:E,kzg:y});if(A.includes("blobVersionedHashes")){const B=(0,u.commitmentsToVersionedHashes)({commitments:I,to:"hex"});k.blobVersionedHashes=B}if(A.includes("sidecars")){const B=(0,c.blobsToProofs)({blobs:E,commitments:I,kzg:y}),$=(0,l.toBlobSidecars)({blobs:E,commitments:I,proofs:B,to:"hex"});k.sidecars=$}}if(A.includes("chainId")&&(k.chainId=await P()),(A.includes("fees")||A.includes("type"))&&typeof T>"u")try{k.type=(0,f.getTransactionType)(k)}catch{let I=t.eip1559NetworkCache.get(m.uid);if(typeof I>"u"){const B=await N();I=typeof(B==null?void 0:B.baseFeePerGas)=="bigint",t.eip1559NetworkCache.set(m.uid,I)}k.type=I?"eip1559":"legacy"}if(A.includes("fees"))if(k.type!=="legacy"&&k.type!=="eip2930"){if(typeof k.maxFeePerGas>"u"||typeof k.maxPriorityFeePerGas>"u"){const I=await N(),{maxFeePerGas:B,maxPriorityFeePerGas:$}=await(0,r.internal_estimateFeesPerGas)(m,{block:I,chain:w,request:k});if(typeof b.maxPriorityFeePerGas>"u"&&b.maxFeePerGas&&b.maxFeePerGas<$)throw new o.MaxFeePerGasTooLowError({maxPriorityFeePerGas:$});k.maxPriorityFeePerGas=$,k.maxFeePerGas=B}}else{if(typeof b.maxFeePerGas<"u"||typeof b.maxPriorityFeePerGas<"u")throw new o.Eip1559FeesNotSupportedError;if(typeof b.gasPrice>"u"){const I=await N(),{gasPrice:B}=await(0,r.internal_estimateFeesPerGas)(m,{block:I,chain:w,request:k,type:"legacy"});k.gasPrice=B}}return A.includes("gas")&&typeof C>"u"&&(k.gas=await(0,d.getAction)(m,n.estimateGas,"estimateGas")({...k,account:O&&{address:O.address,type:"json-rpc"}})),(0,h.assertRequest)(k),delete k.parameters,k}}(_T)),_T}var k_={},PU;function KQ(){if(PU)return k_;PU=1,Object.defineProperty(k_,"__esModule",{value:!0}),k_.getBalance=e;const t=ze();async function e(r,{address:n,blockNumber:i,blockTag:s="latest"}){const o=typeof i=="bigint"?(0,t.numberToHex)(i):void 0,a=await r.request({method:"eth_getBalance",params:[n,o||s]});return BigInt(a)}return k_}var OU;function TO(){if(OU)return l_;OU=1,Object.defineProperty(l_,"__esModule",{value:!0}),l_.estimateGas=d;const t=sn(),e=_t(),r=nx(),n=ze(),i=FQ(),s=_1(),o=il(),a=vO(),c=sl(),u=dx(),l=KQ();async function d(h,f){var b,v,E;const{account:g=h.account}=f,p=g?(0,t.parseAccount)(g):void 0;try{let J=function(ae){const{block:he,request:ie,rpcStateOverride:Ee}=ae;return h.request({method:"eth_estimateGas",params:Ee?[ie,he??"latest",Ee]:he?[ie,he]:[ie]})};var m=J;const{accessList:w,authorizationList:C,blobs:y,blobVersionedHashes:_,blockNumber:x,blockTag:A,data:T,gas:O,gasPrice:k,maxFeePerBlobGas:j,maxFeePerGas:N,maxPriorityFeePerGas:S,nonce:P,value:I,stateOverride:B,...$}=await(0,u.prepareTransactionRequest)(h,{...f,parameters:(p==null?void 0:p.type)==="local"?void 0:["blobVersionedHashes"]}),D=(typeof x=="bigint"?(0,n.numberToHex)(x):void 0)||A,L=(0,a.serializeStateOverride)(B),U=await(async()=>{if($.to)return $.to;if(C&&C.length>0)return await(0,r.recoverAuthorizationAddress)({authorization:C[0]}).catch(()=>{throw new e.BaseError("`to` is required. Could not infer from `authorizationList`")})})();(0,c.assertRequest)(f);const z=(E=(v=(b=h.chain)==null?void 0:b.formatters)==null?void 0:v.transactionRequest)==null?void 0:E.format,K=(z||o.formatTransactionRequest)({...(0,s.extract)($,{format:z}),from:p==null?void 0:p.address,accessList:w,authorizationList:C,blobs:y,blobVersionedHashes:_,data:T,gas:O,gasPrice:k,maxFeePerBlobGas:j,maxFeePerGas:N,maxPriorityFeePerGas:S,nonce:P,to:U,value:I});let ne=BigInt(await J({block:D,request:K,rpcStateOverride:L}));if(C){const ae=await(0,l.getBalance)(h,{address:K.from}),he=await Promise.all(C.map(async ie=>{const{address:Ee}=ie,pe=await J({block:D,request:{authorizationList:void 0,data:T,from:p==null?void 0:p.address,to:Ee,value:(0,n.numberToHex)(ae)},rpcStateOverride:L}).catch(()=>100000n);return 2n*BigInt(pe)}));ne+=he.reduce((ie,Ee)=>ie+Ee,0n)}return ne}catch(w){throw(0,i.getEstimateGasError)(w,{...f,account:p,chain:h.chain})}}return l_}var RU;function ZQ(){if(RU)return Q3;RU=1,Object.defineProperty(Q3,"__esModule",{value:!0}),Q3.estimateContractGas=s;const t=sn(),e=Bs(),r=eh(),n=ur(),i=TO();async function s(o,a){const{abi:c,address:u,args:l,functionName:d,dataSuffix:h,...f}=a,g=(0,e.encodeFunctionData)({abi:c,args:l,functionName:d});try{return await(0,n.getAction)(o,i.estimateGas,"estimateGas")({data:`${g}${h?h.replace("0x",""):""}`,to:u,...f})}catch(p){const m=f.account?(0,t.parseAccount)(f.account):void 0;throw(0,r.getContractError)(p,{abi:c,address:u,args:l,docsPath:"/docs/contract/estimateContractGas",functionName:d,sender:m==null?void 0:m.address})}}return Q3}var N_={},$_={},j_={},B_={},kU;function fa(){if(kU)return B_;kU=1,Object.defineProperty(B_,"__esModule",{value:!0}),B_.isAddressEqual=r;const t=la(),e=is();function r(n,i){if(!(0,e.isAddress)(n,{strict:!1}))throw new t.InvalidAddressError({address:n});if(!(0,e.isAddress)(i,{strict:!1}))throw new t.InvalidAddressError({address:i});return n.toLowerCase()===i.toLowerCase()}return B_}var D_={},NU;function P2(){if(NU)return D_;NU=1,Object.defineProperty(D_,"__esModule",{value:!0}),D_.decodeEventLog=a;const t=$r(),e=rs(),r=v1(),n=NQ(),i=Jd(),s=el(),o="/docs/contract/decodeEventLog";function a(u){const{abi:l,data:d,strict:h,topics:f}=u,g=h??!0,[p,...m]=f;if(!p)throw new t.AbiEventSignatureEmptyTopicsError({docsPath:o});const b=l.find(x=>x.type==="event"&&p===(0,r.toEventSelector)((0,s.formatAbiItem)(x)));if(!(b&&"name"in b)||b.type!=="event")throw new t.AbiEventSignatureNotFoundError(p,{docsPath:o});const{name:v,inputs:E}=b,w=E==null?void 0:E.some(x=>!("name"in x&&x.name)),C=w?[]:{},y=E.map((x,A)=>[x,A]).filter(([x])=>"indexed"in x&&x.indexed);for(let x=0;x<y.length;x++){const[A,T]=y[x],O=m[x];if(!O)throw new t.DecodeLogTopicsMismatch({abiItem:b,param:A});C[w?T:A.name||T]=c({param:A,value:O})}const _=E.filter(x=>!("indexed"in x&&x.indexed));if(_.length>0){if(d&&d!=="0x")try{const x=(0,i.decodeAbiParameters)(_,d);if(x)if(w)for(let A=0;A<E.length;A++)C[A]=C[A]??x.shift();else for(let A=0;A<_.length;A++)C[_[A].name]=x[A]}catch(x){if(g)throw x instanceof t.AbiDecodingDataSizeTooSmallError||x instanceof n.PositionOutOfBoundsError?new t.DecodeLogDataMismatch({abiItem:b,data:d,params:_,size:(0,e.size)(d)}):x}else if(g)throw new t.DecodeLogDataMismatch({abiItem:b,data:"0x",params:_,size:0})}return{eventName:v,args:Object.values(C).length>0?C:void 0}}function c({param:u,value:l}){return u.type==="string"||u.type==="bytes"||u.type==="tuple"||u.type.match(/^(.*)\[(\d+)?\]$/)?l:((0,i.decodeAbiParameters)([u],l)||[])[0]}return D_}var $U;function O2(){if($U)return j_;$U=1,Object.defineProperty(j_,"__esModule",{value:!0}),j_.parseEventLogs=o;const t=$r(),e=fa(),r=Tr(),n=ns(),i=v1(),s=P2();function o(c){const{abi:u,args:l,logs:d,strict:h=!0}=c,f=(()=>{if(c.eventName)return Array.isArray(c.eventName)?c.eventName:[c.eventName]})();return d.map(g=>{var p;try{const m=u.find(v=>v.type==="event"&&g.topics[0]===(0,i.toEventSelector)(v));if(!m)return null;const b=(0,s.decodeEventLog)({...g,abi:[m],strict:h});return f&&!f.includes(b.eventName)||!a({args:b.args,inputs:m.inputs,matchArgs:l})?null:{...b,...g}}catch(m){let b,v;if(m instanceof t.AbiEventSignatureNotFoundError)return null;if(m instanceof t.DecodeLogDataMismatch||m instanceof t.DecodeLogTopicsMismatch){if(h)return null;b=m.abiItem.name,v=(p=m.abiItem.inputs)==null?void 0:p.some(E=>!("name"in E&&E.name))}return{...g,args:v?[]:{},eventName:b}}}).filter(Boolean)}function a(c){const{args:u,inputs:l,matchArgs:d}=c;if(!d)return!0;if(!u)return!1;function h(f,g,p){try{return f.type==="address"?(0,e.isAddressEqual)(g,p):f.type==="string"||f.type==="bytes"?(0,n.keccak256)((0,r.toBytes)(g))===p:g===p}catch{return!1}}return Array.isArray(u)&&Array.isArray(d)?d.every((f,g)=>{if(f==null)return!0;const p=l[g];return p?(Array.isArray(f)?f:[f]).some(b=>h(p,b,u[g])):!1}):typeof u=="object"&&!Array.isArray(u)&&typeof d=="object"&&!Array.isArray(d)?Object.entries(d).every(([f,g])=>{if(g==null)return!0;const p=l.find(b=>b.name===f);return p?(Array.isArray(g)?g:[g]).some(b=>h(p,b,u[f])):!1}):!1}return j_}var M_={},jU;function ol(){if(jU)return M_;jU=1,Object.defineProperty(M_,"__esModule",{value:!0}),M_.formatLog=t;function t(e,{args:r,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:r,eventName:n}:{}}}return M_}var BU;function IO(){if(BU)return $_;BU=1,Object.defineProperty($_,"__esModule",{value:!0}),$_.getLogs=i;const t=Up(),e=O2(),r=ze(),n=ol();async function i(s,{address:o,blockHash:a,fromBlock:c,toBlock:u,event:l,events:d,args:h,strict:f}={}){const g=f??!1,p=d??(l?[l]:void 0);let m=[];p&&(m=[p.flatMap(w=>(0,t.encodeEventTopics)({abi:[w],eventName:w.name,args:d?void 0:h}))],l&&(m=m[0]));let b;a?b=await s.request({method:"eth_getLogs",params:[{address:o,topics:m,blockHash:a}]}):b=await s.request({method:"eth_getLogs",params:[{address:o,topics:m,fromBlock:typeof c=="bigint"?(0,r.numberToHex)(c):c,toBlock:typeof u=="bigint"?(0,r.numberToHex)(u):u}]});const v=b.map(E=>(0,n.formatLog)(E));return p?(0,e.parseEventLogs)({abi:p,args:h,logs:v,strict:g}):v}return $_}var DU;function PO(){if(DU)return N_;DU=1,Object.defineProperty(N_,"__esModule",{value:!0}),N_.getContractEvents=n;const t=rl(),e=ur(),r=IO();async function n(i,s){const{abi:o,address:a,args:c,blockHash:u,eventName:l,fromBlock:d,toBlock:h,strict:f}=s,g=l?(0,t.getAbiItem)({abi:o,name:l}):void 0,p=g?void 0:o.filter(m=>m.type==="event");return(0,e.getAction)(i,r.getLogs,"getLogs")({address:a,args:c,blockHash:u,event:g,events:p,fromBlock:d,toBlock:h,strict:f})}return N_}var L_={},U_={},MU;function al(){if(MU)return U_;MU=1,Object.defineProperty(U_,"__esModule",{value:!0}),U_.decodeFunctionResult=i;const t=$r(),e=Jd(),r=rl(),n="/docs/contract/decodeFunctionResult";function i(s){const{abi:o,args:a,functionName:c,data:u}=s;let l=o[0];if(c){const h=(0,r.getAbiItem)({abi:o,args:a,name:c});if(!h)throw new t.AbiFunctionNotFoundError(c,{docsPath:n});l=h}if(l.type!=="function")throw new t.AbiFunctionNotFoundError(void 0,{docsPath:n});if(!l.outputs)throw new t.AbiFunctionOutputsNotFoundError(l.name,{docsPath:n});const d=(0,e.decodeAbiParameters)(l.outputs,u);if(d&&d.length>1)return d;if(d&&d.length===1)return d[0]}return U_}var $w={},jw={},Ct={},Gt={},LU;function YQ(){if(LU)return Gt;LU=1;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.notImplemented=Gt.bitMask=void 0,Gt.isBytes=n,Gt.abytes=i,Gt.abool=s,Gt.bytesToHex=a,Gt.numberToHexUnpadded=c,Gt.hexToNumber=u,Gt.hexToBytes=h,Gt.bytesToNumberBE=f,Gt.bytesToNumberLE=g,Gt.numberToBytesBE=p,Gt.numberToBytesLE=m,Gt.numberToVarBytesBE=b,Gt.ensureBytes=v,Gt.concatBytes=E,Gt.equalBytes=w,Gt.utf8ToBytes=C,Gt.inRange=_,Gt.aInRange=x,Gt.bitLen=A,Gt.bitGet=T,Gt.bitSet=O,Gt.createHmacDrbg=S,Gt.validateObject=I,Gt.memoized=$;const t=BigInt(0),e=BigInt(1),r=BigInt(2);function n(R){return R instanceof Uint8Array||ArrayBuffer.isView(R)&&R.constructor.name==="Uint8Array"}function i(R){if(!n(R))throw new Error("Uint8Array expected")}function s(R,D){if(typeof D!="boolean")throw new Error(R+" boolean expected, got "+D)}const o=Array.from({length:256},(R,D)=>D.toString(16).padStart(2,"0"));function a(R){i(R);let D="";for(let L=0;L<R.length;L++)D+=o[R[L]];return D}function c(R){const D=R.toString(16);return D.length&1?"0"+D:D}function u(R){if(typeof R!="string")throw new Error("hex string expected, got "+typeof R);return R===""?t:BigInt("0x"+R)}const l={_0:48,_9:57,A:65,F:70,a:97,f:102};function d(R){if(R>=l._0&&R<=l._9)return R-l._0;if(R>=l.A&&R<=l.F)return R-(l.A-10);if(R>=l.a&&R<=l.f)return R-(l.a-10)}function h(R){if(typeof R!="string")throw new Error("hex string expected, got "+typeof R);const D=R.length,L=D/2;if(D%2)throw new Error("hex string expected, got unpadded hex of length "+D);const U=new Uint8Array(L);for(let z=0,W=0;z<L;z++,W+=2){const K=d(R.charCodeAt(W)),J=d(R.charCodeAt(W+1));if(K===void 0||J===void 0){const ne=R[W]+R[W+1];throw new Error('hex string expected, got non-hex character "'+ne+'" at index '+W)}U[z]=K*16+J}return U}function f(R){return u(a(R))}function g(R){return i(R),u(a(Uint8Array.from(R).reverse()))}function p(R,D){return h(R.toString(16).padStart(D*2,"0"))}function m(R,D){return p(R,D).reverse()}function b(R){return h(c(R))}function v(R,D,L){let U;if(typeof D=="string")try{U=h(D)}catch(W){throw new Error(R+" must be hex string or Uint8Array, cause: "+W)}else if(n(D))U=Uint8Array.from(D);else throw new Error(R+" must be hex string or Uint8Array");const z=U.length;if(typeof L=="number"&&z!==L)throw new Error(R+" of length "+L+" expected, got "+z);return U}function E(...R){let D=0;for(let U=0;U<R.length;U++){const z=R[U];i(z),D+=z.length}const L=new Uint8Array(D);for(let U=0,z=0;U<R.length;U++){const W=R[U];L.set(W,z),z+=W.length}return L}function w(R,D){if(R.length!==D.length)return!1;let L=0;for(let U=0;U<R.length;U++)L|=R[U]^D[U];return L===0}function C(R){if(typeof R!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(R))}const y=R=>typeof R=="bigint"&&t<=R;function _(R,D,L){return y(R)&&y(D)&&y(L)&&D<=R&&R<L}function x(R,D,L,U){if(!_(D,L,U))throw new Error("expected valid "+R+": "+L+" <= n < "+U+", got "+D)}function A(R){let D;for(D=0;R>t;R>>=e,D+=1);return D}function T(R,D){return R>>BigInt(D)&e}function O(R,D,L){return R|(L?e:t)<<BigInt(D)}const k=R=>(r<<BigInt(R-1))-e;Gt.bitMask=k;const j=R=>new Uint8Array(R),N=R=>Uint8Array.from(R);function S(R,D,L){if(typeof R!="number"||R<2)throw new Error("hashLen must be a number");if(typeof D!="number"||D<2)throw new Error("qByteLen must be a number");if(typeof L!="function")throw new Error("hmacFn must be a function");let U=j(R),z=j(R),W=0;const K=()=>{U.fill(1),z.fill(0),W=0},J=(...ie)=>L(z,U,...ie),ne=(ie=j())=>{z=J(N([0]),ie),U=J(),ie.length!==0&&(z=J(N([1]),ie),U=J())},ae=()=>{if(W++>=1e3)throw new Error("drbg: tried 1000 values");let ie=0;const Ee=[];for(;ie<D;){U=J();const pe=U.slice();Ee.push(pe),ie+=U.length}return E(...Ee)};return(ie,Ee)=>{K(),ne(ie);let pe;for(;!(pe=Ee(ae()));)ne();return K(),pe}}const P={bigint:R=>typeof R=="bigint",function:R=>typeof R=="function",boolean:R=>typeof R=="boolean",string:R=>typeof R=="string",stringOrUint8Array:R=>typeof R=="string"||n(R),isSafeInteger:R=>Number.isSafeInteger(R),array:R=>Array.isArray(R),field:(R,D)=>D.Fp.isValid(R),hash:R=>typeof R=="function"&&Number.isSafeInteger(R.outputLen)};function I(R,D,L={}){const U=(z,W,K)=>{const J=P[W];if(typeof J!="function")throw new Error("invalid validator function");const ne=R[z];if(!(K&&ne===void 0)&&!J(ne,R))throw new Error("param "+String(z)+" is invalid. Expected "+W+", got "+ne)};for(const[z,W]of Object.entries(D))U(z,W,!1);for(const[z,W]of Object.entries(L))U(z,W,!0);return R}const B=()=>{throw new Error("not implemented")};Gt.notImplemented=B;function $(R){const D=new WeakMap;return(L,...U)=>{const z=D.get(L);if(z!==void 0)return z;const W=R(L,...U);return D.set(L,W),W}}return Gt}var Rt={},Bw={},S0={},Dw={},UU;function wIe(){return UU||(UU=1,Object.defineProperty(Dw,"__esModule",{value:!0}),Dw.version=void 0,Dw.version="0.1.1"),Dw}var FU;function bIe(){if(FU)return S0;FU=1,Object.defineProperty(S0,"__esModule",{value:!0}),S0.getUrl=e,S0.getVersion=r,S0.prettyPrint=n;const t=wIe();function e(i){return i}function r(){return t.version}function n(i){if(!i)return"";const s=Object.entries(i).map(([a,c])=>c===void 0||c===!1?null:[a,c]).filter(Boolean),o=s.reduce((a,[c])=>Math.max(a,c.length),0);return s.map(([a,c])=>` ${`${a}:`.padEnd(o+1)} ${c}`).join(`
- `)}return S0}var HU;function cl(){if(HU)return Bw;HU=1,Object.defineProperty(Bw,"__esModule",{value:!0}),Bw.BaseError=void 0;const t=bIe();class e extends Error{constructor(i,s={}){const o=(()=>{var d;if(s.cause instanceof e){if(s.cause.details)return s.cause.details;if(s.cause.shortMessage)return s.cause.shortMessage}return s.cause&&"details"in s.cause&&typeof s.cause.details=="string"?s.cause.details:(d=s.cause)!=null&&d.message?s.cause.message:s.details})(),a=s.cause instanceof e&&s.cause.docsPath||s.docsPath,u=`https://oxlib.sh${a??""}`,l=[i||"An error occurred.",...s.metaMessages?["",...s.metaMessages]:[],...o||a?["",o?`Details: ${o}`:void 0,a?`See: ${u}`:void 0]:[]].filter(d=>typeof d=="string").join(`
- `);super(l,s.cause?{cause:s.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${(0,t.getVersion)()}`}),this.cause=s.cause,this.details=o,this.docs=u,this.docsPath=a,this.shortMessage=i}walk(i){return r(this,i)}}Bw.BaseError=e;function r(n,i){return i!=null&&i(n)?n:n&&typeof n=="object"&&"cause"in n&&n.cause?r(n.cause,i):i?null:n}return Bw}var Mw={},qU;function OO(){if(qU)return Mw;qU=1,Object.defineProperty(Mw,"__esModule",{value:!0}),Mw.parse=e,Mw.stringify=r;const t="#__bigint";function e(n,i){return JSON.parse(n,(s,o)=>{const a=o;return typeof a=="string"&&a.endsWith(t)?BigInt(a.slice(0,-t.length)):typeof i=="function"?i(s,a):a})}function r(n,i,s){return JSON.stringify(n,(o,a)=>typeof i=="function"?i(o,a):typeof a=="bigint"?a.toString()+t:a,s)}return Mw}var AT={},zU;function JQ(){return zU||(zU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.charCodeMap=void 0,t.assertSize=r,t.assertStartOffset=n,t.assertEndOffset=i,t.charCodeToBase16=s,t.pad=o,t.trim=a;const e=Hp();function r(c,u){if(e.size(c)>u)throw new e.SizeOverflowError({givenSize:e.size(c),maxSize:u})}function n(c,u){if(typeof u=="number"&&u>0&&u>e.size(c)-1)throw new e.SliceOffsetOutOfBoundsError({offset:u,position:"start",size:e.size(c)})}function i(c,u,l){if(typeof u=="number"&&typeof l=="number"&&e.size(c)!==l-u)throw new e.SliceOffsetOutOfBoundsError({offset:l,position:"end",size:e.size(c)})}t.charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function s(c){if(c>=t.charCodeMap.zero&&c<=t.charCodeMap.nine)return c-t.charCodeMap.zero;if(c>=t.charCodeMap.A&&c<=t.charCodeMap.F)return c-(t.charCodeMap.A-10);if(c>=t.charCodeMap.a&&c<=t.charCodeMap.f)return c-(t.charCodeMap.a-10)}function o(c,u={}){const{dir:l,size:d=32}=u;if(d===0)return c;if(c.length>d)throw new e.SizeExceedsPaddingSizeError({size:c.length,targetSize:d,type:"Bytes"});const h=new Uint8Array(d);for(let f=0;f<d;f++){const g=l==="right";h[g?f:d-f-1]=c[g?f:c.length-f-1]}return h}function a(c,u={}){const{dir:l="left"}=u;let d=c,h=0;for(let f=0;f<d.length-1&&d[l==="left"?f:d.length-f-1].toString()==="0";f++)h++;return d=l==="left"?d.slice(h):d.slice(0,d.length-h),d}}(AT)),AT}var Pl={},WU;function QQ(){if(WU)return Pl;WU=1,Object.defineProperty(Pl,"__esModule",{value:!0}),Pl.assertSize=e,Pl.assertStartOffset=r,Pl.assertEndOffset=n,Pl.pad=i,Pl.trim=s;const t=pa();function e(o,a){if(t.size(o)>a)throw new t.SizeOverflowError({givenSize:t.size(o),maxSize:a})}function r(o,a){if(typeof a=="number"&&a>0&&a>t.size(o)-1)throw new t.SliceOffsetOutOfBoundsError({offset:a,position:"start",size:t.size(o)})}function n(o,a,c){if(typeof a=="number"&&typeof c=="number"&&t.size(o)!==c-a)throw new t.SliceOffsetOutOfBoundsError({offset:c,position:"end",size:t.size(o)})}function i(o,a={}){const{dir:c,size:u=32}=a;if(u===0)return o;const l=o.replace("0x","");if(l.length>u*2)throw new t.SizeExceedsPaddingSizeError({size:Math.ceil(l.length/2),targetSize:u,type:"Hex"});return`0x${l[c==="right"?"padEnd":"padStart"](u*2,"0")}`}function s(o,a={}){const{dir:c="left"}=a;let u=o.replace("0x",""),l=0;for(let d=0;d<u.length-1&&u[c==="left"?d:u.length-d-1].toString()==="0";d++)l++;return u=c==="left"?u.slice(l):u.slice(0,u.length-l),u==="0"?"0x":c==="right"&&u.length%2===1?`0x${u}0`:`0x${u}`}return Pl}var VU;function Hp(){if(VU)return Rt;VU=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.SizeExceedsPaddingSizeError=Rt.SliceOffsetOutOfBoundsError=Rt.SizeOverflowError=Rt.InvalidBytesTypeError=Rt.InvalidBytesBooleanError=void 0,Rt.assert=c,Rt.concat=u,Rt.from=l,Rt.fromArray=d,Rt.fromBoolean=h,Rt.fromHex=f,Rt.fromNumber=g,Rt.fromString=p,Rt.isEqual=m,Rt.padLeft=b,Rt.padRight=v,Rt.random=E,Rt.size=w,Rt.slice=C,Rt.toBigInt=y,Rt.toBoolean=_,Rt.toHex=x,Rt.toNumber=A,Rt.toString=T,Rt.trimLeft=O,Rt.trimRight=k,Rt.validate=j;const t=YQ(),e=cl(),r=pa(),n=OO(),i=JQ(),s=QQ(),o=new TextDecoder,a=new TextEncoder;function c($){if(!($ instanceof Uint8Array)){if(!$)throw new S($);if(typeof $!="object")throw new S($);if(!("BYTES_PER_ELEMENT"in $))throw new S($);if($.BYTES_PER_ELEMENT!==1||$.constructor.name!=="Uint8Array")throw new S($)}}function u(...$){let R=0;for(const L of $)R+=L.length;const D=new Uint8Array(R);for(let L=0,U=0;L<$.length;L++){const z=$[L];D.set(z,U),U+=z.length}return D}function l($){return $ instanceof Uint8Array?$:typeof $=="string"?f($):d($)}function d($){return $ instanceof Uint8Array?$:new Uint8Array($)}function h($,R={}){const{size:D}=R,L=new Uint8Array(1);return L[0]=Number($),typeof D=="number"?(i.assertSize(L,D),b(L,D)):L}function f($,R={}){const{size:D}=R;let L=$;D&&(s.assertSize($,D),L=r.padRight($,D));let U=L.slice(2);U.length%2&&(U=`0${U}`);const z=U.length/2,W=new Uint8Array(z);for(let K=0,J=0;K<z;K++){const ne=i.charCodeToBase16(U.charCodeAt(J++)),ae=i.charCodeToBase16(U.charCodeAt(J++));if(ne===void 0||ae===void 0)throw new e.BaseError(`Invalid byte sequence ("${U[J-2]}${U[J-1]}" in "${U}").`);W[K]=ne*16+ae}return W}function g($,R){const D=r.fromNumber($,R);return f(D)}function p($,R={}){const{size:D}=R,L=a.encode($);return typeof D=="number"?(i.assertSize(L,D),v(L,D)):L}function m($,R){return(0,t.equalBytes)($,R)}function b($,R){return i.pad($,{dir:"left",size:R})}function v($,R){return i.pad($,{dir:"right",size:R})}function E($){return crypto.getRandomValues(new Uint8Array($))}function w($){return $.length}function C($,R,D,L={}){const{strict:U}=L;i.assertStartOffset($,R);const z=$.slice(R,D);return U&&i.assertEndOffset(z,R,D),z}function y($,R={}){const{size:D}=R;typeof D<"u"&&i.assertSize($,D);const L=r.fromBytes($,R);return r.toBigInt(L,R)}function _($,R={}){const{size:D}=R;let L=$;if(typeof D<"u"&&(i.assertSize(L,D),L=O(L)),L.length>1||L[0]>1)throw new N(L);return!!L[0]}function x($,R={}){return r.fromBytes($,R)}function A($,R={}){const{size:D}=R;typeof D<"u"&&i.assertSize($,D);const L=r.fromBytes($,R);return r.toNumber(L,R)}function T($,R={}){const{size:D}=R;let L=$;return typeof D<"u"&&(i.assertSize(L,D),L=k(L)),o.decode(L)}function O($){return i.trim($,{dir:"left"})}function k($){return i.trim($,{dir:"right"})}function j($){try{return c($),!0}catch{return!1}}class N extends e.BaseError{constructor(R){super(`Bytes value \`${R}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}Rt.InvalidBytesBooleanError=N;class S extends e.BaseError{constructor(R){super(`Value \`${typeof R=="object"?n.stringify(R):R}\` of type \`${typeof R}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}Rt.InvalidBytesTypeError=S;class P extends e.BaseError{constructor({givenSize:R,maxSize:D}){super(`Size cannot exceed \`${D}\` bytes. Given size: \`${R}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}Rt.SizeOverflowError=P;class I extends e.BaseError{constructor({offset:R,position:D,size:L}){super(`Slice ${D==="start"?"starting":"ending"} at offset \`${R}\` is out-of-bounds (size: \`${L}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}Rt.SliceOffsetOutOfBoundsError=I;class B extends e.BaseError{constructor({size:R,targetSize:D,type:L}){super(`${L.charAt(0).toUpperCase()}${L.slice(1).toLowerCase()} size (\`${R}\`) exceeds padding size (\`${D}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}return Rt.SizeExceedsPaddingSizeError=B,Rt}var GU;function pa(){if(GU)return Ct;GU=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.SizeExceedsPaddingSizeError=Ct.SliceOffsetOutOfBoundsError=Ct.SizeOverflowError=Ct.InvalidLengthError=Ct.InvalidHexValueError=Ct.InvalidHexTypeError=Ct.InvalidHexBooleanError=Ct.IntegerOutOfRangeError=void 0,Ct.assert=c,Ct.concat=u,Ct.from=l,Ct.fromBoolean=d,Ct.fromBytes=h,Ct.fromNumber=f,Ct.fromString=g,Ct.isEqual=p,Ct.padLeft=m,Ct.padRight=b,Ct.random=v,Ct.slice=E,Ct.size=w,Ct.trimLeft=C,Ct.trimRight=y,Ct.toBigInt=_,Ct.toBoolean=x,Ct.toBytes=A,Ct.toNumber=T,Ct.toString=O,Ct.validate=k;const t=YQ(),e=Hp(),r=cl(),n=OO(),i=JQ(),s=QQ(),o=new TextEncoder,a=Array.from({length:256},(D,L)=>L.toString(16).padStart(2,"0"));function c(D,L={}){const{strict:U=!1}=L;if(!D)throw new S(D);if(typeof D!="string")throw new S(D);if(U&&!/^0x[0-9a-fA-F]*$/.test(D))throw new P(D);if(!D.startsWith("0x"))throw new P(D)}function u(...D){return`0x${D.reduce((L,U)=>L+U.replace("0x",""),"")}`}function l(D){return D instanceof Uint8Array?h(D):Array.isArray(D)?h(new Uint8Array(D)):D}function d(D,L={}){const U=`0x${Number(D)}`;return typeof L.size=="number"?(s.assertSize(U,L.size),m(U,L.size)):U}function h(D,L={}){let U="";for(let W=0;W<D.length;W++)U+=a[D[W]];const z=`0x${U}`;return typeof L.size=="number"?(s.assertSize(z,L.size),b(z,L.size)):z}function f(D,L={}){const{signed:U,size:z}=L,W=BigInt(D);let K;z?U?K=(1n<<BigInt(z)*8n-1n)-1n:K=2n**(BigInt(z)*8n)-1n:typeof D=="number"&&(K=BigInt(Number.MAX_SAFE_INTEGER));const J=typeof K=="bigint"&&U?-K-1n:0;if(K&&W>K||W<J){const he=typeof D=="bigint"?"n":"";throw new j({max:K?`${K}${he}`:void 0,min:`${J}${he}`,signed:U,size:z,value:`${D}${he}`})}const ae=`0x${(U&&W<0?(1n<<BigInt(z*8))+BigInt(W):W).toString(16)}`;return z?m(ae,z):ae}function g(D,L={}){return h(o.encode(D),L)}function p(D,L){return(0,t.equalBytes)(e.fromHex(D),e.fromHex(L))}function m(D,L){return s.pad(D,{dir:"left",size:L})}function b(D,L){return s.pad(D,{dir:"right",size:L})}function v(D){return h(e.random(D))}function E(D,L,U,z={}){const{strict:W}=z;s.assertStartOffset(D,L);const K=`0x${D.replace("0x","").slice((L??0)*2,(U??D.length)*2)}`;return W&&s.assertEndOffset(K,L,U),K}function w(D){return Math.ceil((D.length-2)/2)}function C(D){return s.trim(D,{dir:"left"})}function y(D){return s.trim(D,{dir:"right"})}function _(D,L={}){const{signed:U}=L;L.size&&s.assertSize(D,L.size);const z=BigInt(D);if(!U)return z;const W=(D.length-2)/2,K=(1n<<BigInt(W)*8n)-1n,J=K>>1n;return z<=J?z:z-K-1n}function x(D,L={}){L.size&&s.assertSize(D,L.size);const U=C(D);if(U==="0x")return!1;if(U==="0x1")return!0;throw new N(D)}function A(D,L={}){return e.fromHex(D,L)}function T(D,L={}){const{signed:U,size:z}=L;return Number(!U&&!z?D:_(D,L))}function O(D,L={}){const{size:U}=L;let z=e.fromHex(D);return U&&(i.assertSize(z,U),z=e.trimRight(z)),new TextDecoder().decode(z)}function k(D,L={}){const{strict:U=!1}=L;try{return c(D,{strict:U}),!0}catch{return!1}}class j extends r.BaseError{constructor({max:L,min:U,signed:z,size:W,value:K}){super(`Number \`${K}\` is not in safe${W?` ${W*8}-bit`:""}${z?" signed":" unsigned"} integer range ${L?`(\`${U}\` to \`${L}\`)`:`(above \`${U}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}Ct.IntegerOutOfRangeError=j;class N extends r.BaseError{constructor(L){super(`Hex value \`"${L}"\` is not a valid boolean.`,{metaMessages:['The hex value must be `"0x0"` (false) or `"0x1"` (true).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexBooleanError"})}}Ct.InvalidHexBooleanError=N;class S extends r.BaseError{constructor(L){super(`Value \`${typeof L=="object"?n.stringify(L):L}\` of type \`${typeof L}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}Ct.InvalidHexTypeError=S;class P extends r.BaseError{constructor(L){super(`Value \`${L}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}Ct.InvalidHexValueError=P;class I extends r.BaseError{constructor(L){super(`Hex value \`"${L}"\` is an odd length (${L.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}Ct.InvalidLengthError=I;class B extends r.BaseError{constructor({givenSize:L,maxSize:U}){super(`Size cannot exceed \`${U}\` bytes. Given size: \`${L}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}Ct.SizeOverflowError=B;class $ extends r.BaseError{constructor({offset:L,position:U,size:z}){super(`Slice ${U==="start"?"starting":"ending"} at offset \`${L}\` is out-of-bounds (size: \`${z}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}Ct.SliceOffsetOutOfBoundsError=$;class R extends r.BaseError{constructor({size:L,targetSize:U,type:z}){super(`${z.charAt(0).toUpperCase()}${z.slice(1).toLowerCase()} size (\`${L}\`) exceeds padding size (\`${U}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}return Ct.SizeExceedsPaddingSizeError=R,Ct}var Lw={},KU;function yIe(){if(KU)return Lw;KU=1,Object.defineProperty(Lw,"__esModule",{value:!0}),Lw.fromRpc=e,Lw.toRpc=r;const t=pa();function e(n){return{...n,amount:BigInt(n.amount),index:Number(n.index),validatorIndex:Number(n.validatorIndex)}}function r(n){return{address:n.address,amount:t.fromNumber(n.amount),index:t.fromNumber(n.index),validatorIndex:t.fromNumber(n.validatorIndex)}}return Lw}var ZU;function XQ(){if(ZU)return jw;ZU=1,Object.defineProperty(jw,"__esModule",{value:!0}),jw.fromRpc=r,jw.toRpc=n;const t=pa(),e=yIe();function r(i){return{...i.baseFeePerGas&&{baseFeePerGas:BigInt(i.baseFeePerGas)},...i.blobBaseFee&&{blobBaseFee:BigInt(i.blobBaseFee)},...i.feeRecipient&&{feeRecipient:i.feeRecipient},...i.gasLimit&&{gasLimit:BigInt(i.gasLimit)},...i.number&&{number:BigInt(i.number)},...i.prevRandao&&{prevRandao:BigInt(i.prevRandao)},...i.time&&{time:BigInt(i.time)},...i.withdrawals&&{withdrawals:i.withdrawals.map(e.fromRpc)}}}function n(i){return{...typeof i.baseFeePerGas=="bigint"&&{baseFeePerGas:t.fromNumber(i.baseFeePerGas)},...typeof i.blobBaseFee=="bigint"&&{blobBaseFee:t.fromNumber(i.blobBaseFee)},...typeof i.feeRecipient=="string"&&{feeRecipient:i.feeRecipient},...typeof i.gasLimit=="bigint"&&{gasLimit:t.fromNumber(i.gasLimit)},...typeof i.number=="bigint"&&{number:t.fromNumber(i.number)},...typeof i.prevRandao=="bigint"&&{prevRandao:t.fromNumber(i.prevRandao)},...typeof i.time=="bigint"&&{time:t.fromNumber(i.time)},...i.withdrawals&&{withdrawals:i.withdrawals.map(e.toRpc)}}}return jw}var Jt={},YU;function rh(){if(YU)return Jt;YU=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.erc4626Abi=Jt.erc721Abi=Jt.erc1155Abi=Jt.erc20Abi_bytes32=Jt.erc20Abi=Jt.universalSignatureValidatorAbi=Jt.smartAccountAbi=Jt.addressResolverAbi=Jt.textResolverAbi=Jt.universalResolverReverseAbi=Jt.universalResolverResolveAbi=Jt.batchGatewayAbi=Jt.multicall3Abi=void 0,Jt.multicall3Abi=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],Jt.batchGatewayAbi=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}];const t=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}];return Jt.universalResolverResolveAbi=[...t,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Jt.universalResolverReverseAbi=[...t,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],Jt.textResolverAbi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Jt.addressResolverAbi=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],Jt.smartAccountAbi=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],Jt.universalSignatureValidatorAbi=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],Jt.erc20Abi=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],Jt.erc20Abi_bytes32=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],Jt.erc1155Abi=[{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC1155InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC1155InvalidApprover",type:"error"},{inputs:[{internalType:"uint256",name:"idsLength",type:"uint256"},{internalType:"uint256",name:"valuesLength",type:"uint256"}],name:"ERC1155InvalidArrayLength",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"ERC1155InvalidOperator",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC1155InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC1155InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"owner",type:"address"}],name:"ERC1155MissingApprovalForAll",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],Jt.erc721Abi=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"event",name:"ApprovalForAll",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"operator",type:"address"},{indexed:!1,name:"approved",type:"bool"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"payable",inputs:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"getApproved",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"address"}]},{type:"function",name:"isApprovedForAll",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"operator",type:"address"}],outputs:[{type:"bool"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"ownerOf",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"owner",type:"address"}]},{type:"function",name:"safeTransferFrom",stateMutability:"payable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"safeTransferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]},{type:"function",name:"setApprovalForAll",stateMutability:"nonpayable",inputs:[{name:"operator",type:"address"},{name:"approved",type:"bool"}],outputs:[]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"index",type:"uint256"}],outputs:[{type:"uint256"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"index",type:"uint256"}],outputs:[{name:"tokenId",type:"uint256"}]},{type:"function",name:"tokenURI",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transferFrom",stateMutability:"payable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"tokeId",type:"uint256"}],outputs:[]}],Jt.erc4626Abi=[{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!0,name:"owner",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],name:"allowance",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],name:"approve",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"asset",outputs:[{name:"assetTokenAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"convertToAssets",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"convertToShares",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"}],name:"deposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxDeposit",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxMint",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxRedeem",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxWithdraw",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"}],name:"mint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewDeposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewMint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewRedeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewWithdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"redeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"totalAssets",outputs:[{name:"totalManagedAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transfer",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"withdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"}],Jt}var Uw={},JU;function vIe(){return JU||(JU=1,Object.defineProperty(Uw,"__esModule",{value:!0}),Uw.aggregate3Signature=void 0,Uw.aggregate3Signature="0x82ad56cb"),Uw}var Hc={},QU;function hx(){return QU||(QU=1,Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.universalSignatureValidatorByteCode=Hc.deploylessCallViaFactoryBytecode=Hc.deploylessCallViaBytecodeBytecode=void 0,Hc.deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Hc.deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",Hc.universalSignatureValidatorByteCode="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572"),Hc}var us={},XU;function R2(){if(XU)return us;XU=1,Object.defineProperty(us,"__esModule",{value:!0}),us.InvalidChainIdError=us.ClientChainNotConfiguredError=us.ChainNotFoundError=us.ChainMismatchError=us.ChainDoesNotSupportContract=void 0;const t=_t();class e extends t.BaseError{constructor({blockNumber:a,chain:c,contract:u}){super(`Chain "${c.name}" does not support contract "${u.name}".`,{metaMessages:["This could be due to any of the following:",...a&&u.blockCreated&&u.blockCreated>a?[`- The contract "${u.name}" was not deployed until block ${u.blockCreated} (current block ${a}).`]:[`- The chain does not have the contract "${u.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}us.ChainDoesNotSupportContract=e;class r extends t.BaseError{constructor({chain:a,currentChainId:c}){super(`The current chain of the wallet (id: ${c}) does not match the target chain for the transaction (id: ${a.id} – ${a.name}).`,{metaMessages:[`Current Chain ID: ${c}`,`Expected Chain ID: ${a.id} – ${a.name}`],name:"ChainMismatchError"})}}us.ChainMismatchError=r;class n extends t.BaseError{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
- `),{name:"ChainNotFoundError"})}}us.ChainNotFoundError=n;class i extends t.BaseError{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}us.ClientChainNotConfiguredError=i;class s extends t.BaseError{constructor({chainId:a}){super(typeof a=="number"?`Chain ID "${a}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}return us.InvalidChainIdError=s,us}var F_={},eF;function k2(){if(eF)return F_;eF=1,Object.defineProperty(F_,"__esModule",{value:!0}),F_.encodeDeployData=i;const t=$r(),e=oi(),r=da(),n="/docs/contract/encodeDeployData";function i(s){const{abi:o,args:a,bytecode:c}=s;if(!a||a.length===0)return c;const u=o.find(d=>"type"in d&&d.type==="constructor");if(!u)throw new t.AbiConstructorNotFoundError({docsPath:n});if(!("inputs"in u))throw new t.AbiConstructorParamsNotFoundError({docsPath:n});if(!u.inputs||u.inputs.length===0)throw new t.AbiConstructorParamsNotFoundError({docsPath:n});const l=(0,r.encodeAbiParameters)(u.inputs,a);return(0,e.concatHex)([c,l])}return F_}var H_={},tF;function nh(){if(tF)return H_;tF=1,Object.defineProperty(H_,"__esModule",{value:!0}),H_.getChainContractAddress=e;const t=R2();function e({blockNumber:r,chain:n,contract:i}){var o;const s=(o=n==null?void 0:n.contracts)==null?void 0:o[i];if(!s)throw new t.ChainDoesNotSupportContract({chain:n,contract:{name:i}});if(r&&s.blockCreated&&s.blockCreated>r)throw new t.ChainDoesNotSupportContract({blockNumber:r,chain:n,contract:{name:i,blockCreated:s.blockCreated}});return s.address}return H_}var q_={},rF;function RO(){if(rF)return q_;rF=1,Object.defineProperty(q_,"__esModule",{value:!0}),q_.getCallError=n;const t=Qd(),e=nl(),r=S2();function n(i,{docsPath:s,...o}){const a=(()=>{const c=(0,r.getNodeError)(i,o);return c instanceof e.UnknownNodeError?i:c})();return new t.CallExecutionError(a,{docsPath:s,...o})}return q_}var z_={},W_={},nF;function kO(){if(nF)return W_;nF=1,Object.defineProperty(W_,"__esModule",{value:!0}),W_.withResolvers=t;function t(){let e=()=>{},r=()=>{};return{promise:new Promise((i,s)=>{e=i,r=s}),resolve:e,reject:r}}return W_}var iF;function NO(){if(iF)return z_;iF=1,Object.defineProperty(z_,"__esModule",{value:!0}),z_.createBatchScheduler=r;const t=kO(),e=new Map;function r({fn:n,id:i,shouldSplitBatch:s,wait:o=0,sort:a}){const c=async()=>{const f=d();u();const g=f.map(({args:p})=>p);g.length!==0&&n(g).then(p=>{a&&Array.isArray(p)&&p.sort(a);for(let m=0;m<f.length;m++){const{resolve:b}=f[m];b==null||b([p[m],p])}}).catch(p=>{for(let m=0;m<f.length;m++){const{reject:b}=f[m];b==null||b(p)}})},u=()=>e.delete(i),l=()=>d().map(({args:f})=>f),d=()=>e.get(i)||[],h=f=>e.set(i,[...d(),f]);return{flush:u,async schedule(f){const{promise:g,resolve:p,reject:m}=(0,t.withResolvers)();return(s==null?void 0:s([...l(),f]))&&c(),d().length>0?(h({args:f,resolve:p,reject:m}),g):(h({args:f,resolve:p,reject:m}),setTimeout(c,o),g)}}}return z_}var xT={},qc={},sF;function _Ie(){if(sF)return qc;sF=1,Object.defineProperty(qc,"__esModule",{value:!0}),qc.OffchainLookupSenderMismatchError=qc.OffchainLookupResponseMalformedError=qc.OffchainLookupError=void 0;const t=Gn(),e=_t(),r=bO();class n extends e.BaseError{constructor({callbackSelector:a,cause:c,data:u,extraData:l,sender:d,urls:h}){var f;super(c.shortMessage||"An error occurred while fetching for an offchain result.",{cause:c,metaMessages:[...c.metaMessages||[],(f=c.metaMessages)!=null&&f.length?"":[],"Offchain Gateway Call:",h&&[" Gateway URL(s):",...h.map(g=>` ${(0,r.getUrl)(g)}`)],` Sender: ${d}`,` Data: ${u}`,` Callback selector: ${a}`,` Extra data: ${l}`].flat(),name:"OffchainLookupError"})}}qc.OffchainLookupError=n;class i extends e.BaseError{constructor({result:a,url:c}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,r.getUrl)(c)}`,`Response: ${(0,t.stringify)(a)}`],name:"OffchainLookupResponseMalformedError"})}}qc.OffchainLookupResponseMalformedError=i;class s extends e.BaseError{constructor({sender:a,to:c}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${c}`,`OffchainLookup sender address: ${a}`],name:"OffchainLookupSenderMismatchError"})}}return qc.OffchainLookupSenderMismatchError=s,qc}var T0={},V_={},oF;function $O(){if(oF)return V_;oF=1,Object.defineProperty(V_,"__esModule",{value:!0}),V_.decodeFunctionData=s;const t=$r(),e=go(),r=Lp(),n=Jd(),i=el();function s(o){const{abi:a,data:c}=o,u=(0,e.slice)(c,0,4),l=a.find(d=>d.type==="function"&&u===(0,r.toFunctionSelector)((0,i.formatAbiItem)(d)));if(!l)throw new t.AbiFunctionSignatureNotFoundError(u,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:l.name,args:"inputs"in l&&l.inputs&&l.inputs.length>0?(0,n.decodeAbiParameters)(l.inputs,(0,e.slice)(c,4)):void 0}}return V_}var G_={},aF;function jO(){if(aF)return G_;aF=1,Object.defineProperty(G_,"__esModule",{value:!0}),G_.encodeErrorResult=a;const t=$r(),e=oi(),r=Lp(),n=da(),i=el(),s=rl(),o="/docs/contract/encodeErrorResult";function a(c){const{abi:u,errorName:l,args:d}=c;let h=u[0];if(l){const m=(0,s.getAbiItem)({abi:u,args:d,name:l});if(!m)throw new t.AbiErrorNotFoundError(l,{docsPath:o});h=m}if(h.type!=="error")throw new t.AbiErrorNotFoundError(void 0,{docsPath:o});const f=(0,i.formatAbiItem)(h),g=(0,r.toFunctionSelector)(f);let p="0x";if(d&&d.length>0){if(!h.inputs)throw new t.AbiErrorInputsNotFoundError(h.name,{docsPath:o});p=(0,n.encodeAbiParameters)(h.inputs,d)}return(0,e.concatHex)([g,p])}return G_}var K_={},cF;function BO(){if(cF)return K_;cF=1,Object.defineProperty(K_,"__esModule",{value:!0}),K_.encodeFunctionResult=i;const t=$r(),e=da(),r=rl(),n="/docs/contract/encodeFunctionResult";function i(s){const{abi:o,functionName:a,result:c}=s;let u=o[0];if(a){const d=(0,r.getAbiItem)({abi:o,name:a});if(!d)throw new t.AbiFunctionNotFoundError(a,{docsPath:n});u=d}if(u.type!=="function")throw new t.AbiFunctionNotFoundError(void 0,{docsPath:n});if(!u.outputs)throw new t.AbiFunctionOutputsNotFoundError(u.name,{docsPath:n});const l=(()=>{if(u.outputs.length===0)return[];if(u.outputs.length===1)return[c];if(Array.isArray(c))return c;throw new t.InvalidArrayError(c)})();return(0,e.encodeAbiParameters)(u.outputs,l)}return K_}var uF;function DO(){if(uF)return T0;uF=1,Object.defineProperty(T0,"__esModule",{value:!0}),T0.localBatchGatewayUrl=void 0,T0.localBatchGatewayRequest=s;const t=rh(),e=XA(),r=$O(),n=jO(),i=BO();T0.localBatchGatewayUrl="x-batch-gateway:true";async function s(a){const{data:c,ccipRequest:u}=a,{args:[l]}=(0,r.decodeFunctionData)({abi:t.batchGatewayAbi,data:c}),d=[],h=[];return await Promise.all(l.map(async(f,g)=>{try{h[g]=await u(f),d[g]=!1}catch(p){d[g]=!0,h[g]=o(p)}})),(0,i.encodeFunctionResult)({abi:t.batchGatewayAbi,functionName:"query",result:[d,h]})}function o(a){return a.name==="HttpRequestError"&&a.status?(0,n.encodeErrorResult)({abi:t.batchGatewayAbi,errorName:"HttpError",args:[a.status,a.shortMessage]}):(0,n.encodeErrorResult)({abi:[e.solidityError],errorName:"Error",args:["shortMessage"in a?a.shortMessage:a.message]})}return T0}var lF;function MO(){return lF||(lF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.offchainLookupAbiItem=t.offchainLookupSignature=void 0,t.offchainLookup=d,t.ccipRequest=h;const e=N2(),r=_Ie(),n=ha(),i=ex(),s=da(),o=fa(),a=oi(),c=ki(),u=DO(),l=Gn();t.offchainLookupSignature="0x556f1830",t.offchainLookupAbiItem={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function d(f,{blockNumber:g,blockTag:p,data:m,to:b}){const{args:v}=(0,i.decodeErrorResult)({data:m,abi:[t.offchainLookupAbiItem]}),[E,w,C,y,_]=v,{ccipRead:x}=f,A=x&&typeof(x==null?void 0:x.request)=="function"?x.request:h;try{if(!(0,o.isAddressEqual)(b,E))throw new r.OffchainLookupSenderMismatchError({sender:E,to:b});const T=w.includes(u.localBatchGatewayUrl)?await(0,u.localBatchGatewayRequest)({data:C,ccipRequest:A}):await A({data:C,sender:E,urls:w}),{data:O}=await(0,e.call)(f,{blockNumber:g,blockTag:p,data:(0,a.concat)([y,(0,s.encodeAbiParameters)([{type:"bytes"},{type:"bytes"}],[T,_])]),to:b});return O}catch(T){throw new r.OffchainLookupError({callbackSelector:y,cause:T,data:m,extraData:_,sender:E,urls:w})}}async function h({data:f,sender:g,urls:p}){var b;let m=new Error("An unknown error occurred.");for(let v=0;v<p.length;v++){const E=p[v],w=E.includes("{data}")?"GET":"POST",C=w==="POST"?{data:f,sender:g}:void 0,y=w==="POST"?{"Content-Type":"application/json"}:{};try{const _=await fetch(E.replace("{sender}",g.toLowerCase()).replace("{data}",f),{body:JSON.stringify(C),headers:y,method:w});let x;if((b=_.headers.get("Content-Type"))!=null&&b.startsWith("application/json")?x=(await _.json()).data:x=await _.text(),!_.ok){m=new n.HttpRequestError({body:C,details:x!=null&&x.error?(0,l.stringify)(x.error):_.statusText,headers:_.headers,status:_.status,url:E});continue}if(!(0,c.isHex)(x)){m=new r.OffchainLookupResponseMalformedError({result:x,url:E});continue}return x}catch(_){m=new n.HttpRequestError({body:C,details:_.message,url:E})}}throw m}}(xT)),xT}var dF;function N2(){if(dF)return $w;dF=1,Object.defineProperty($w,"__esModule",{value:!0}),$w.call=w,$w.getRevertErrorData=A;const t=Kd(),e=XQ(),r=sn(),n=rh(),i=vIe(),s=hx(),o=_t(),a=R2(),c=Qd(),u=al(),l=k2(),d=Bs(),h=nh(),f=ze(),g=RO(),p=_1(),m=il(),b=NO(),v=vO(),E=sl();async function w(T,O){var ft,Wt,lr,dr;const{account:k=T.account,authorizationList:j,batch:N=!!((ft=T.batch)!=null&&ft.multicall),blockNumber:S,blockTag:P="latest",accessList:I,blobs:B,blockOverrides:$,code:R,data:D,factory:L,factoryData:U,gas:z,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:J,maxPriorityFeePerGas:ne,nonce:ae,to:he,value:ie,stateOverride:Ee,...pe}=O,ve=k?(0,r.parseAccount)(k):void 0;if(R&&(L||U))throw new o.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(R&&he)throw new o.BaseError("Cannot provide both `code` & `to` as parameters.");const je=R&&D,rt=L&&U&&he&&D,Ce=je||rt,fe=je?_({code:R,data:D}):rt?x({data:D,factory:L,factoryData:U,to:he}):D;try{(0,E.assertRequest)(O);const Er=(typeof S=="bigint"?(0,f.numberToHex)(S):void 0)||P,be=$?e.toRpc($):void 0,Te=(0,v.serializeStateOverride)(Ee),Me=(dr=(lr=(Wt=T.chain)==null?void 0:Wt.formatters)==null?void 0:lr.transactionRequest)==null?void 0:dr.format,Cr=(Me||m.formatTransactionRequest)({...(0,p.extract)(pe,{format:Me}),from:ve==null?void 0:ve.address,accessList:I,authorizationList:j,blobs:B,data:fe,gas:z,gasPrice:W,maxFeePerBlobGas:K,maxFeePerGas:J,maxPriorityFeePerGas:ne,nonce:ae,to:Ce?void 0:he,value:ie});if(N&&C({request:Cr})&&!Te&&!be)try{return await y(T,{...Cr,blockNumber:S,blockTag:P})}catch(fn){if(!(fn instanceof a.ClientChainNotConfiguredError)&&!(fn instanceof a.ChainDoesNotSupportContract))throw fn}const hn=(()=>{const fn=[Cr,Er];return Te&&be?[...fn,Te,be]:Te?[...fn,Te]:be?[...fn,{},be]:fn})(),ai=await T.request({method:"eth_call",params:hn});return ai==="0x"?{data:void 0}:{data:ai}}catch(hr){const Er=A(hr),{offchainLookup:be,offchainLookupSignature:Te}=await Promise.resolve().then(()=>MO());if(T.ccipRead!==!1&&(Er==null?void 0:Er.slice(0,10))===Te&&he)return{data:await be(T,{data:Er,to:he})};throw Ce&&(Er==null?void 0:Er.slice(0,10))==="0x101bb98d"?new c.CounterfactualDeploymentFailedError({factory:L}):(0,g.getCallError)(hr,{...O,account:ve,chain:T.chain})}}function C({request:T}){const{data:O,to:k,...j}=T;return!(!O||O.startsWith(i.aggregate3Signature)||!k||Object.values(j).filter(N=>typeof N<"u").length>0)}async function y(T,O){var W;const{batchSize:k=1024,wait:j=0}=typeof((W=T.batch)==null?void 0:W.multicall)=="object"?T.batch.multicall:{},{blockNumber:N,blockTag:S="latest",data:P,multicallAddress:I,to:B}=O;let $=I;if(!$){if(!T.chain)throw new a.ClientChainNotConfiguredError;$=(0,h.getChainContractAddress)({blockNumber:N,chain:T.chain,contract:"multicall3"})}const D=(typeof N=="bigint"?(0,f.numberToHex)(N):void 0)||S,{schedule:L}=(0,b.createBatchScheduler)({id:`${T.uid}.${D}`,wait:j,shouldSplitBatch(K){return K.reduce((ne,{data:ae})=>ne+(ae.length-2),0)>k*2},fn:async K=>{const J=K.map(he=>({allowFailure:!0,callData:he.data,target:he.to})),ne=(0,d.encodeFunctionData)({abi:n.multicall3Abi,args:[J],functionName:"aggregate3"}),ae=await T.request({method:"eth_call",params:[{data:ne,to:$},D]});return(0,u.decodeFunctionResult)({abi:n.multicall3Abi,args:[J],functionName:"aggregate3",data:ae||"0x"})}}),[{returnData:U,success:z}]=await L({data:P,to:B});if(!z)throw new c.RawContractError({data:U});return U==="0x"?{data:void 0}:{data:U}}function _(T){const{code:O,data:k}=T;return(0,l.encodeDeployData)({abi:(0,t.parseAbi)(["constructor(bytes, bytes)"]),bytecode:s.deploylessCallViaBytecodeBytecode,args:[O,k]})}function x(T){const{data:O,factory:k,factoryData:j,to:N}=T;return(0,l.encodeDeployData)({abi:(0,t.parseAbi)(["constructor(address, bytes, address, bytes)"]),bytecode:s.deploylessCallViaFactoryBytecode,args:[N,O,k,j]})}function A(T){var k;if(!(T instanceof o.BaseError))return;const O=T.walk();return typeof(O==null?void 0:O.data)=="object"?(k=O.data)==null?void 0:k.data:O.data}return $w}var hF;function ul(){if(hF)return L_;hF=1,Object.defineProperty(L_,"__esModule",{value:!0}),L_.readContract=s;const t=al(),e=Bs(),r=eh(),n=ur(),i=N2();async function s(o,a){const{abi:c,address:u,args:l,functionName:d,...h}=a,f=(0,e.encodeFunctionData)({abi:c,args:l,functionName:d});try{const{data:g}=await(0,n.getAction)(o,i.call,"call")({...h,data:f,to:u});return(0,t.decodeFunctionResult)({abi:c,args:l,functionName:d,data:g||"0x"})}catch(g){throw(0,r.getContractError)(g,{abi:c,address:u,args:l,docsPath:"/docs/contract/readContract",functionName:d})}}return L_}var Z_={},fF;function eX(){if(fF)return Z_;fF=1,Object.defineProperty(Z_,"__esModule",{value:!0}),Z_.simulateContract=o;const t=sn(),e=al(),r=Bs(),n=eh(),i=ur(),s=N2();async function o(a,c){const{abi:u,address:l,args:d,dataSuffix:h,functionName:f,...g}=c,p=g.account?(0,t.parseAccount)(g.account):a.account,m=(0,r.encodeFunctionData)({abi:u,args:d,functionName:f});try{const{data:b}=await(0,i.getAction)(a,s.call,"call")({batch:!1,data:`${m}${h?h.replace("0x",""):""}`,to:l,...g,account:p}),v=(0,e.decodeFunctionResult)({abi:u,args:d,functionName:f,data:b||"0x"}),E=u.filter(w=>"name"in w&&w.name===c.functionName);return{result:v,request:{abi:E,address:l,args:d,dataSuffix:h,functionName:f,...g,account:p}}}catch(b){throw(0,n.getContractError)(b,{abi:u,address:l,args:d,docsPath:"/docs/contract/simulateContract",functionName:f,sender:p==null?void 0:p.address})}}return Z_}var Y_={},ST={},pF;function qp(){return pF||(pF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.cleanupCache=t.listenersCache=void 0,t.observe=r,t.listenersCache=new Map,t.cleanupCache=new Map;let e=0;function r(n,i,s){const o=++e,a=()=>t.listenersCache.get(n)||[],c=()=>{const f=a();t.listenersCache.set(n,f.filter(g=>g.id!==o))},u=()=>{const f=a();if(!f.some(p=>p.id===o))return;const g=t.cleanupCache.get(n);f.length===1&&g&&g(),c()},l=a();if(t.listenersCache.set(n,[...l,{id:o,fns:i}]),l&&l.length>0)return u;const d={};for(const f in i)d[f]=(...g)=>{var m,b;const p=a();if(p.length!==0)for(const v of p)(b=(m=v.fns)[f])==null||b.call(m,...g)};const h=s(d);return typeof h=="function"&&t.cleanupCache.set(n,h),u}}(ST)),ST}var J_={},Q_={},gF;function LO(){if(gF)return Q_;gF=1,Object.defineProperty(Q_,"__esModule",{value:!0}),Q_.wait=t;async function t(e){return new Promise(r=>setTimeout(r,e))}return Q_}var mF;function A1(){if(mF)return J_;mF=1,Object.defineProperty(J_,"__esModule",{value:!0}),J_.poll=e;const t=LO();function e(r,{emitOnBegin:n,initialWaitTime:i,interval:s}){let o=!0;const a=()=>o=!1;return(async()=>{let u;n&&(u=await r({unpoll:a}));const l=await(i==null?void 0:i(u))??s;await(0,t.wait)(l);const d=async()=>{o&&(await r({unpoll:a}),await(0,t.wait)(s),d())};d()})(),a}return J_}var Fw={},TT={},wF;function tX(){return wF||(wF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.responseCache=t.promiseCache=void 0,t.getCache=e,t.withCache=r,t.promiseCache=new Map,t.responseCache=new Map;function e(n){const i=(a,c)=>({clear:()=>c.delete(a),get:()=>c.get(a),set:u=>c.set(a,u)}),s=i(n,t.promiseCache),o=i(n,t.responseCache);return{clear:()=>{s.clear(),o.clear()},promise:s,response:o}}async function r(n,{cacheKey:i,cacheTime:s=Number.POSITIVE_INFINITY}){const o=e(i),a=o.response.get();if(a&&s>0&&new Date().getTime()-a.created.getTime()<s)return a.data;let c=o.promise.get();c||(c=n(),o.promise.set(c));try{const u=await c;return o.response.set({created:new Date,data:u}),u}finally{o.promise.clear()}}}(TT)),TT}var bF;function $2(){if(bF)return Fw;bF=1,Object.defineProperty(Fw,"__esModule",{value:!0}),Fw.getBlockNumberCache=r,Fw.getBlockNumber=n;const t=tX(),e=i=>`blockNumber.${i}`;function r(i){return(0,t.getCache)(e(i))}async function n(i,{cacheTime:s=i.cacheTime}={}){const o=await(0,t.withCache)(()=>i.request({method:"eth_blockNumber"}),{cacheKey:e(i.uid),cacheTime:s});return BigInt(o)}return Fw}var X_={},yF;function fx(){if(yF)return X_;yF=1,Object.defineProperty(X_,"__esModule",{value:!0}),X_.getFilterChanges=r;const t=O2(),e=ol();async function r(n,{filter:i}){const s="strict"in i&&i.strict,o=await i.request({method:"eth_getFilterChanges",params:[i.id]});if(typeof o[0]=="string")return o;const a=o.map(c=>(0,e.formatLog)(c));return!("abi"in i)||!i.abi?a:(0,t.parseEventLogs)({abi:i.abi,logs:a,strict:s})}return X_}var eE={},vF;function px(){if(vF)return eE;vF=1,Object.defineProperty(eE,"__esModule",{value:!0}),eE.uninstallFilter=t;async function t(e,{filter:r}){return r.request({method:"eth_uninstallFilter",params:[r.id]})}return eE}var _F;function rX(){if(_F)return Y_;_F=1,Object.defineProperty(Y_,"__esModule",{value:!0}),Y_.watchContractEvent=g;const t=$r(),e=Xd(),r=P2(),n=Up(),i=ol(),s=ur(),o=qp(),a=A1(),c=Gn(),u=gO(),l=$2(),d=PO(),h=fx(),f=px();function g(p,m){const{abi:b,address:v,args:E,batch:w=!0,eventName:C,fromBlock:y,onError:_,onLogs:x,poll:A,pollingInterval:T=p.pollingInterval,strict:O}=m;return(typeof A<"u"?A:typeof y=="bigint"?!0:!(p.transport.type==="webSocket"||p.transport.type==="fallback"&&p.transport.transports[0].config.type==="webSocket"))?(()=>{const S=O??!1,P=(0,c.stringify)(["watchContractEvent",v,E,w,p.uid,C,T,S,y]);return(0,o.observe)(P,{onLogs:x,onError:_},I=>{let B;y!==void 0&&(B=y-1n);let $,R=!1;const D=(0,a.poll)(async()=>{var L;if(!R){try{$=await(0,s.getAction)(p,u.createContractEventFilter,"createContractEventFilter")({abi:b,address:v,args:E,eventName:C,strict:S,fromBlock:y})}catch{}R=!0;return}try{let U;if($)U=await(0,s.getAction)(p,h.getFilterChanges,"getFilterChanges")({filter:$});else{const z=await(0,s.getAction)(p,l.getBlockNumber,"getBlockNumber")({});B&&B<z?U=await(0,s.getAction)(p,d.getContractEvents,"getContractEvents")({abi:b,address:v,args:E,eventName:C,fromBlock:B+1n,toBlock:z,strict:S}):U=[],B=z}if(U.length===0)return;if(w)I.onLogs(U);else for(const z of U)I.onLogs([z])}catch(U){$&&U instanceof e.InvalidInputRpcError&&(R=!1),(L=I.onError)==null||L.call(I,U)}},{emitOnBegin:!0,interval:T});return async()=>{$&&await(0,s.getAction)(p,f.uninstallFilter,"uninstallFilter")({filter:$}),D()}})})():(()=>{const S=O??!1,P=(0,c.stringify)(["watchContractEvent",v,E,w,p.uid,C,T,S]);let I=!0,B=()=>I=!1;return(0,o.observe)(P,{onLogs:x,onError:_},$=>((async()=>{try{const R=(()=>{if(p.transport.type==="fallback"){const U=p.transport.transports.find(z=>z.config.type==="webSocket");return U?U.value:p.transport}return p.transport})(),D=C?(0,n.encodeEventTopics)({abi:b,eventName:C,args:E}):[],{unsubscribe:L}=await R.subscribe({params:["logs",{address:v,topics:D}],onData(U){var W;if(!I)return;const z=U.result;try{const{eventName:K,args:J}=(0,r.decodeEventLog)({abi:b,data:z.data,topics:z.topics,strict:O}),ne=(0,i.formatLog)(z,{args:J,eventName:K});$.onLogs([ne])}catch(K){let J,ne;if(K instanceof t.DecodeLogDataMismatch||K instanceof t.DecodeLogTopicsMismatch){if(O)return;J=K.abiItem.name,ne=(W=K.abiItem.inputs)==null?void 0:W.some(he=>!("name"in he&&he.name))}const ae=(0,i.formatLog)(z,{args:ne?[]:{},eventName:J});$.onLogs([ae])}},onError(U){var z;(z=$.onError)==null||z.call($,U)}});B=L,I||B()}catch(R){_==null||_(R)}})(),()=>B()))})()}return Y_}var tE={},Ah={},EF;function zp(){if(EF)return Ah;EF=1,Object.defineProperty(Ah,"__esModule",{value:!0}),Ah.AccountTypeNotSupportedError=Ah.AccountNotFoundError=void 0;const t=_t();class e extends t.BaseError{constructor({docsPath:i}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
- `),{docsPath:i,docsSlug:"account",name:"AccountNotFoundError"})}}Ah.AccountNotFoundError=e;class r extends t.BaseError{constructor({docsPath:i,metaMessages:s,type:o}){super(`Account type "${o}" is not supported.`,{docsPath:i,metaMessages:s,name:"AccountTypeNotSupportedError"})}}return Ah.AccountTypeNotSupportedError=r,Ah}var rE={},nE={},CF;function gx(){if(CF)return nE;CF=1,Object.defineProperty(nE,"__esModule",{value:!0}),nE.assertCurrentChain=e;const t=R2();function e({chain:r,currentChainId:n}){if(!r)throw new t.ChainNotFoundError;if(n!==r.id)throw new t.ChainMismatchError({chain:r,currentChainId:n})}return nE}var iE={},AF;function UO(){if(AF)return iE;AF=1,Object.defineProperty(iE,"__esModule",{value:!0}),iE.getTransactionError=n;const t=nl(),e=Ds(),r=S2();function n(i,{docsPath:s,...o}){const a=(()=>{const c=(0,r.getNodeError)(i,o);return c instanceof t.UnknownNodeError?i:c})();return new e.TransactionExecutionError(a,{docsPath:s,...o})}return iE}var sE={},xF;function FO(){if(xF)return sE;xF=1,Object.defineProperty(sE,"__esModule",{value:!0}),sE.sendRawTransaction=t;async function t(e,{serializedTransaction:r}){return e.request({method:"eth_sendRawTransaction",params:[r]},{retryCount:0})}return sE}var SF;function mx(){if(SF)return rE;SF=1,Object.defineProperty(rE,"__esModule",{value:!0}),rE.sendTransaction=p;const t=sn(),e=zp(),r=_t(),n=nx(),i=gx(),s=UO(),o=_1(),a=il(),c=ur(),u=y2(),l=sl(),d=C1(),h=dx(),f=FO(),g=new u.LruMap(128);async function p(m,b){var B,$,R,D;const{account:v=m.account,chain:E=m.chain,accessList:w,authorizationList:C,blobs:y,data:_,gas:x,gasPrice:A,maxFeePerBlobGas:T,maxFeePerGas:O,maxPriorityFeePerGas:k,nonce:j,type:N,value:S,...P}=b;if(typeof v>"u")throw new e.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const I=v?(0,t.parseAccount)(v):null;try{(0,l.assertRequest)(b);const L=await(async()=>{if(b.to)return b.to;if(b.to!==null&&C&&C.length>0)return await(0,n.recoverAuthorizationAddress)({authorization:C[0]}).catch(()=>{throw new r.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if((I==null?void 0:I.type)==="json-rpc"||I===null){let U;E!==null&&(U=await(0,c.getAction)(m,d.getChainId,"getChainId")({}),(0,i.assertCurrentChain)({currentChainId:U,chain:E}));const z=(R=($=(B=m.chain)==null?void 0:B.formatters)==null?void 0:$.transactionRequest)==null?void 0:R.format,K=(z||a.formatTransactionRequest)({...(0,o.extract)(P,{format:z}),accessList:w,authorizationList:C,blobs:y,chainId:U,data:_,from:I==null?void 0:I.address,gas:x,gasPrice:A,maxFeePerBlobGas:T,maxFeePerGas:O,maxPriorityFeePerGas:k,nonce:j,to:L,type:N,value:S}),J=g.get(m.uid),ne=J?"wallet_sendTransaction":"eth_sendTransaction";try{return await m.request({method:ne,params:[K]},{retryCount:0})}catch(ae){if(J===!1)throw ae;const he=ae;if(he.name==="InvalidInputRpcError"||he.name==="InvalidParamsRpcError"||he.name==="MethodNotFoundRpcError"||he.name==="MethodNotSupportedRpcError")return await m.request({method:"wallet_sendTransaction",params:[K]},{retryCount:0}).then(ie=>(g.set(m.uid,!0),ie)).catch(ie=>{const Ee=ie;throw Ee.name==="MethodNotFoundRpcError"||Ee.name==="MethodNotSupportedRpcError"?(g.set(m.uid,!1),he):Ee});throw he}}if((I==null?void 0:I.type)==="local"){const U=await(0,c.getAction)(m,h.prepareTransactionRequest,"prepareTransactionRequest")({account:I,accessList:w,authorizationList:C,blobs:y,chain:E,data:_,gas:x,gasPrice:A,maxFeePerBlobGas:T,maxFeePerGas:O,maxPriorityFeePerGas:k,nonce:j,nonceManager:I.nonceManager,parameters:[...h.defaultParameters,"sidecars"],type:N,value:S,...P,to:L}),z=(D=E==null?void 0:E.serializers)==null?void 0:D.transaction,W=await I.signTransaction(U,{serializer:z});return await(0,c.getAction)(m,f.sendRawTransaction,"sendRawTransaction")({serializedTransaction:W})}throw(I==null?void 0:I.type)==="smart"?new e.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new e.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:I==null?void 0:I.type})}catch(L){throw L instanceof e.AccountTypeNotSupportedError?L:(0,s.getTransactionError)(L,{...b,account:I,chain:b.chain||void 0})}}return rE}var TF;function nX(){if(TF)return tE;TF=1,Object.defineProperty(tE,"__esModule",{value:!0}),tE.writeContract=o;const t=sn(),e=zp(),r=Bs(),n=eh(),i=ur(),s=mx();async function o(a,c){const{abi:u,account:l=a.account,address:d,args:h,dataSuffix:f,functionName:g,...p}=c;if(typeof l>"u")throw new e.AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const m=l?(0,t.parseAccount)(l):null,b=(0,r.encodeFunctionData)({abi:u,args:h,functionName:g});try{return await(0,i.getAction)(a,s.sendTransaction,"sendTransaction")({data:`${b}${f?f.replace("0x",""):""}`,to:d,account:m,...p})}catch(v){throw(0,n.getContractError)(v,{abi:u,address:d,args:h,docsPath:"/docs/contract/writeContract",functionName:g,sender:m==null?void 0:m.address})}}return tE}var IF;function EIe(){if(IF)return w0;IF=1,Object.defineProperty(w0,"__esModule",{value:!0}),w0.getContract=c,w0.getFunctionParameters=u,w0.getEventParameters=l;const t=ur(),e=gO(),r=ZQ(),n=PO(),i=ul(),s=eX(),o=rX(),a=nX();function c({abi:d,address:h,client:f}){const g=f,[p,m]=g?"public"in g&&"wallet"in g?[g.public,g.wallet]:"public"in g?[g.public,void 0]:"wallet"in g?[void 0,g.wallet]:[g,g]:[void 0,void 0],b=p!=null,v=m!=null,E={};let w=!1,C=!1,y=!1;for(const _ of d)if(_.type==="function"?_.stateMutability==="view"||_.stateMutability==="pure"?w=!0:C=!0:_.type==="event"&&(y=!0),w&&C&&y)break;return b&&(w&&(E.read=new Proxy({},{get(_,x){return(...A)=>{const{args:T,options:O}=u(A);return(0,t.getAction)(p,i.readContract,"readContract")({abi:d,address:h,functionName:x,args:T,...O})}}})),C&&(E.simulate=new Proxy({},{get(_,x){return(...A)=>{const{args:T,options:O}=u(A);return(0,t.getAction)(p,s.simulateContract,"simulateContract")({abi:d,address:h,functionName:x,args:T,...O})}}})),y&&(E.createEventFilter=new Proxy({},{get(_,x){return(...A)=>{const T=d.find(j=>j.type==="event"&&j.name===x),{args:O,options:k}=l(A,T);return(0,t.getAction)(p,e.createContractEventFilter,"createContractEventFilter")({abi:d,address:h,eventName:x,args:O,...k})}}}),E.getEvents=new Proxy({},{get(_,x){return(...A)=>{const T=d.find(j=>j.type==="event"&&j.name===x),{args:O,options:k}=l(A,T);return(0,t.getAction)(p,n.getContractEvents,"getContractEvents")({abi:d,address:h,eventName:x,args:O,...k})}}}),E.watchEvent=new Proxy({},{get(_,x){return(...A)=>{const T=d.find(j=>j.type==="event"&&j.name===x),{args:O,options:k}=l(A,T);return(0,t.getAction)(p,o.watchContractEvent,"watchContractEvent")({abi:d,address:h,eventName:x,args:O,...k})}}}))),v&&C&&(E.write=new Proxy({},{get(_,x){return(...A)=>{const{args:T,options:O}=u(A);return(0,t.getAction)(m,a.writeContract,"writeContract")({abi:d,address:h,functionName:x,args:T,...O})}}})),(b||v)&&C&&(E.estimateGas=new Proxy({},{get(_,x){return(...A)=>{const{args:T,options:O}=u(A),k=p??m;return(0,t.getAction)(k,r.estimateContractGas,"estimateContractGas")({abi:d,address:h,functionName:x,args:T,...O,account:O.account??m.account})}}})),E.address=h,E.abi=d,E}function u(d){const h=d.length&&Array.isArray(d[0]),f=h?d[0]:[],g=(h?d[1]:d[0])??{};return{args:f,options:g}}function l(d,h){let f=!1;Array.isArray(d[0])?f=!0:d.length===1?f=h.inputs.some(m=>m.indexed):d.length===2&&(f=!0);const g=f?d[0]:void 0,p=(f?d[1]:d[0])??{};return{args:g,options:p}}return w0}var I0={},oE={},IT={},PF;function wx(){return PF||(PF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.defineTransactionReceipt=t.receiptStatuses=void 0,t.formatTransactionReceipt=s;const e=nn(),r=T2(),n=ol(),i=I2();t.receiptStatuses={"0x0":"reverted","0x1":"success"};function s(o){const a={...o,blockNumber:o.blockNumber?BigInt(o.blockNumber):null,contractAddress:o.contractAddress?o.contractAddress:null,cumulativeGasUsed:o.cumulativeGasUsed?BigInt(o.cumulativeGasUsed):null,effectiveGasPrice:o.effectiveGasPrice?BigInt(o.effectiveGasPrice):null,gasUsed:o.gasUsed?BigInt(o.gasUsed):null,logs:o.logs?o.logs.map(c=>(0,n.formatLog)(c)):null,to:o.to?o.to:null,transactionIndex:o.transactionIndex?(0,e.hexToNumber)(o.transactionIndex):null,status:o.status?t.receiptStatuses[o.status]:null,type:o.type?i.transactionType[o.type]||o.type:null};return o.blobGasPrice&&(a.blobGasPrice=BigInt(o.blobGasPrice)),o.blobGasUsed&&(a.blobGasUsed=BigInt(o.blobGasUsed)),a}t.defineTransactionReceipt=(0,r.defineFormatter)("transactionReceipt",s)}(IT)),IT}var PT={},OF;function iX(){return OF||(OF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.fallbackTransactionErrorMagicIdentifier=t.fallbackMagicIdentifier=void 0,t.sendCalls=l;const e=sn(),r=_t(),n=Xd(),i=Bs(),s=oi(),o=nn(),a=ze(),c=UO(),u=mx();t.fallbackMagicIdentifier="0x5792579257925792579257925792579257925792579257925792579257925792",t.fallbackTransactionErrorMagicIdentifier=(0,a.numberToHex)(0,{size:32});async function l(d,h){const{account:f=d.account,capabilities:g,chain:p=d.chain,experimental_fallback:m,experimental_fallbackDelay:b=32,forceAtomic:v=!1,id:E,version:w="2.0.0"}=h,C=f?(0,e.parseAccount)(f):null,y=h.calls.map(_=>{const x=_;return{data:x.abi?(0,i.encodeFunctionData)({abi:x.abi,functionName:x.functionName,args:x.args}):x.data,to:x.to,value:x.value?(0,a.numberToHex)(x.value):void 0}});try{const _=await d.request({method:"wallet_sendCalls",params:[{atomicRequired:v,calls:y,capabilities:g,chainId:(0,a.numberToHex)(p.id),from:C==null?void 0:C.address,id:E,version:w}]},{retryCount:0});return typeof _=="string"?{id:_}:_}catch(_){const x=_;if(m&&(x.name==="MethodNotFoundRpcError"||x.name==="MethodNotSupportedRpcError"||x.details.toLowerCase().includes("does not exist / is not available")||x.details.toLowerCase().includes("missing or invalid. request()")||x.details.toLowerCase().includes("did not match any variant of untagged enum"))){if(g&&Object.values(g).some(j=>!j.optional)){const j="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new n.UnsupportedNonOptionalCapabilityError(new r.BaseError(j,{details:j}))}if(v&&y.length>1){const k="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new n.AtomicityNotSupportedError(new r.BaseError(k,{details:k}))}const A=[];for(const k of y){const j=(0,u.sendTransaction)(d,{account:C,chain:p,data:k.data,to:k.to,value:k.value?(0,o.hexToBigInt)(k.value):void 0});A.push(j),b>0&&await new Promise(N=>setTimeout(N,b))}const T=await Promise.allSettled(A);if(T.every(k=>k.status==="rejected"))throw T[0].reason;const O=T.map(k=>k.status==="fulfilled"?k.value:t.fallbackTransactionErrorMagicIdentifier);return{id:(0,s.concat)([...O,(0,a.numberToHex)(p.id,{size:32}),t.fallbackMagicIdentifier])}}throw(0,c.getTransactionError)(_,{...h,account:C,chain:h.chain})}}}(PT)),PT}var RF;function sX(){if(RF)return oE;RF=1,Object.defineProperty(oE,"__esModule",{value:!0}),oE.getCallsStatus=s;const t=go(),e=tl(),r=nn(),n=wx(),i=iX();async function s(o,a){async function c(m){if(m.endsWith(i.fallbackMagicIdentifier.slice(2))){const v=(0,e.trim)((0,t.sliceHex)(m,-64,-32)),E=(0,t.sliceHex)(m,0,-64).slice(2).match(/.{1,64}/g),w=await Promise.all(E.map(y=>i.fallbackTransactionErrorMagicIdentifier.slice(2)!==y?o.request({method:"eth_getTransactionReceipt",params:[`0x${y}`]},{dedupe:!0}):void 0)),C=w.some(y=>y===null)?100:w.every(y=>(y==null?void 0:y.status)==="0x1")?200:w.every(y=>(y==null?void 0:y.status)==="0x0")?500:600;return{atomic:!1,chainId:(0,r.hexToNumber)(v),receipts:w.filter(Boolean),status:C,version:"2.0.0"}}return o.request({method:"wallet_getCallsStatus",params:[m]})}const{atomic:u=!1,chainId:l,receipts:d,version:h="2.0.0",...f}=await c(a.id),[g,p]=(()=>{const m=f.status;return m>=100&&m<200?["pending",m]:m>=200&&m<300?["success",m]:m>=300&&m<700?["failure",m]:m==="CONFIRMED"?["success",200]:m==="PENDING"?["pending",100]:[void 0,m]})();return{...f,atomic:u,chainId:l?(0,r.hexToNumber)(l):void 0,receipts:(d==null?void 0:d.map(m=>({...m,blockNumber:(0,r.hexToBigInt)(m.blockNumber),gasUsed:(0,r.hexToBigInt)(m.gasUsed),status:n.receiptStatuses[m.status]})))??[],statusCode:p,status:g,version:h}}return oE}var kF;function oX(){if(kF)return I0;kF=1,Object.defineProperty(I0,"__esModule",{value:!0}),I0.WaitForCallsStatusTimeoutError=void 0,I0.waitForCallsStatus=o;const t=_t(),e=qp(),r=A1(),n=kO(),i=Gn(),s=sX();async function o(c,u){const{id:l,pollingInterval:d=c.pollingInterval,status:h=({statusCode:w})=>w>=200,timeout:f=6e4}=u,g=(0,i.stringify)(["waitForCallsStatus",c.uid,l]),{promise:p,resolve:m,reject:b}=(0,n.withResolvers)();let v;const E=(0,e.observe)(g,{resolve:m,reject:b},w=>{const C=(0,r.poll)(async()=>{const y=_=>{clearTimeout(v),C(),_(),E()};try{const _=await(0,s.getCallsStatus)(c,{id:l});if(!h(_))return;y(()=>w.resolve(_))}catch(_){y(()=>w.reject(_))}},{interval:d,emitOnBegin:!0});return C});return v=f?setTimeout(()=>{E(),clearTimeout(v),b(new a({id:l}))},f):void 0,await p}class a extends t.BaseError{constructor({id:u}){super(`Timed out while waiting for call bundle with id "${u}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}return I0.WaitForCallsStatusTimeoutError=a,I0}var Hw={},aE={},NF;function aX(){if(NF)return aE;NF=1,Object.defineProperty(aE,"__esModule",{value:!0}),aE.uid=n;const t=256;let e=t,r;function n(i=11){if(!r||e+i>t*2){r="",e=0;for(let s=0;s<t;s++)r+=(256+Math.random()*256|0).toString(16).substring(1)}return r.substring(e,e+++i)}return aE}var $F;function bx(){if($F)return Hw;$F=1,Object.defineProperty(Hw,"__esModule",{value:!0}),Hw.createClient=r,Hw.rpcSchema=n;const t=sn(),e=aX();function r(i){const{batch:s,chain:o,ccipRead:a,key:c="base",name:u="Base Client",type:l="base"}=i,d=(o==null?void 0:o.blockTime)??12e3,h=Math.min(Math.max(Math.floor(d/2),500),4e3),f=i.pollingInterval??h,g=i.cacheTime??f,p=i.account?(0,t.parseAccount)(i.account):void 0,{config:m,request:b,value:v}=i.transport({chain:o,pollingInterval:f}),E={...m,...v},w={account:p,batch:s,cacheTime:g,ccipRead:a,chain:o,key:c,name:u,pollingInterval:f,request:b,transport:E,type:l,uid:(0,e.uid)()};function C(y){return _=>{const x=_(y);for(const T in w)delete x[T];const A={...y,...x};return Object.assign(A,{extend:C(A)})}}return Object.assign(w,{extend:C(w)})}function n(){return null}return Hw}var cE={},uE={},qw={},OT={},jF;function CIe(){return jF||(jF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.promiseCache=void 0,t.withDedupe=r;const e=y2();t.promiseCache=new e.LruMap(8192);function r(n,{enabled:i=!0,id:s}){if(!i||!s)return n();if(t.promiseCache.get(s))return t.promiseCache.get(s);const o=n().finally(()=>t.promiseCache.delete(s));return t.promiseCache.set(s,o),o}}(OT)),OT}var lE={},BF;function HO(){if(BF)return lE;BF=1,Object.defineProperty(lE,"__esModule",{value:!0}),lE.withRetry=e;const t=LO();function e(r,{delay:n=100,retryCount:i=2,shouldRetry:s=()=>!0}={}){return new Promise((o,a)=>{const c=async({count:u=0}={})=>{const l=async({error:d})=>{const h=typeof n=="function"?n({count:u,error:d}):n;h&&await(0,t.wait)(h),c({count:u+1})};try{const d=await r();o(d)}catch(d){if(u<i&&await s({count:u,error:d}))return l({error:d});a(d)}};c()})}return lE}var DF;function cX(){if(DF)return qw;DF=1,Object.defineProperty(qw,"__esModule",{value:!0}),qw.buildRequest=a,qw.shouldRetry=c;const t=_t(),e=ha(),r=Xd(),n=ze(),i=CIe(),s=HO(),o=Gn();function a(u,l={}){return async(d,h={})=>{var w;const{dedupe:f=!1,methods:g,retryDelay:p=150,retryCount:m=3,uid:b}={...l,...h},{method:v}=d;if((w=g==null?void 0:g.exclude)!=null&&w.includes(v))throw new r.MethodNotSupportedRpcError(new Error("method not supported"),{method:v});if(g!=null&&g.include&&!g.include.includes(v))throw new r.MethodNotSupportedRpcError(new Error("method not supported"),{method:v});const E=f?(0,n.stringToHex)(`${b}.${(0,o.stringify)(d)}`):void 0;return(0,i.withDedupe)(()=>(0,s.withRetry)(async()=>{try{return await u(d)}catch(C){const y=C;switch(y.code){case r.ParseRpcError.code:throw new r.ParseRpcError(y);case r.InvalidRequestRpcError.code:throw new r.InvalidRequestRpcError(y);case r.MethodNotFoundRpcError.code:throw new r.MethodNotFoundRpcError(y,{method:d.method});case r.InvalidParamsRpcError.code:throw new r.InvalidParamsRpcError(y);case r.InternalRpcError.code:throw new r.InternalRpcError(y);case r.InvalidInputRpcError.code:throw new r.InvalidInputRpcError(y);case r.ResourceNotFoundRpcError.code:throw new r.ResourceNotFoundRpcError(y);case r.ResourceUnavailableRpcError.code:throw new r.ResourceUnavailableRpcError(y);case r.TransactionRejectedRpcError.code:throw new r.TransactionRejectedRpcError(y);case r.MethodNotSupportedRpcError.code:throw new r.MethodNotSupportedRpcError(y,{method:d.method});case r.LimitExceededRpcError.code:throw new r.LimitExceededRpcError(y);case r.JsonRpcVersionUnsupportedError.code:throw new r.JsonRpcVersionUnsupportedError(y);case r.UserRejectedRequestError.code:throw new r.UserRejectedRequestError(y);case r.UnauthorizedProviderError.code:throw new r.UnauthorizedProviderError(y);case r.UnsupportedProviderMethodError.code:throw new r.UnsupportedProviderMethodError(y);case r.ProviderDisconnectedError.code:throw new r.ProviderDisconnectedError(y);case r.ChainDisconnectedError.code:throw new r.ChainDisconnectedError(y);case r.SwitchChainError.code:throw new r.SwitchChainError(y);case r.UnsupportedNonOptionalCapabilityError.code:throw new r.UnsupportedNonOptionalCapabilityError(y);case r.UnsupportedChainIdError.code:throw new r.UnsupportedChainIdError(y);case r.DuplicateIdError.code:throw new r.DuplicateIdError(y);case r.UnknownBundleIdError.code:throw new r.UnknownBundleIdError(y);case r.BundleTooLargeError.code:throw new r.BundleTooLargeError(y);case r.AtomicReadyWalletRejectedUpgradeError.code:throw new r.AtomicReadyWalletRejectedUpgradeError(y);case r.AtomicityNotSupportedError.code:throw new r.AtomicityNotSupportedError(y);case 5e3:throw new r.UserRejectedRequestError(y);default:throw C instanceof t.BaseError?C:new r.UnknownRpcError(y)}}},{delay:({count:C,error:y})=>{var _;if(y&&y instanceof e.HttpRequestError){const x=(_=y==null?void 0:y.headers)==null?void 0:_.get("Retry-After");if(x!=null&&x.match(/\d/))return Number.parseInt(x)*1e3}return~~(1<<C)*p},retryCount:m,shouldRetry:({error:C})=>c(C)}),{enabled:f,id:E})}}function c(u){return"code"in u&&typeof u.code=="number"?u.code===-1||u.code===r.LimitExceededRpcError.code||u.code===r.InternalRpcError.code:u instanceof e.HttpRequestError&&u.status?u.status===403||u.status===408||u.status===413||u.status===429||u.status===500||u.status===502||u.status===503||u.status===504:!0}return qw}var MF;function j2(){if(MF)return uE;MF=1,Object.defineProperty(uE,"__esModule",{value:!0}),uE.createTransport=r;const t=cX(),e=aX();function r({key:n,methods:i,name:s,request:o,retryCount:a=3,retryDelay:c=150,timeout:u,type:l},d){const h=(0,e.uid)();return{config:{key:n,methods:i,name:s,request:o,retryCount:a,retryDelay:c,timeout:u,type:l},request:(0,t.buildRequest)(o,{methods:i,retryCount:a,retryDelay:c,uid:h}),value:d}}return uE}var LF;function AIe(){if(LF)return cE;LF=1,Object.defineProperty(cE,"__esModule",{value:!0}),cE.custom=e;const t=j2();function e(r,n={}){const{key:i="custom",methods:s,name:o="Custom Provider",retryDelay:a}=n;return({retryCount:c})=>(0,t.createTransport)({key:i,methods:s,name:o,request:r.request.bind(r),retryCount:n.retryCount??c,retryDelay:a,type:"custom"})}return cE}var P0={},UF;function xIe(){if(UF)return P0;UF=1,Object.defineProperty(P0,"__esModule",{value:!0}),P0.fallback=i,P0.shouldThrow=s,P0.rankTransports=o;const t=nl(),e=Xd(),r=LO(),n=j2();function i(a,c={}){const{key:u="fallback",name:l="Fallback",rank:d=!1,shouldThrow:h=s,retryCount:f,retryDelay:g}=c;return({chain:p,pollingInterval:m=4e3,timeout:b,...v})=>{let E=a,w=()=>{};const C=(0,n.createTransport)({key:u,name:l,async request({method:y,params:_}){let x;const A=async(T=0)=>{const O=E[T]({...v,chain:p,retryCount:0,timeout:b});try{const k=await O.request({method:y,params:_});return w({method:y,params:_,response:k,transport:O,status:"success"}),k}catch(k){if(w({error:k,method:y,params:_,transport:O,status:"error"}),h(k)||T===E.length-1||(x??(x=E.slice(T+1).some(j=>{const{include:N,exclude:S}=j({chain:p}).config.methods||{};return N?N.includes(y):S?!S.includes(y):!0})),!x))throw k;return A(T+1)}};return A()},retryCount:f,retryDelay:g,type:"fallback"},{onResponse:y=>w=y,transports:E.map(y=>y({chain:p,retryCount:0}))});if(d){const y=typeof d=="object"?d:{};o({chain:p,interval:y.interval??m,onTransports:_=>E=_,ping:y.ping,sampleCount:y.sampleCount,timeout:y.timeout,transports:E,weights:y.weights})}return C}}function s(a){return!!("code"in a&&typeof a.code=="number"&&(a.code===e.TransactionRejectedRpcError.code||a.code===e.UserRejectedRequestError.code||t.ExecutionRevertedError.nodeMessage.test(a.message)||a.code===5e3))}function o({chain:a,interval:c=4e3,onTransports:u,ping:l,sampleCount:d=10,timeout:h=1e3,transports:f,weights:g={}}){const{stability:p=.7,latency:m=.3}=g,b=[],v=async()=>{const E=await Promise.all(f.map(async y=>{const _=y({chain:a,retryCount:0,timeout:h}),x=Date.now();let A,T;try{await(l?l({transport:_}):_.request({method:"net_listening"})),T=1}catch{T=0}finally{A=Date.now()}return{latency:A-x,success:T}}));b.push(E),b.length>d&&b.shift();const w=Math.max(...b.map(y=>Math.max(...y.map(({latency:_})=>_)))),C=f.map((y,_)=>{const x=b.map(j=>j[_].latency),T=1-x.reduce((j,N)=>j+N,0)/x.length/w,O=b.map(j=>j[_].success),k=O.reduce((j,N)=>j+N,0)/O.length;return k===0?[0,_]:[m*T+p*k,_]}).sort((y,_)=>_[0]-y[0]);u(C.map(([,y])=>f[y])),await(0,r.wait)(c),v()};v()}return P0}var dE={},zw={},FF;function qO(){if(FF)return zw;FF=1,Object.defineProperty(zw,"__esModule",{value:!0}),zw.UrlRequiredError=void 0;const t=_t();class e extends t.BaseError{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}return zw.UrlRequiredError=e,zw}var hE={},fE={},HF;function zO(){if(HF)return fE;HF=1,Object.defineProperty(fE,"__esModule",{value:!0}),fE.withTimeout=t;function t(e,{errorInstance:r=new Error("timed out"),timeout:n,signal:i}){return new Promise((s,o)=>{(async()=>{let a;try{const c=new AbortController;n>0&&(a=setTimeout(()=>{i?c.abort():o(r)},n)),s(await e({signal:(c==null?void 0:c.signal)||null}))}catch(c){(c==null?void 0:c.name)==="AbortError"&&o(r),o(c)}finally{clearTimeout(a)}})()})}return fE}var Ww={},qF;function uX(){if(qF)return Ww;qF=1,Object.defineProperty(Ww,"__esModule",{value:!0}),Ww.idCache=void 0;function t(){return{current:0,take(){return this.current++},reset(){this.current=0}}}return Ww.idCache=t(),Ww}var zF;function WO(){if(zF)return hE;zF=1,Object.defineProperty(hE,"__esModule",{value:!0}),hE.getHttpRpcClient=i;const t=ha(),e=zO(),r=Gn(),n=uX();function i(s,o={}){return{async request(a){var m;const{body:c,onRequest:u=o.onRequest,onResponse:l=o.onResponse,timeout:d=o.timeout??1e4}=a,h={...o.fetchOptions??{},...a.fetchOptions??{}},{headers:f,method:g,signal:p}=h;try{const b=await(0,e.withTimeout)(async({signal:E})=>{const w={...h,body:Array.isArray(c)?(0,r.stringify)(c.map(x=>({jsonrpc:"2.0",id:x.id??n.idCache.take(),...x}))):(0,r.stringify)({jsonrpc:"2.0",id:c.id??n.idCache.take(),...c}),headers:{"Content-Type":"application/json",...f},method:g||"POST",signal:p||(d>0?E:null)},C=new Request(s,w),y=await(u==null?void 0:u(C,w))??{...w,url:s};return await fetch(y.url??s,y)},{errorInstance:new t.TimeoutError({body:c,url:s}),timeout:d,signal:!0});l&&await l(b);let v;if((m=b.headers.get("Content-Type"))!=null&&m.startsWith("application/json"))v=await b.json();else{v=await b.text();try{v=JSON.parse(v||"{}")}catch(E){if(b.ok)throw E;v={error:v}}}if(!b.ok)throw new t.HttpRequestError({body:c,details:(0,r.stringify)(v.error)||b.statusText,headers:b.headers,status:b.status,url:s});return v}catch(b){throw b instanceof t.HttpRequestError||b instanceof t.TimeoutError?b:new t.HttpRequestError({body:c,cause:b,url:s})}}}}return hE}var WF;function SIe(){if(WF)return dE;WF=1,Object.defineProperty(dE,"__esModule",{value:!0}),dE.http=s;const t=ha(),e=qO(),r=NO(),n=WO(),i=j2();function s(o,a={}){const{batch:c,fetchOptions:u,key:l="http",methods:d,name:h="HTTP JSON-RPC",onFetchRequest:f,onFetchResponse:g,retryDelay:p,raw:m}=a;return({chain:b,retryCount:v,timeout:E})=>{const{batchSize:w=1e3,wait:C=0}=typeof c=="object"?c:{},y=a.retryCount??v,_=E??a.timeout??1e4,x=o||(b==null?void 0:b.rpcUrls.default.http[0]);if(!x)throw new e.UrlRequiredError;const A=(0,n.getHttpRpcClient)(x,{fetchOptions:u,onRequest:f,onResponse:g,timeout:_});return(0,i.createTransport)({key:l,methods:d,name:h,async request({method:T,params:O}){const k={method:T,params:O},{schedule:j}=(0,r.createBatchScheduler)({id:x,wait:C,shouldSplitBatch(I){return I.length>w},fn:I=>A.request({body:I}),sort:(I,B)=>I.id-B.id}),N=async I=>c?j(I):[await A.request({body:I})],[{error:S,result:P}]=await N(k);if(m)return{error:S,result:P};if(S)throw new t.RpcRequestError({body:k,error:S,url:x});return P},retryCount:y,retryDelay:p,timeout:_,type:"http"},{fetchOptions:u,url:x})}}return dE}var pE={},gE={},mE={},wE={},VF;function VO(){if(VF)return wE;VF=1,Object.defineProperty(wE,"__esModule",{value:!0}),wE.isNullUniversalResolverError=n;const t=XA(),e=_t(),r=Qd();function n(i,s){var a,c,u,l,d,h;if(!(i instanceof e.BaseError))return!1;const o=i.walk(f=>f instanceof r.ContractFunctionRevertedError);return o instanceof r.ContractFunctionRevertedError?!!(((a=o.data)==null?void 0:a.errorName)==="ResolverNotFound"||((c=o.data)==null?void 0:c.errorName)==="ResolverWildcardNotSupported"||((u=o.data)==null?void 0:u.errorName)==="ResolverNotContract"||((l=o.data)==null?void 0:l.errorName)==="ResolverError"||((d=o.data)==null?void 0:d.errorName)==="HttpError"||(h=o.reason)!=null&&h.includes("Wildcard on non-extended resolvers is not supported")||s==="reverse"&&o.reason===t.panicReasons[50]):!1}return wE}var bE={},yE={},GF;function lX(){if(GF)return yE;GF=1,Object.defineProperty(yE,"__esModule",{value:!0}),yE.encodedLabelToLabelhash=e;const t=ki();function e(r){if(r.length!==66||r.indexOf("[")!==0||r.indexOf("]")!==65)return null;const n=`0x${r.slice(1,65)}`;return(0,t.isHex)(n)?n:null}return yE}var KF;function GO(){if(KF)return bE;KF=1,Object.defineProperty(bE,"__esModule",{value:!0}),bE.namehash=s;const t=oi(),e=Tr(),r=ze(),n=ns(),i=lX();function s(o){let a=new Uint8Array(32).fill(0);if(!o)return(0,r.bytesToHex)(a);const c=o.split(".");for(let u=c.length-1;u>=0;u-=1){const l=(0,i.encodedLabelToLabelhash)(c[u]),d=l?(0,e.toBytes)(l):(0,n.keccak256)((0,e.stringToBytes)(c[u]),"bytes");a=(0,n.keccak256)((0,t.concat)([a,d]),"bytes")}return(0,r.bytesToHex)(a)}return bE}var vE={},_E={},ZF;function TIe(){if(ZF)return _E;ZF=1,Object.defineProperty(_E,"__esModule",{value:!0}),_E.encodeLabelhash=t;function t(e){return`[${e.slice(2)}]`}return _E}var EE={},YF;function dX(){if(YF)return EE;YF=1,Object.defineProperty(EE,"__esModule",{value:!0}),EE.labelhash=i;const t=Tr(),e=ze(),r=ns(),n=lX();function i(s){const o=new Uint8Array(32).fill(0);return s?(0,n.encodedLabelToLabelhash)(s)||(0,r.keccak256)((0,t.stringToBytes)(s)):(0,e.bytesToHex)(o)}return EE}var JF;function yx(){if(JF)return vE;JF=1,Object.defineProperty(vE,"__esModule",{value:!0}),vE.packetToBytes=n;const t=Tr(),e=TIe(),r=dX();function n(i){const s=i.replace(/^\.|\.$/gm,"");if(s.length===0)return new Uint8Array(1);const o=new Uint8Array((0,t.stringToBytes)(s).byteLength+2);let a=0;const c=s.split(".");for(let u=0;u<c.length;u++){let l=(0,t.stringToBytes)(c[u]);l.byteLength>255&&(l=(0,t.stringToBytes)((0,e.encodeLabelhash)((0,r.labelhash)(c[u])))),o[a]=l.length,o.set(l,a+1),a+=l.length+1}return o.byteLength!==a+1?o.slice(0,a+1):o}return vE}var QF;function IIe(){if(QF)return mE;QF=1,Object.defineProperty(mE,"__esModule",{value:!0}),mE.getEnsAddress=h;const t=rh(),e=al(),r=Bs(),n=nh(),i=tl(),s=ze(),o=VO(),a=DO(),c=GO(),u=yx(),l=ur(),d=ul();async function h(f,g){const{blockNumber:p,blockTag:m,coinType:b,name:v,gatewayUrls:E,strict:w}=g,{chain:C}=f,y=(()=>{if(g.universalResolverAddress)return g.universalResolverAddress;if(!C)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,n.getChainContractAddress)({blockNumber:p,chain:C,contract:"ensUniversalResolver"})})(),_=C==null?void 0:C.ensTlds;if(_&&!_.some(x=>v.endsWith(x)))return null;try{const x=(0,r.encodeFunctionData)({abi:t.addressResolverAbi,functionName:"addr",...b!=null?{args:[(0,c.namehash)(v),BigInt(b)]}:{args:[(0,c.namehash)(v)]}}),A={address:y,abi:t.universalResolverResolveAbi,functionName:"resolve",args:[(0,s.toHex)((0,u.packetToBytes)(v)),x,E??[a.localBatchGatewayUrl]],blockNumber:p,blockTag:m},O=await(0,l.getAction)(f,d.readContract,"readContract")(A);if(O[0]==="0x")return null;const k=(0,e.decodeFunctionResult)({abi:t.addressResolverAbi,args:b!=null?[(0,c.namehash)(v),BigInt(b)]:void 0,functionName:"addr",data:O[0]});return k==="0x"||(0,i.trim)(k)==="0x00"?null:k}catch(x){if(w)throw x;if((0,o.isNullUniversalResolverError)(x,"resolve"))return null;throw x}}return mE}var CE={},AE={},Ao={},xo={},XF;function hX(){if(XF)return xo;XF=1,Object.defineProperty(xo,"__esModule",{value:!0}),xo.EnsAvatarUnsupportedNamespaceError=xo.EnsAvatarUriResolutionError=xo.EnsAvatarInvalidNftUriError=xo.EnsAvatarInvalidMetadataError=void 0;const t=_t();class e extends t.BaseError{constructor({data:o}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(o)}`],name:"EnsAvatarInvalidMetadataError"})}}xo.EnsAvatarInvalidMetadataError=e;class r extends t.BaseError{constructor({reason:o}){super(`ENS NFT avatar URI is invalid. ${o}`,{name:"EnsAvatarInvalidNftUriError"})}}xo.EnsAvatarInvalidNftUriError=r;class n extends t.BaseError{constructor({uri:o}){super(`Unable to resolve ENS avatar URI "${o}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}xo.EnsAvatarUriResolutionError=n;class i extends t.BaseError{constructor({namespace:o}){super(`ENS NFT avatar namespace "${o}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}return xo.EnsAvatarUnsupportedNamespaceError=i,xo}var eH;function PIe(){if(eH)return Ao;eH=1,Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.isImageUri=o,Ao.getGateway=a,Ao.resolveAvatarUri=c,Ao.getJsonImage=u,Ao.getMetadataAvatarUri=l,Ao.parseAvatarUri=d,Ao.parseNftUri=h,Ao.getNftTokenUri=f;const t=ul(),e=hX(),r=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,n=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,i=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,s=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function o(g){try{const p=await fetch(g,{method:"HEAD"});if(p.status===200){const m=p.headers.get("content-type");return m==null?void 0:m.startsWith("image/")}return!1}catch(p){return typeof p=="object"&&typeof p.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(m=>{const b=new Image;b.onload=()=>{m(!0)},b.onerror=()=>{m(!1)},b.src=g})}}function a(g,p){return g?g.endsWith("/")?g.slice(0,-1):g:p}function c({uri:g,gatewayUrls:p}){const m=i.test(g);if(m)return{uri:g,isOnChain:!0,isEncoded:m};const b=a(p==null?void 0:p.ipfs,"https://ipfs.io"),v=a(p==null?void 0:p.arweave,"https://arweave.net"),E=g.match(r),{protocol:w,subpath:C,target:y,subtarget:_=""}=(E==null?void 0:E.groups)||{},x=w==="ipns:/"||C==="ipns/",A=w==="ipfs:/"||C==="ipfs/"||n.test(g);if(g.startsWith("http")&&!x&&!A){let O=g;return p!=null&&p.arweave&&(O=g.replace(/https:\/\/arweave.net/g,p==null?void 0:p.arweave)),{uri:O,isOnChain:!1,isEncoded:!1}}if((x||A)&&y)return{uri:`${b}/${x?"ipns":"ipfs"}/${y}${_}`,isOnChain:!1,isEncoded:!1};if(w==="ar:/"&&y)return{uri:`${v}/${y}${_||""}`,isOnChain:!1,isEncoded:!1};let T=g.replace(s,"");if(T.startsWith("<svg")&&(T=`data:image/svg+xml;base64,${btoa(T)}`),T.startsWith("data:")||T.startsWith("{"))return{uri:T,isOnChain:!0,isEncoded:!1};throw new e.EnsAvatarUriResolutionError({uri:g})}function u(g){if(typeof g!="object"||!("image"in g)&&!("image_url"in g)&&!("image_data"in g))throw new e.EnsAvatarInvalidMetadataError({data:g});return g.image||g.image_url||g.image_data}async function l({gatewayUrls:g,uri:p}){try{const m=await fetch(p).then(v=>v.json());return await d({gatewayUrls:g,uri:u(m)})}catch{throw new e.EnsAvatarUriResolutionError({uri:p})}}async function d({gatewayUrls:g,uri:p}){const{uri:m,isOnChain:b}=c({uri:p,gatewayUrls:g});if(b||await o(m))return m;throw new e.EnsAvatarUriResolutionError({uri:p})}function h(g){let p=g;p.startsWith("did:nft:")&&(p=p.replace("did:nft:","").replace(/_/g,"/"));const[m,b,v]=p.split("/"),[E,w]=m.split(":"),[C,y]=b.split(":");if(!E||E.toLowerCase()!=="eip155")throw new e.EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!w)throw new e.EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!y)throw new e.EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!v)throw new e.EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!C)throw new e.EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(w),namespace:C.toLowerCase(),contractAddress:y,tokenID:v}}async function f(g,{nft:p}){if(p.namespace==="erc721")return(0,t.readContract)(g,{address:p.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(p.tokenID)]});if(p.namespace==="erc1155")return(0,t.readContract)(g,{address:p.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(p.tokenID)]});throw new e.EnsAvatarUnsupportedNamespaceError({namespace:p.namespace})}return Ao}var tH;function OIe(){if(tH)return AE;tH=1,Object.defineProperty(AE,"__esModule",{value:!0}),AE.parseAvatarRecord=e;const t=PIe();async function e(n,{gatewayUrls:i,record:s}){return/eip155:/i.test(s)?r(n,{gatewayUrls:i,record:s}):(0,t.parseAvatarUri)({uri:s,gatewayUrls:i})}async function r(n,{gatewayUrls:i,record:s}){const o=(0,t.parseNftUri)(s),a=await(0,t.getNftTokenUri)(n,{nft:o}),{uri:c,isOnChain:u,isEncoded:l}=(0,t.resolveAvatarUri)({uri:a,gatewayUrls:i});if(u&&(c.includes("data:application/json;base64,")||c.startsWith("{"))){const h=l?atob(c.replace("data:application/json;base64,","")):c,f=JSON.parse(h);return(0,t.parseAvatarUri)({uri:(0,t.getJsonImage)(f),gatewayUrls:i})}let d=o.tokenID;return o.namespace==="erc1155"&&(d=d.replace("0x","").padStart(64,"0")),(0,t.getMetadataAvatarUri)({gatewayUrls:i,uri:c.replace(/(?:0x)?{id}/,d)})}return AE}var xE={},rH;function fX(){if(rH)return xE;rH=1,Object.defineProperty(xE,"__esModule",{value:!0}),xE.getEnsText=d;const t=rh(),e=al(),r=Bs(),n=nh(),i=ze(),s=VO(),o=DO(),a=GO(),c=yx(),u=ur(),l=ul();async function d(h,f){const{blockNumber:g,blockTag:p,key:m,name:b,gatewayUrls:v,strict:E}=f,{chain:w}=h,C=(()=>{if(f.universalResolverAddress)return f.universalResolverAddress;if(!w)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,n.getChainContractAddress)({blockNumber:g,chain:w,contract:"ensUniversalResolver"})})(),y=w==null?void 0:w.ensTlds;if(y&&!y.some(_=>b.endsWith(_)))return null;try{const _={address:C,abi:t.universalResolverResolveAbi,functionName:"resolve",args:[(0,i.toHex)((0,c.packetToBytes)(b)),(0,r.encodeFunctionData)({abi:t.textResolverAbi,functionName:"text",args:[(0,a.namehash)(b),m]}),v??[o.localBatchGatewayUrl]],blockNumber:g,blockTag:p},A=await(0,u.getAction)(h,l.readContract,"readContract")(_);if(A[0]==="0x")return null;const T=(0,e.decodeFunctionResult)({abi:t.textResolverAbi,functionName:"text",data:A[0]});return T===""?null:T}catch(_){if(E)throw _;if((0,s.isNullUniversalResolverError)(_,"resolve"))return null;throw _}}return xE}var nH;function RIe(){if(nH)return CE;nH=1,Object.defineProperty(CE,"__esModule",{value:!0}),CE.getEnsAvatar=n;const t=OIe(),e=ur(),r=fX();async function n(i,{blockNumber:s,blockTag:o,assetGatewayUrls:a,name:c,gatewayUrls:u,strict:l,universalResolverAddress:d}){const h=await(0,e.getAction)(i,r.getEnsText,"getEnsText")({blockNumber:s,blockTag:o,key:"avatar",name:c,universalResolverAddress:d,gatewayUrls:u,strict:l});if(!h)return null;try{return await(0,t.parseAvatarRecord)(i,{record:h,gatewayUrls:a})}catch{return null}}return CE}var SE={},iH;function kIe(){if(iH)return SE;iH=1,Object.defineProperty(SE,"__esModule",{value:!0}),SE.getEnsName=a;const t=rh(),e=nh(),r=ze(),n=VO(),i=yx(),s=ur(),o=ul();async function a(c,{address:u,blockNumber:l,blockTag:d,gatewayUrls:h,strict:f,universalResolverAddress:g}){let p=g;if(!p){if(!c.chain)throw new Error("client chain not configured. universalResolverAddress is required.");p=(0,e.getChainContractAddress)({blockNumber:l,chain:c.chain,contract:"ensUniversalResolver"})}const m=`${u.toLowerCase().substring(2)}.addr.reverse`;try{const b={address:p,abi:t.universalResolverReverseAbi,functionName:"reverse",args:[(0,r.toHex)((0,i.packetToBytes)(m))],blockNumber:l,blockTag:d},v=(0,s.getAction)(c,o.readContract,"readContract"),[E,w]=h?await v({...b,args:[...b.args,h]}):await v(b);return u.toLowerCase()!==w.toLowerCase()?null:E}catch(b){if(f)throw b;if((0,n.isNullUniversalResolverError)(b,"reverse"))return null;throw b}}return SE}var TE={},sH;function NIe(){if(sH)return TE;sH=1,Object.defineProperty(TE,"__esModule",{value:!0}),TE.getEnsResolver=s;const t=nh(),e=ze(),r=yx(),n=ur(),i=ul();async function s(o,a){const{blockNumber:c,blockTag:u,name:l}=a,{chain:d}=o,h=(()=>{if(a.universalResolverAddress)return a.universalResolverAddress;if(!d)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,t.getChainContractAddress)({blockNumber:c,chain:d,contract:"ensUniversalResolver"})})(),f=d==null?void 0:d.ensTlds;if(f&&!f.some(p=>l.endsWith(p)))throw new Error(`${l} is not a valid ENS TLD (${f==null?void 0:f.join(", ")}) for chain "${d.name}" (id: ${d.id}).`);const[g]=await(0,n.getAction)(o,i.readContract,"readContract")({address:h,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,e.toHex)((0,r.packetToBytes)(l))],blockNumber:c,blockTag:u});return g}return TE}var IE={},oH;function pX(){if(oH)return IE;oH=1,Object.defineProperty(IE,"__esModule",{value:!0}),IE.createAccessList=o;const t=sn(),e=ze(),r=RO(),n=_1(),i=il(),s=sl();async function o(a,c){var _,x,A;const{account:u=a.account,blockNumber:l,blockTag:d="latest",blobs:h,data:f,gas:g,gasPrice:p,maxFeePerBlobGas:m,maxFeePerGas:b,maxPriorityFeePerGas:v,to:E,value:w,...C}=c,y=u?(0,t.parseAccount)(u):void 0;try{(0,s.assertRequest)(c);const O=(typeof l=="bigint"?(0,e.numberToHex)(l):void 0)||d,k=(A=(x=(_=a.chain)==null?void 0:_.formatters)==null?void 0:x.transactionRequest)==null?void 0:A.format,N=(k||i.formatTransactionRequest)({...(0,n.extract)(C,{format:k}),from:y==null?void 0:y.address,blobs:h,data:f,gas:g,gasPrice:p,maxFeePerBlobGas:m,maxFeePerGas:b,maxPriorityFeePerGas:v,to:E,value:w}),S=await a.request({method:"eth_createAccessList",params:[N,O]});return{accessList:S.accessList,gasUsed:BigInt(S.gasUsed)}}catch(T){throw(0,r.getCallError)(T,{...c,account:y,chain:a.chain})}}return IE}var PE={},aH;function $Ie(){if(aH)return PE;aH=1,Object.defineProperty(PE,"__esModule",{value:!0}),PE.createBlockFilter=e;const t=QA();async function e(r){const n=(0,t.createFilterRequestScope)(r,{method:"eth_newBlockFilter"}),i=await r.request({method:"eth_newBlockFilter"});return{id:i,request:n(i),type:"block"}}return PE}var OE={},cH;function gX(){if(cH)return OE;cH=1,Object.defineProperty(OE,"__esModule",{value:!0}),OE.createEventFilter=n;const t=Up(),e=ze(),r=QA();async function n(i,{address:s,args:o,event:a,events:c,fromBlock:u,strict:l,toBlock:d}={}){const h=c??(a?[a]:void 0),f=(0,r.createFilterRequestScope)(i,{method:"eth_newFilter"});let g=[];h&&(g=[h.flatMap(b=>(0,t.encodeEventTopics)({abi:[b],eventName:b.name,args:o}))],a&&(g=g[0]));const p=await i.request({method:"eth_newFilter",params:[{address:s,fromBlock:typeof u=="bigint"?(0,e.numberToHex)(u):u,toBlock:typeof d=="bigint"?(0,e.numberToHex)(d):d,...g.length?{topics:g}:{}}]});return{abi:h,args:o,eventName:a?a.name:void 0,fromBlock:u,id:p,request:f(p),strict:!!l,toBlock:d,type:"event"}}return OE}var RE={},uH;function mX(){if(uH)return RE;uH=1,Object.defineProperty(RE,"__esModule",{value:!0}),RE.createPendingTransactionFilter=e;const t=QA();async function e(r){const n=(0,t.createFilterRequestScope)(r,{method:"eth_newPendingTransactionFilter"}),i=await r.request({method:"eth_newPendingTransactionFilter"});return{id:i,request:n(i),type:"transaction"}}return RE}var kE={},lH;function jIe(){if(lH)return kE;lH=1,Object.defineProperty(kE,"__esModule",{value:!0}),kE.getBlobBaseFee=t;async function t(e){const r=await e.request({method:"eth_blobBaseFee"});return BigInt(r)}return kE}var NE={},dH;function BIe(){if(dH)return NE;dH=1,Object.defineProperty(NE,"__esModule",{value:!0}),NE.getBlockTransactionCount=r;const t=nn(),e=ze();async function r(n,{blockHash:i,blockNumber:s,blockTag:o="latest"}={}){const a=s!==void 0?(0,e.numberToHex)(s):void 0;let c;return i?c=await n.request({method:"eth_getBlockTransactionCountByHash",params:[i]},{dedupe:!0}):c=await n.request({method:"eth_getBlockTransactionCountByNumber",params:[a||o]},{dedupe:!!a}),(0,t.hexToNumber)(c)}return NE}var $E={},hH;function DIe(){if(hH)return $E;hH=1,Object.defineProperty($E,"__esModule",{value:!0}),$E.getCode=e;const t=ze();async function e(r,{address:n,blockNumber:i,blockTag:s="latest"}){const o=i!==void 0?(0,t.numberToHex)(i):void 0,a=await r.request({method:"eth_getCode",params:[n,o||s]},{dedupe:!!o});if(a!=="0x")return a}return $E}var jE={},Vw={},fH;function MIe(){if(fH)return Vw;fH=1,Object.defineProperty(Vw,"__esModule",{value:!0}),Vw.Eip712DomainNotFoundError=void 0;const t=_t();class e extends t.BaseError{constructor({address:n}){super(`No EIP-712 domain found on contract "${n}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${n}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}return Vw.Eip712DomainNotFoundError=e,Vw}var pH;function LIe(){if(pH)return jE;pH=1,Object.defineProperty(jE,"__esModule",{value:!0}),jE.getEip712Domain=n;const t=MIe(),e=ur(),r=ul();async function n(s,o){const{address:a,factory:c,factoryData:u}=o;try{const[l,d,h,f,g,p,m]=await(0,e.getAction)(s,r.readContract,"readContract")({abi:i,address:a,functionName:"eip712Domain",factory:c,factoryData:u});return{domain:{name:d,version:h,chainId:Number(f),verifyingContract:g,salt:p},extensions:m,fields:l}}catch(l){const d=l;throw d.name==="ContractFunctionExecutionError"&&d.cause.name==="ContractFunctionZeroDataError"?new t.Eip712DomainNotFoundError({address:a}):d}}const i=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];return jE}var BE={},DE={},gH;function UIe(){if(gH)return DE;gH=1,Object.defineProperty(DE,"__esModule",{value:!0}),DE.formatFeeHistory=t;function t(e){var r;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(r=e.reward)==null?void 0:r.map(n=>n.map(i=>BigInt(i)))}}return DE}var mH;function FIe(){if(mH)return BE;mH=1,Object.defineProperty(BE,"__esModule",{value:!0}),BE.getFeeHistory=r;const t=ze(),e=UIe();async function r(n,{blockCount:i,blockNumber:s,blockTag:o="latest",rewardPercentiles:a}){const c=typeof s=="bigint"?(0,t.numberToHex)(s):void 0,u=await n.request({method:"eth_feeHistory",params:[(0,t.numberToHex)(i),c||o,a]},{dedupe:!!c});return(0,e.formatFeeHistory)(u)}return BE}var ME={},wH;function HIe(){if(wH)return ME;wH=1,Object.defineProperty(ME,"__esModule",{value:!0}),ME.getFilterLogs=r;const t=O2(),e=ol();async function r(n,{filter:i}){const s=i.strict??!1,a=(await i.request({method:"eth_getFilterLogs",params:[i.id]})).map(c=>(0,e.formatLog)(c));return i.abi?(0,t.parseEventLogs)({abi:i.abi,logs:a,strict:s}):a}return ME}var LE={},UE={},RT={},FE={},bH;function wX(){if(bH)return FE;bH=1,Object.defineProperty(FE,"__esModule",{value:!0}),FE.defineChain=t;function t(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}return FE}var HE={},yH;function bX(){if(yH)return HE;yH=1,Object.defineProperty(HE,"__esModule",{value:!0}),HE.extractChain=t;function t({chains:e,id:r}){return e.find(n=>n.id===r)}return HE}var O0={},qE={},kT={},vH;function yX(){return vH||(vH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.socketClientCache=void 0,t.getSocketRpcClient=s;const e=ha(),r=NO(),n=zO(),i=uX();t.socketClientCache=new Map;async function s(o){const{getSocket:a,keepAlive:c=!0,key:u="socket",reconnect:l=!0,url:d}=o,{interval:h=3e4}=typeof c=="object"?c:{},{attempts:f=5,delay:g=2e3}=typeof l=="object"?l:{};let p=t.socketClientCache.get(`${u}:${d}`);if(p)return p;let m=0;const{schedule:b}=(0,r.createBatchScheduler)({id:`${u}:${d}`,fn:async()=>{const w=new Map,C=new Map;let y,_,x;async function A(){const T=await a({onClose(){var O,k;for(const j of w.values())(O=j.onError)==null||O.call(j,new e.SocketClosedError({url:d}));for(const j of C.values())(k=j.onError)==null||k.call(j,new e.SocketClosedError({url:d}));l&&m<f?setTimeout(async()=>{m++,await A().catch(console.error)},g):(w.clear(),C.clear())},onError(O){var k,j;y=O;for(const N of w.values())(k=N.onError)==null||k.call(N,y);for(const N of C.values())(j=N.onError)==null||j.call(N,y);p==null||p.close(),l&&m<f?setTimeout(async()=>{m++,await A().catch(console.error)},g):(w.clear(),C.clear())},onOpen(){y=void 0,m=0},onResponse(O){const k=O.method==="eth_subscription",j=k?O.params.subscription:O.id,N=k?C:w,S=N.get(j);S&&S.onResponse(O),k||N.delete(j)}});return _=T,c&&(x&&clearInterval(x),x=setInterval(()=>{var O;return(O=_.ping)==null?void 0:O.call(_)},h)),T}return await A(),y=void 0,p={close(){x&&clearInterval(x),_.close(),t.socketClientCache.delete(`${u}:${d}`)},get socket(){return _},request({body:T,onError:O,onResponse:k}){y&&O&&O(y);const j=T.id??i.idCache.take(),N=S=>{var P;typeof S.id=="number"&&j!==S.id||(T.method==="eth_subscribe"&&typeof S.result=="string"&&C.set(S.result,{onResponse:N,onError:O}),T.method==="eth_unsubscribe"&&C.delete((P=T.params)==null?void 0:P[0]),k(S))};w.set(j,{onResponse:N,onError:O});try{_.request({body:{jsonrpc:"2.0",id:j,...T}})}catch(S){O==null||O(S)}},requestAsync({body:T,timeout:O=1e4}){return(0,n.withTimeout)(()=>new Promise((k,j)=>this.request({body:T,onError:j,onResponse:k})),{errorInstance:new e.TimeoutError({body:T,url:d}),timeout:O})},requests:w,subscriptions:C,url:d},t.socketClientCache.set(`${u}:${d}`,p),[p]}}),[v,[E]]=await b();return E}}(kT)),kT}const qIe=CV(a6e);var _H;function KO(){if(_H)return qE;_H=1,Object.defineProperty(qE,"__esModule",{value:!0}),qE.getWebSocketRpcClient=r;const t=ha(),e=yX();async function r(n,i={}){const{keepAlive:s,reconnect:o}=i;return(0,e.getSocketRpcClient)({async getSocket({onClose:a,onError:c,onOpen:u,onResponse:l}){const d=await Promise.resolve().then(()=>qIe).then(m=>m.WebSocket),h=new d(n);function f(){h.removeEventListener("close",f),h.removeEventListener("message",g),h.removeEventListener("error",c),h.removeEventListener("open",u),a()}function g({data:m}){try{const b=JSON.parse(m);l(b)}catch(b){c(b)}}h.addEventListener("close",f),h.addEventListener("message",g),h.addEventListener("error",c),h.addEventListener("open",u),h.readyState===d.CONNECTING&&await new Promise((m,b)=>{h&&(h.onopen=m,h.onerror=b)});const{close:p}=h;return Object.assign(h,{close(){p.bind(h)(),f()},ping(){try{if(h.readyState===h.CLOSED||h.readyState===h.CLOSING)throw new t.WebSocketRequestError({url:h.url,cause:new t.SocketClosedError({url:h.url})});const m={jsonrpc:"2.0",method:"net_version",params:[]};h.send(JSON.stringify(m))}catch(m){c(m)}},request({body:m}){if(h.readyState===h.CLOSED||h.readyState===h.CLOSING)throw new t.WebSocketRequestError({body:m,url:h.url,cause:new t.SocketClosedError({url:h.url})});return h.send(JSON.stringify(m))}})},keepAlive:s,reconnect:o,url:n})}return qE}var EH;function vX(){if(EH)return O0;EH=1,Object.defineProperty(O0,"__esModule",{value:!0}),O0.rpc=void 0,O0.getSocket=i;const t=WO(),e=KO();function r(s,{body:o,onError:a,onResponse:c}){return s.request({body:o,onError:a,onResponse:c}),s}async function n(s,{body:o,timeout:a=1e4}){return s.requestAsync({body:o,timeout:a})}async function i(s){const o=await(0,e.getWebSocketRpcClient)(s);return Object.assign(o.socket,{requests:o.requests,subscriptions:o.subscriptions})}return O0.rpc={http(s,o){return(0,t.getHttpRpcClient)(s).request(o)},webSocket:r,webSocketAsync:n},O0}var xh={},zc={},CH;function _X(){if(CH)return zc;CH=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.InvalidStructTypeError=zc.InvalidPrimaryTypeError=zc.InvalidDomainError=void 0;const t=Gn(),e=_t();class r extends e.BaseError{constructor({domain:o}){super(`Invalid domain "${(0,t.stringify)(o)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}zc.InvalidDomainError=r;class n extends e.BaseError{constructor({primaryType:o,types:a}){super(`Invalid primary type \`${o}\` must be one of \`${JSON.stringify(Object.keys(a))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}zc.InvalidPrimaryTypeError=n;class i extends e.BaseError{constructor({type:o}){super(`Struct type "${o}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}return zc.InvalidStructTypeError=i,zc}var Sh={},AH;function B2(){if(AH)return Sh;AH=1,Object.defineProperty(Sh,"__esModule",{value:!0}),Sh.hashTypedData=s,Sh.hashDomain=o,Sh.hashStruct=a,Sh.encodeType=l;const t=da(),e=oi(),r=ze(),n=ns(),i=vx();function s(f){const{domain:g={},message:p,primaryType:m}=f,b={EIP712Domain:(0,i.getTypesForEIP712Domain)({domain:g}),...f.types};(0,i.validateTypedData)({domain:g,message:p,primaryType:m,types:b});const v=["0x1901"];return g&&v.push(o({domain:g,types:b})),m!=="EIP712Domain"&&v.push(a({data:p,primaryType:m,types:b})),(0,n.keccak256)((0,e.concat)(v))}function o({domain:f,types:g}){return a({data:f,primaryType:"EIP712Domain",types:g})}function a({data:f,primaryType:g,types:p}){const m=c({data:f,primaryType:g,types:p});return(0,n.keccak256)(m)}function c({data:f,primaryType:g,types:p}){const m=[{type:"bytes32"}],b=[u({primaryType:g,types:p})];for(const v of p[g]){const[E,w]=h({types:p,name:v.name,type:v.type,value:f[v.name]});m.push(E),b.push(w)}return(0,t.encodeAbiParameters)(m,b)}function u({primaryType:f,types:g}){const p=(0,r.toHex)(l({primaryType:f,types:g}));return(0,n.keccak256)(p)}function l({primaryType:f,types:g}){let p="";const m=d({primaryType:f,types:g});m.delete(f);const b=[f,...Array.from(m).sort()];for(const v of b)p+=`${v}(${g[v].map(({name:E,type:w})=>`${w} ${E}`).join(",")})`;return p}function d({primaryType:f,types:g},p=new Set){const m=f.match(/^\w*/u),b=m==null?void 0:m[0];if(p.has(b)||g[b]===void 0)return p;p.add(b);for(const v of g[b])d({primaryType:v.type,types:g},p);return p}function h({types:f,name:g,type:p,value:m}){if(f[p]!==void 0)return[{type:"bytes32"},(0,n.keccak256)(c({data:m,primaryType:p,types:f}))];if(p==="bytes")return m=`0x${(m.length%2?"0":"")+m.slice(2)}`,[{type:"bytes32"},(0,n.keccak256)(m)];if(p==="string")return[{type:"bytes32"},(0,n.keccak256)((0,r.toHex)(m))];if(p.lastIndexOf("]")===p.length-1){const b=p.slice(0,p.lastIndexOf("[")),v=m.map(E=>h({name:g,type:b,types:f,value:E}));return[{type:"bytes32"},(0,n.keccak256)((0,t.encodeAbiParameters)(v.map(([E])=>E),v.map(([,E])=>E)))]}return[{type:p},m]}return Sh}var xH;function vx(){if(xH)return xh;xH=1,Object.defineProperty(xh,"__esModule",{value:!0}),xh.serializeTypedData=u,xh.validateTypedData=l,xh.getTypesForEIP712Domain=d,xh.domainSeparator=h;const t=$r(),e=la(),r=_X(),n=is(),i=rs(),s=ze(),o=JA(),a=B2(),c=Gn();function u(g){const{domain:p,message:m,primaryType:b,types:v}=g,E=(y,_)=>{const x={..._};for(const A of y){const{name:T,type:O}=A;O==="address"&&(x[T]=x[T].toLowerCase())}return x},w=v.EIP712Domain?p?E(v.EIP712Domain,p):{}:{},C=(()=>{if(b!=="EIP712Domain")return E(v[b],m)})();return(0,c.stringify)({domain:w,message:C,primaryType:b,types:v})}function l(g){const{domain:p,message:m,primaryType:b,types:v}=g,E=(w,C)=>{for(const y of w){const{name:_,type:x}=y,A=C[_],T=x.match(o.integerRegex);if(T&&(typeof A=="number"||typeof A=="bigint")){const[j,N,S]=T;(0,s.numberToHex)(A,{signed:N==="int",size:Number.parseInt(S)/8})}if(x==="address"&&typeof A=="string"&&!(0,n.isAddress)(A))throw new e.InvalidAddressError({address:A});const O=x.match(o.bytesRegex);if(O){const[j,N]=O;if(N&&(0,i.size)(A)!==Number.parseInt(N))throw new t.BytesSizeMismatchError({expectedSize:Number.parseInt(N),givenSize:(0,i.size)(A)})}const k=v[x];k&&(f(x),E(k,A))}};if(v.EIP712Domain&&p){if(typeof p!="object")throw new r.InvalidDomainError({domain:p});E(v.EIP712Domain,p)}if(b!=="EIP712Domain")if(v[b])E(v[b],m);else throw new r.InvalidPrimaryTypeError({primaryType:b,types:v})}function d({domain:g}){return[typeof(g==null?void 0:g.name)=="string"&&{name:"name",type:"string"},(g==null?void 0:g.version)&&{name:"version",type:"string"},(typeof(g==null?void 0:g.chainId)=="number"||typeof(g==null?void 0:g.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(g==null?void 0:g.verifyingContract)&&{name:"verifyingContract",type:"address"},(g==null?void 0:g.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function h({domain:g}){return(0,a.hashDomain)({domain:g,types:{EIP712Domain:d({domain:g})}})}function f(g){if(g==="address"||g==="bool"||g==="string"||g.startsWith("bytes")||g.startsWith("uint")||g.startsWith("int"))throw new r.InvalidStructTypeError({type:g})}return xh}var zE={},SH;function EX(){if(SH)return zE;SH=1,Object.defineProperty(zE,"__esModule",{value:!0}),zE.encodePacked=a;const t=$r(),e=la(),r=is(),n=oi(),i=Zd(),s=ze(),o=JA();function a(u,l){if(u.length!==l.length)throw new t.AbiEncodingLengthMismatchError({expectedLength:u.length,givenLength:l.length});const d=[];for(let h=0;h<u.length;h++){const f=u[h],g=l[h];d.push(c(f,g))}return(0,n.concatHex)(d)}function c(u,l,d=!1){if(u==="address"){const p=l;if(!(0,r.isAddress)(p))throw new e.InvalidAddressError({address:p});return(0,i.pad)(p.toLowerCase(),{size:d?32:null})}if(u==="string")return(0,s.stringToHex)(l);if(u==="bytes")return l;if(u==="bool")return(0,i.pad)((0,s.boolToHex)(l),{size:d?32:1});const h=u.match(o.integerRegex);if(h){const[p,m,b="256"]=h,v=Number.parseInt(b)/8;return(0,s.numberToHex)(l,{size:d?32:v,signed:m==="int"})}const f=u.match(o.bytesRegex);if(f){const[p,m]=f;if(Number.parseInt(m)!==(l.length-2)/2)throw new t.BytesSizeMismatchError({expectedSize:Number.parseInt(m),givenSize:(l.length-2)/2});return(0,i.pad)(l,{dir:"right",size:d?32:null})}const g=u.match(o.arrayRegex);if(g&&Array.isArray(l)){const[p,m]=g,b=[];for(let v=0;v<l.length;v++)b.push(c(m,l[v],!0));return b.length===0?"0x":(0,n.concatHex)(b)}throw new t.UnsupportedPackedAbiType(u)}return zE}var WE={},Gw={},Ol={},TH;function _x(){if(TH)return Ol;TH=1,Object.defineProperty(Ol,"__esModule",{value:!0}),Ol.assertTransactionEIP7702=d,Ol.assertTransactionEIP4844=h,Ol.assertTransactionEIP1559=f,Ol.assertTransactionEIP2930=g,Ol.assertTransactionLegacy=p;const t=WQ(),e=_O(),r=la(),n=_t(),i=VQ(),s=R2(),o=nl(),a=is(),c=rs(),u=go(),l=nn();function d(m){const{authorizationList:b}=m;if(b)for(const v of b){const{chainId:E}=v,w=v.address;if(!(0,a.isAddress)(w))throw new r.InvalidAddressError({address:w});if(E<0)throw new s.InvalidChainIdError({chainId:E})}f(m)}function h(m){const{blobVersionedHashes:b}=m;if(b){if(b.length===0)throw new i.EmptyBlobError;for(const v of b){const E=(0,c.size)(v),w=(0,l.hexToNumber)((0,u.slice)(v,0,1));if(E!==32)throw new i.InvalidVersionedHashSizeError({hash:v,size:E});if(w!==t.versionedHashVersionKzg)throw new i.InvalidVersionedHashVersionError({hash:v,version:w})}}f(m)}function f(m){const{chainId:b,maxPriorityFeePerGas:v,maxFeePerGas:E,to:w}=m;if(b<=0)throw new s.InvalidChainIdError({chainId:b});if(w&&!(0,a.isAddress)(w))throw new r.InvalidAddressError({address:w});if(E&&E>e.maxUint256)throw new o.FeeCapTooHighError({maxFeePerGas:E});if(v&&E&&v>E)throw new o.TipAboveFeeCapError({maxFeePerGas:E,maxPriorityFeePerGas:v})}function g(m){const{chainId:b,maxPriorityFeePerGas:v,gasPrice:E,maxFeePerGas:w,to:C}=m;if(b<=0)throw new s.InvalidChainIdError({chainId:b});if(C&&!(0,a.isAddress)(C))throw new r.InvalidAddressError({address:C});if(v||w)throw new n.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(E&&E>e.maxUint256)throw new o.FeeCapTooHighError({maxFeePerGas:E})}function p(m){const{chainId:b,maxPriorityFeePerGas:v,gasPrice:E,maxFeePerGas:w,to:C}=m;if(C&&!(0,a.isAddress)(C))throw new r.InvalidAddressError({address:C});if(typeof b<"u"&&b<=0)throw new s.InvalidChainIdError({chainId:b});if(v||w)throw new n.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(E&&E>e.maxUint256)throw new o.FeeCapTooHighError({maxFeePerGas:E})}return Ol}var VE={},IH;function ZO(){if(IH)return VE;IH=1,Object.defineProperty(VE,"__esModule",{value:!0}),VE.serializeAccessList=n;const t=la(),e=Ds(),r=is();function n(i){if(!i||i.length===0)return[];const s=[];for(let o=0;o<i.length;o++){const{address:a,storageKeys:c}=i[o];for(let u=0;u<c.length;u++)if(c[u].length-2!==64)throw new e.InvalidStorageKeySizeError({storageKey:c[u]});if(!(0,r.isAddress)(a,{strict:!1}))throw new t.InvalidAddressError({address:a});s.push([a,c])}return s}return VE}var PH;function Ex(){if(PH)return Gw;PH=1,Object.defineProperty(Gw,"__esModule",{value:!0}),Gw.serializeTransaction=f,Gw.toYParitySignatureArray=E;const t=Ds(),e=CX(),r=ax(),n=cx(),i=SO(),s=ux(),o=oi(),a=tl(),c=ze(),u=x2(),l=_x(),d=lx(),h=ZO();function f(w,C){const y=(0,d.getTransactionType)(w);return y==="eip1559"?m(w,C):y==="eip2930"?b(w,C):y==="eip4844"?p(w,C):y==="eip7702"?g(w,C):v(w,C)}function g(w,C){const{authorizationList:y,chainId:_,gas:x,nonce:A,to:T,value:O,maxFeePerGas:k,maxPriorityFeePerGas:j,accessList:N,data:S}=w;(0,l.assertTransactionEIP7702)(w);const P=(0,h.serializeAccessList)(N),I=(0,e.serializeAuthorizationList)(y);return(0,o.concatHex)(["0x04",(0,u.toRlp)([(0,c.toHex)(_),A?(0,c.toHex)(A):"0x",j?(0,c.toHex)(j):"0x",k?(0,c.toHex)(k):"0x",x?(0,c.toHex)(x):"0x",T??"0x",O?(0,c.toHex)(O):"0x",S??"0x",P,I,...E(w,C)])])}function p(w,C){const{chainId:y,gas:_,nonce:x,to:A,value:T,maxFeePerBlobGas:O,maxFeePerGas:k,maxPriorityFeePerGas:j,accessList:N,data:S}=w;(0,l.assertTransactionEIP4844)(w);let P=w.blobVersionedHashes,I=w.sidecars;if(w.blobs&&(typeof P>"u"||typeof I>"u")){const U=typeof w.blobs[0]=="string"?w.blobs:w.blobs.map(K=>(0,c.bytesToHex)(K)),z=w.kzg,W=(0,r.blobsToCommitments)({blobs:U,kzg:z});if(typeof P>"u"&&(P=(0,i.commitmentsToVersionedHashes)({commitments:W})),typeof I>"u"){const K=(0,n.blobsToProofs)({blobs:U,commitments:W,kzg:z});I=(0,s.toBlobSidecars)({blobs:U,commitments:W,proofs:K})}}const B=(0,h.serializeAccessList)(N),$=[(0,c.toHex)(y),x?(0,c.toHex)(x):"0x",j?(0,c.toHex)(j):"0x",k?(0,c.toHex)(k):"0x",_?(0,c.toHex)(_):"0x",A??"0x",T?(0,c.toHex)(T):"0x",S??"0x",B,O?(0,c.toHex)(O):"0x",P??[],...E(w,C)],R=[],D=[],L=[];if(I)for(let U=0;U<I.length;U++){const{blob:z,commitment:W,proof:K}=I[U];R.push(z),D.push(W),L.push(K)}return(0,o.concatHex)(["0x03",I?(0,u.toRlp)([$,R,D,L]):(0,u.toRlp)($)])}function m(w,C){const{chainId:y,gas:_,nonce:x,to:A,value:T,maxFeePerGas:O,maxPriorityFeePerGas:k,accessList:j,data:N}=w;(0,l.assertTransactionEIP1559)(w);const S=(0,h.serializeAccessList)(j),P=[(0,c.toHex)(y),x?(0,c.toHex)(x):"0x",k?(0,c.toHex)(k):"0x",O?(0,c.toHex)(O):"0x",_?(0,c.toHex)(_):"0x",A??"0x",T?(0,c.toHex)(T):"0x",N??"0x",S,...E(w,C)];return(0,o.concatHex)(["0x02",(0,u.toRlp)(P)])}function b(w,C){const{chainId:y,gas:_,data:x,nonce:A,to:T,value:O,accessList:k,gasPrice:j}=w;(0,l.assertTransactionEIP2930)(w);const N=(0,h.serializeAccessList)(k),S=[(0,c.toHex)(y),A?(0,c.toHex)(A):"0x",j?(0,c.toHex)(j):"0x",_?(0,c.toHex)(_):"0x",T??"0x",O?(0,c.toHex)(O):"0x",x??"0x",N,...E(w,C)];return(0,o.concatHex)(["0x01",(0,u.toRlp)(S)])}function v(w,C){const{chainId:y=0,gas:_,data:x,nonce:A,to:T,value:O,gasPrice:k}=w;(0,l.assertTransactionLegacy)(w);let j=[A?(0,c.toHex)(A):"0x",k?(0,c.toHex)(k):"0x",_?(0,c.toHex)(_):"0x",T??"0x",O?(0,c.toHex)(O):"0x",x??"0x"];if(C){const N=(()=>{if(C.v>=35n)return(C.v-35n)/2n>0?C.v:27n+(C.v===35n?0n:1n);if(y>0)return BigInt(y*2)+BigInt(35n+C.v-27n);const I=27n+(C.v===27n?0n:1n);if(C.v!==I)throw new t.InvalidLegacyVError({v:C.v});return I})(),S=(0,a.trim)(C.r),P=(0,a.trim)(C.s);j=[...j,(0,c.toHex)(N),S==="0x00"?"0x":S,P==="0x00"?"0x":P]}else y>0&&(j=[...j,(0,c.toHex)(y),"0x","0x"]);return(0,u.toRlp)(j)}function E(w,C){const y=C??w,{v:_,yParity:x}=y;if(typeof y.r>"u")return[];if(typeof y.s>"u")return[];if(typeof _>"u"&&typeof x>"u")return[];const A=(0,a.trim)(y.r),T=(0,a.trim)(y.s);return[typeof x=="number"?x?(0,c.toHex)(1):"0x":_===0n?"0x":_===1n?(0,c.toHex)(1):_===27n?"0x":(0,c.toHex)(1),A==="0x00"?"0x":A,T==="0x00"?"0x":T]}return Gw}var OH;function CX(){if(OH)return WE;OH=1,Object.defineProperty(WE,"__esModule",{value:!0}),WE.serializeAuthorizationList=r;const t=ze(),e=Ex();function r(n){if(!n||n.length===0)return[];const i=[];for(const s of n){const{chainId:o,nonce:a,...c}=s,u=s.address;i.push([o?(0,t.toHex)(o):"0x",u,a?(0,t.toHex)(a):"0x",...(0,e.toYParitySignatureArray)({},c)])}return i}return WE}var GE={},RH;function zIe(){if(RH)return GE;RH=1,Object.defineProperty(GE,"__esModule",{value:!0}),GE.verifyAuthorization=n;const t=js(),e=fa(),r=nx();async function n({address:i,authorization:s,signature:o}){return(0,e.isAddressEqual)((0,t.getAddress)(i),await(0,r.recoverAuthorizationAddress)({authorization:s,signature:o}))}return GE}var R0={},KE={},kH;function YO(){if(kH)return KE;kH=1,Object.defineProperty(KE,"__esModule",{value:!0}),KE.isBytes=t;function t(e){return!e||typeof e!="object"||!("BYTES_PER_ELEMENT"in e)?!1:e.BYTES_PER_ELEMENT===1&&e.constructor.name==="Uint8Array"}return KE}var NH;function AX(){if(NH)return R0;NH=1,Object.defineProperty(R0,"__esModule",{value:!0}),R0.getContractAddress=c,R0.getCreateAddress=u,R0.getCreate2Address=l;const t=oi(),e=YO(),r=Zd(),n=go(),i=Tr(),s=x2(),o=ns(),a=js();function c(d){return d.opcode==="CREATE2"?l(d):u(d)}function u(d){const h=(0,i.toBytes)((0,a.getAddress)(d.from));let f=(0,i.toBytes)(d.nonce);return f[0]===0&&(f=new Uint8Array([])),(0,a.getAddress)(`0x${(0,o.keccak256)((0,s.toRlp)([h,f],"bytes")).slice(26)}`)}function l(d){const h=(0,i.toBytes)((0,a.getAddress)(d.from)),f=(0,r.pad)((0,e.isBytes)(d.salt)?d.salt:(0,i.toBytes)(d.salt),{size:32}),g="bytecodeHash"in d?(0,e.isBytes)(d.bytecodeHash)?d.bytecodeHash:(0,i.toBytes)(d.bytecodeHash):(0,o.keccak256)(d.bytecode,"bytes");return(0,a.getAddress)((0,n.slice)((0,o.keccak256)((0,t.concat)([(0,i.toBytes)("0xff"),h,f,g])),12))}return R0}var ZE={},$H;function JO(){if($H)return ZE;$H=1,Object.defineProperty(ZE,"__esModule",{value:!0}),ZE.fromRlp=s;const t=_t(),e=y1(),r=v2(),n=Tr(),i=ze();function s(u,l="hex"){const d=(()=>{if(typeof u=="string"){if(u.length>3&&u.length%2!==0)throw new e.InvalidHexValueError(u);return(0,n.hexToBytes)(u)}return u})(),h=(0,r.createCursor)(d,{recursiveReadLimit:Number.POSITIVE_INFINITY});return o(h,l)}function o(u,l="hex"){if(u.bytes.length===0)return l==="hex"?(0,i.bytesToHex)(u.bytes):u.bytes;const d=u.readByte();if(d<128&&u.decrementPosition(1),d<192){const f=a(u,d,128),g=u.readBytes(f);return l==="hex"?(0,i.bytesToHex)(g):g}const h=a(u,d,192);return c(u,h,l)}function a(u,l,d){if(d===128&&l<128)return 1;if(l<=d+55)return l-d;if(l===d+55+1)return u.readUint8();if(l===d+55+2)return u.readUint16();if(l===d+55+3)return u.readUint24();if(l===d+55+4)return u.readUint32();throw new t.BaseError("Invalid RLP prefix")}function c(u,l,d){const h=u.position,f=[];for(;u.position-h<l;)f.push(o(u,d));return f}return ZE}var NT={},jH;function xX(){return jH||(jH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.toEventSignature=void 0;var e=pO();Object.defineProperty(t,"toEventSignature",{enumerable:!0,get:function(){return e.toSignature}})}(NT)),NT}var $T={},BH;function SX(){return BH||(BH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.toFunctionSignature=void 0;var e=pO();Object.defineProperty(t,"toFunctionSignature",{enumerable:!0,get:function(){return e.toSignature}})}($T)),$T}var jT={},DH;function TX(){return DH||(DH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.toEventHash=void 0;var e=YA();Object.defineProperty(t,"toEventHash",{enumerable:!0,get:function(){return e.toSignatureHash}})}(jT)),jT}var BT={},MH;function IX(){return MH||(MH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.toFunctionHash=void 0;var e=YA();Object.defineProperty(t,"toFunctionHash",{enumerable:!0,get:function(){return e.toSignatureHash}})}(BT)),BT}var YE={},LH;function QO(){if(LH)return YE;LH=1,Object.defineProperty(YE,"__esModule",{value:!0}),YE.isHash=r;const t=ki(),e=rs();function r(n){return(0,t.isHex)(n)&&(0,e.size)(n)===32}return YE}var JE={},Th={},li={},UH;function WIe(){if(UH)return li;UH=1,Object.defineProperty(li,"__esModule",{value:!0}),li.ripemd160=li.RIPEMD160=li.md5=li.MD5=li.sha1=li.SHA1=void 0;const t=BQ(),e=Yd(),r=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),n=new Uint32Array(80);class i extends t.HashMD{constructor(){super(64,20,8,!1),this.A=r[0]|0,this.B=r[1]|0,this.C=r[2]|0,this.D=r[3]|0,this.E=r[4]|0}get(){const{A,B:T,C:O,D:k,E:j}=this;return[A,T,O,k,j]}set(A,T,O,k,j){this.A=A|0,this.B=T|0,this.C=O|0,this.D=k|0,this.E=j|0}process(A,T){for(let P=0;P<16;P++,T+=4)n[P]=A.getUint32(T,!1);for(let P=16;P<80;P++)n[P]=(0,e.rotl)(n[P-3]^n[P-8]^n[P-14]^n[P-16],1);let{A:O,B:k,C:j,D:N,E:S}=this;for(let P=0;P<80;P++){let I,B;P<20?(I=(0,t.Chi)(k,j,N),B=1518500249):P<40?(I=k^j^N,B=1859775393):P<60?(I=(0,t.Maj)(k,j,N),B=2400959708):(I=k^j^N,B=3395469782);const $=(0,e.rotl)(O,5)+I+S+B+n[P]|0;S=N,N=j,j=(0,e.rotl)(k,30),k=O,O=$}O=O+this.A|0,k=k+this.B|0,j=j+this.C|0,N=N+this.D|0,S=S+this.E|0,this.set(O,k,j,N,S)}roundClean(){(0,e.clean)(n)}destroy(){this.set(0,0,0,0,0),(0,e.clean)(this.buffer)}}li.SHA1=i,li.sha1=(0,e.createHasher)(()=>new i);const s=Math.pow(2,32),o=Array.from({length:64},(x,A)=>Math.floor(s*Math.abs(Math.sin(A+1)))),a=r.slice(0,4),c=new Uint32Array(16);class u extends t.HashMD{constructor(){super(64,16,8,!0),this.A=a[0]|0,this.B=a[1]|0,this.C=a[2]|0,this.D=a[3]|0}get(){const{A,B:T,C:O,D:k}=this;return[A,T,O,k]}set(A,T,O,k){this.A=A|0,this.B=T|0,this.C=O|0,this.D=k|0}process(A,T){for(let S=0;S<16;S++,T+=4)c[S]=A.getUint32(T,!0);let{A:O,B:k,C:j,D:N}=this;for(let S=0;S<64;S++){let P,I,B;S<16?(P=(0,t.Chi)(k,j,N),I=S,B=[7,12,17,22]):S<32?(P=(0,t.Chi)(N,k,j),I=(5*S+1)%16,B=[5,9,14,20]):S<48?(P=k^j^N,I=(3*S+5)%16,B=[4,11,16,23]):(P=j^(k|~N),I=7*S%16,B=[6,10,15,21]),P=P+O+o[S]+c[I],O=N,N=j,j=k,k=k+(0,e.rotl)(P,B[S%4])}O=O+this.A|0,k=k+this.B|0,j=j+this.C|0,N=N+this.D|0,this.set(O,k,j,N)}roundClean(){(0,e.clean)(c)}destroy(){this.set(0,0,0,0),(0,e.clean)(this.buffer)}}li.MD5=u,li.md5=(0,e.createHasher)(()=>new u);const l=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),d=Uint8Array.from(new Array(16).fill(0).map((x,A)=>A)),h=d.map(x=>(9*x+5)%16),f=(()=>{const T=[[d],[h]];for(let O=0;O<4;O++)for(let k of T)k.push(k[O].map(j=>l[j]));return T})(),g=f[0],p=f[1],m=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(x=>Uint8Array.from(x)),b=g.map((x,A)=>x.map(T=>m[A][T])),v=p.map((x,A)=>x.map(T=>m[A][T])),E=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),w=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function C(x,A,T,O){return x===0?A^T^O:x===1?A&T|~A&O:x===2?(A|~T)^O:x===3?A&O|T&~O:A^(T|~O)}const y=new Uint32Array(16);class _ extends t.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:A,h1:T,h2:O,h3:k,h4:j}=this;return[A,T,O,k,j]}set(A,T,O,k,j){this.h0=A|0,this.h1=T|0,this.h2=O|0,this.h3=k|0,this.h4=j|0}process(A,T){for(let D=0;D<16;D++,T+=4)y[D]=A.getUint32(T,!0);let O=this.h0|0,k=O,j=this.h1|0,N=j,S=this.h2|0,P=S,I=this.h3|0,B=I,$=this.h4|0,R=$;for(let D=0;D<5;D++){const L=4-D,U=E[D],z=w[D],W=g[D],K=p[D],J=b[D],ne=v[D];for(let ae=0;ae<16;ae++){const he=(0,e.rotl)(O+C(D,j,S,I)+y[W[ae]]+U,J[ae])+$|0;O=$,$=I,I=(0,e.rotl)(S,10)|0,S=j,j=he}for(let ae=0;ae<16;ae++){const he=(0,e.rotl)(k+C(L,N,P,B)+y[K[ae]]+z,ne[ae])+R|0;k=R,R=B,B=(0,e.rotl)(P,10)|0,P=N,N=he}}this.set(this.h1+S+B|0,this.h2+I+R|0,this.h3+$+k|0,this.h4+O+N|0,this.h0+j+P|0)}roundClean(){(0,e.clean)(y)}destroy(){this.destroyed=!0,(0,e.clean)(this.buffer),this.set(0,0,0,0,0)}}return li.RIPEMD160=_,li.ripemd160=(0,e.createHasher)(()=>new _),li}var FH;function PX(){if(FH)return Th;FH=1,Object.defineProperty(Th,"__esModule",{value:!0}),Th.ripemd160=Th.RIPEMD160=void 0;const t=WIe();return Th.RIPEMD160=t.RIPEMD160,Th.ripemd160=t.ripemd160,Th}var HH;function OX(){if(HH)return JE;HH=1,Object.defineProperty(JE,"__esModule",{value:!0}),JE.ripemd160=i;const t=PX(),e=ki(),r=Tr(),n=ze();function i(s,o){const a=o||"hex",c=(0,t.ripemd160)((0,e.isHex)(s,{strict:!1})?(0,r.toBytes)(s):s);return a==="bytes"?c:(0,n.toHex)(c)}return JE}var QE={},XE={},e5={},Kw={},qH;function RX(){return qH||(qH=1,Object.defineProperty(Kw,"__esModule",{value:!0}),Kw.presignMessagePrefix=void 0,Kw.presignMessagePrefix=`Ethereum Signed Message:
- `),Kw}var zH;function kX(){if(zH)return e5;zH=1,Object.defineProperty(e5,"__esModule",{value:!0}),e5.toPrefixedMessage=i;const t=RX(),e=oi(),r=rs(),n=ze();function i(s){const o=typeof s=="string"?(0,n.stringToHex)(s):typeof s.raw=="string"?s.raw:(0,n.bytesToHex)(s.raw),a=(0,n.stringToHex)(`${t.presignMessagePrefix}${(0,r.size)(o)}`);return(0,e.concat)([a,o])}return e5}var WH;function D2(){if(WH)return XE;WH=1,Object.defineProperty(XE,"__esModule",{value:!0}),XE.hashMessage=r;const t=ns(),e=kX();function r(n,i){return(0,t.keccak256)((0,e.toPrefixedMessage)(n),i)}return XE}var VH;function XO(){if(VH)return QE;VH=1,Object.defineProperty(QE,"__esModule",{value:!0}),QE.recoverMessageAddress=r;const t=D2(),e=th();async function r({message:n,signature:i}){return(0,e.recoverAddress)({hash:(0,t.hashMessage)(n),signature:i})}return QE}var t5={},GH;function eR(){if(GH)return t5;GH=1,Object.defineProperty(t5,"__esModule",{value:!0}),t5.recoverTypedDataAddress=r;const t=B2(),e=th();async function r(n){const{domain:i,message:s,primaryType:o,signature:a,types:c}=n;return(0,e.recoverAddress)({hash:(0,t.hashTypedData)({domain:i,message:s,primaryType:o,types:c}),signature:a})}return t5}var r5={},KH;function NX(){if(KH)return r5;KH=1,Object.defineProperty(r5,"__esModule",{value:!0}),r5.verifyHash=n;const t=js(),e=fa(),r=th();async function n({address:i,hash:s,signature:o}){return(0,e.isAddressEqual)((0,t.getAddress)(i),await(0,r.recoverAddress)({hash:s,signature:o}))}return r5}var n5={},ZH;function $X(){if(ZH)return n5;ZH=1,Object.defineProperty(n5,"__esModule",{value:!0}),n5.verifyMessage=n;const t=js(),e=fa(),r=XO();async function n({address:i,message:s,signature:o}){return(0,e.isAddressEqual)((0,t.getAddress)(i),await(0,r.recoverMessageAddress)({message:s,signature:o}))}return n5}var i5={},YH;function jX(){if(YH)return i5;YH=1,Object.defineProperty(i5,"__esModule",{value:!0}),i5.verifyTypedData=n;const t=js(),e=fa(),r=eR();async function n(i){const{address:s,domain:o,message:a,primaryType:c,signature:u,types:l}=i;return(0,e.isAddressEqual)((0,t.getAddress)(s),await(0,r.recoverTypedDataAddress)({domain:o,message:a,primaryType:c,signature:u,types:l}))}return i5}var s5={},o5={},Ih={},JH;function tR(){return JH||(JH=1,Object.defineProperty(Ih,"__esModule",{value:!0}),Ih.zeroHash=Ih.erc6492MagicBytes=void 0,Ih.erc6492MagicBytes="0x6492649264926492649264926492649264926492649264926492649264926492",Ih.zeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"),Ih}var QH;function Cx(){if(QH)return o5;QH=1,Object.defineProperty(o5,"__esModule",{value:!0}),o5.isErc6492Signature=r;const t=tR(),e=go();function r(n){return(0,e.sliceHex)(n,-32)===t.erc6492MagicBytes}return o5}var XH;function BX(){if(XH)return s5;XH=1,Object.defineProperty(s5,"__esModule",{value:!0}),s5.parseErc6492Signature=r;const t=Jd(),e=Cx();function r(n){if(!(0,e.isErc6492Signature)(n))return{signature:n};const[i,s,o]=(0,t.decodeAbiParameters)([{type:"address"},{type:"bytes"},{type:"bytes"}],n);return{address:i,data:s,signature:o}}return s5}var a5={},eq;function rR(){if(eq)return a5;eq=1,Object.defineProperty(a5,"__esModule",{value:!0}),a5.serializeErc6492Signature=i;const t=tR(),e=da(),r=oi(),n=Tr();function i(s){const{address:o,data:a,signature:c,to:u="hex"}=s,l=(0,r.concatHex)([(0,e.encodeAbiParameters)([{type:"address"},{type:"bytes"},{type:"bytes"}],[o,a,c]),t.erc6492MagicBytes]);return u==="hex"?l:(0,n.hexToBytes)(l)}return a5}var c5={},tq;function nR(){if(tq)return c5;tq=1,Object.defineProperty(c5,"__esModule",{value:!0}),c5.getSerializedTransactionType=n;const t=Ds(),e=go(),r=nn();function n(i){const s=(0,e.sliceHex)(i,0,1);if(s==="0x04")return"eip7702";if(s==="0x03")return"eip4844";if(s==="0x02")return"eip1559";if(s==="0x01")return"eip2930";if(s!=="0x"&&(0,r.hexToNumber)(s)>=192)return"legacy";throw new t.InvalidSerializedTransactionTypeError({serializedType:s})}return c5}var k0={},rq;function iR(){if(rq)return k0;rq=1,Object.defineProperty(k0,"__esModule",{value:!0}),k0.parseTransaction=h,k0.toTransactionArray=v,k0.parseAccessList=E;const t=la(),e=Ds(),r=is(),n=ux(),i=ki(),s=Zd(),o=tl(),a=nn(),c=JO(),u=QO(),l=_x(),d=nR();function h(y){const _=(0,d.getSerializedTransactionType)(y);return _==="eip1559"?p(y):_==="eip2930"?m(y):_==="eip4844"?g(y):_==="eip7702"?f(y):b(y)}function f(y){const _=v(y),[x,A,T,O,k,j,N,S,P,I,B,$,R]=_;if(_.length!==10&&_.length!==13)throw new e.InvalidSerializedTransactionError({attributes:{chainId:x,nonce:A,maxPriorityFeePerGas:T,maxFeePerGas:O,gas:k,to:j,value:N,data:S,accessList:P,authorizationList:I,..._.length>9?{v:B,r:$,s:R}:{}},serializedTransaction:y,type:"eip7702"});const D={chainId:(0,a.hexToNumber)(x),type:"eip7702"};return(0,i.isHex)(j)&&j!=="0x"&&(D.to=j),(0,i.isHex)(k)&&k!=="0x"&&(D.gas=(0,a.hexToBigInt)(k)),(0,i.isHex)(S)&&S!=="0x"&&(D.data=S),(0,i.isHex)(A)&&(D.nonce=A==="0x"?0:(0,a.hexToNumber)(A)),(0,i.isHex)(N)&&N!=="0x"&&(D.value=(0,a.hexToBigInt)(N)),(0,i.isHex)(O)&&O!=="0x"&&(D.maxFeePerGas=(0,a.hexToBigInt)(O)),(0,i.isHex)(T)&&T!=="0x"&&(D.maxPriorityFeePerGas=(0,a.hexToBigInt)(T)),P.length!==0&&P!=="0x"&&(D.accessList=E(P)),I.length!==0&&I!=="0x"&&(D.authorizationList=w(I)),(0,l.assertTransactionEIP7702)(D),{..._.length===13?C(_):void 0,...D}}function g(y){const _=v(y),x=_.length===4,A=x?_[0]:_,T=x?_.slice(1):[],[O,k,j,N,S,P,I,B,$,R,D,L,U,z]=A,[W,K,J]=T;if(!(A.length===11||A.length===14))throw new e.InvalidSerializedTransactionError({attributes:{chainId:O,nonce:k,maxPriorityFeePerGas:j,maxFeePerGas:N,gas:S,to:P,value:I,data:B,accessList:$,...A.length>9?{v:L,r:U,s:z}:{}},serializedTransaction:y,type:"eip4844"});const ne={blobVersionedHashes:D,chainId:(0,a.hexToNumber)(O),type:"eip4844"};return(0,i.isHex)(P)&&P!=="0x"&&(ne.to=P),(0,i.isHex)(S)&&S!=="0x"&&(ne.gas=(0,a.hexToBigInt)(S)),(0,i.isHex)(B)&&B!=="0x"&&(ne.data=B),(0,i.isHex)(k)&&(ne.nonce=k==="0x"?0:(0,a.hexToNumber)(k)),(0,i.isHex)(I)&&I!=="0x"&&(ne.value=(0,a.hexToBigInt)(I)),(0,i.isHex)(R)&&R!=="0x"&&(ne.maxFeePerBlobGas=(0,a.hexToBigInt)(R)),(0,i.isHex)(N)&&N!=="0x"&&(ne.maxFeePerGas=(0,a.hexToBigInt)(N)),(0,i.isHex)(j)&&j!=="0x"&&(ne.maxPriorityFeePerGas=(0,a.hexToBigInt)(j)),$.length!==0&&$!=="0x"&&(ne.accessList=E($)),W&&K&&J&&(ne.sidecars=(0,n.toBlobSidecars)({blobs:W,commitments:K,proofs:J})),(0,l.assertTransactionEIP4844)(ne),{...A.length===14?C(A):void 0,...ne}}function p(y){const _=v(y),[x,A,T,O,k,j,N,S,P,I,B,$]=_;if(!(_.length===9||_.length===12))throw new e.InvalidSerializedTransactionError({attributes:{chainId:x,nonce:A,maxPriorityFeePerGas:T,maxFeePerGas:O,gas:k,to:j,value:N,data:S,accessList:P,..._.length>9?{v:I,r:B,s:$}:{}},serializedTransaction:y,type:"eip1559"});const R={chainId:(0,a.hexToNumber)(x),type:"eip1559"};return(0,i.isHex)(j)&&j!=="0x"&&(R.to=j),(0,i.isHex)(k)&&k!=="0x"&&(R.gas=(0,a.hexToBigInt)(k)),(0,i.isHex)(S)&&S!=="0x"&&(R.data=S),(0,i.isHex)(A)&&(R.nonce=A==="0x"?0:(0,a.hexToNumber)(A)),(0,i.isHex)(N)&&N!=="0x"&&(R.value=(0,a.hexToBigInt)(N)),(0,i.isHex)(O)&&O!=="0x"&&(R.maxFeePerGas=(0,a.hexToBigInt)(O)),(0,i.isHex)(T)&&T!=="0x"&&(R.maxPriorityFeePerGas=(0,a.hexToBigInt)(T)),P.length!==0&&P!=="0x"&&(R.accessList=E(P)),(0,l.assertTransactionEIP1559)(R),{..._.length===12?C(_):void 0,...R}}function m(y){const _=v(y),[x,A,T,O,k,j,N,S,P,I,B]=_;if(!(_.length===8||_.length===11))throw new e.InvalidSerializedTransactionError({attributes:{chainId:x,nonce:A,gasPrice:T,gas:O,to:k,value:j,data:N,accessList:S,..._.length>8?{v:P,r:I,s:B}:{}},serializedTransaction:y,type:"eip2930"});const $={chainId:(0,a.hexToNumber)(x),type:"eip2930"};return(0,i.isHex)(k)&&k!=="0x"&&($.to=k),(0,i.isHex)(O)&&O!=="0x"&&($.gas=(0,a.hexToBigInt)(O)),(0,i.isHex)(N)&&N!=="0x"&&($.data=N),(0,i.isHex)(A)&&($.nonce=A==="0x"?0:(0,a.hexToNumber)(A)),(0,i.isHex)(j)&&j!=="0x"&&($.value=(0,a.hexToBigInt)(j)),(0,i.isHex)(T)&&T!=="0x"&&($.gasPrice=(0,a.hexToBigInt)(T)),S.length!==0&&S!=="0x"&&($.accessList=E(S)),(0,l.assertTransactionEIP2930)($),{..._.length===11?C(_):void 0,...$}}function b(y){const _=(0,c.fromRlp)(y,"hex"),[x,A,T,O,k,j,N,S,P]=_;if(!(_.length===6||_.length===9))throw new e.InvalidSerializedTransactionError({attributes:{nonce:x,gasPrice:A,gas:T,to:O,value:k,data:j,..._.length>6?{v:N,r:S,s:P}:{}},serializedTransaction:y,type:"legacy"});const I={type:"legacy"};if((0,i.isHex)(O)&&O!=="0x"&&(I.to=O),(0,i.isHex)(T)&&T!=="0x"&&(I.gas=(0,a.hexToBigInt)(T)),(0,i.isHex)(j)&&j!=="0x"&&(I.data=j),(0,i.isHex)(x)&&(I.nonce=x==="0x"?0:(0,a.hexToNumber)(x)),(0,i.isHex)(k)&&k!=="0x"&&(I.value=(0,a.hexToBigInt)(k)),(0,i.isHex)(A)&&A!=="0x"&&(I.gasPrice=(0,a.hexToBigInt)(A)),(0,l.assertTransactionLegacy)(I),_.length===6)return I;const B=(0,i.isHex)(N)&&N!=="0x"?(0,a.hexToBigInt)(N):0n;if(P==="0x"&&S==="0x")return B>0&&(I.chainId=Number(B)),I;const $=B,R=Number(($-35n)/2n);if(R>0)I.chainId=R;else if($!==27n&&$!==28n)throw new e.InvalidLegacyVError({v:$});return I.v=$,I.s=P,I.r=S,I.yParity=$%2n===0n?1:0,I}function v(y){return(0,c.fromRlp)(`0x${y.slice(4)}`,"hex")}function E(y){const _=[];for(let x=0;x<y.length;x++){const[A,T]=y[x];if(!(0,r.isAddress)(A,{strict:!1}))throw new t.InvalidAddressError({address:A});_.push({address:A,storageKeys:T.map(O=>(0,u.isHash)(O)?O:(0,o.trim)(O))})}return _}function w(y){const _=[];for(let x=0;x<y.length;x++){const[A,T,O,k,j,N]=y[x];_.push({address:T,chainId:(0,a.hexToNumber)(A),nonce:(0,a.hexToNumber)(O),...C([k,j,N])})}return _}function C(y){const _=y.slice(-3),x=_[0]==="0x"||(0,a.hexToBigInt)(_[0])===0n?27n:28n;return{r:(0,s.padHex)(_[1],{size:32}),s:(0,s.padHex)(_[2],{size:32}),v:x,yParity:x===27n?0:1}}return k0}var u5={},Zw={},nq;function DX(){if(nq)return Zw;nq=1,Object.defineProperty(Zw,"__esModule",{value:!0}),Zw.InvalidDecimalNumberError=void 0;const t=_t();class e extends t.BaseError{constructor({value:n}){super(`Number \`${n}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}return Zw.InvalidDecimalNumberError=e,Zw}var iq;function Ax(){if(iq)return u5;iq=1,Object.defineProperty(u5,"__esModule",{value:!0}),u5.parseUnits=e;const t=DX();function e(r,n){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(r))throw new t.InvalidDecimalNumberError({value:r});let[i,s="0"]=r.split(".");const o=i.startsWith("-");if(o&&(i=i.slice(1)),s=s.replace(/(0+)$/,""),n===0)Math.round(+`.${s}`)===1&&(i=`${BigInt(i)+1n}`),s="";else if(s.length>n){const[a,c,u]=[s.slice(0,n-1),s.slice(n-1,n),s.slice(n)],l=Math.round(+`${c}.${u}`);l>9?s=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):s=`${a}${l}`,s.length>n&&(s=s.slice(1),i=`${BigInt(i)+1n}`),s=s.slice(0,n)}else s=s.padEnd(n,"0");return BigInt(`${o?"-":""}${i}${s}`)}return u5}var l5={},sq;function MX(){if(sq)return l5;sq=1,Object.defineProperty(l5,"__esModule",{value:!0}),l5.parseEther=r;const t=_2(),e=Ax();function r(n,i="wei"){return(0,e.parseUnits)(n,t.etherUnits[i])}return l5}var d5={},oq;function LX(){if(oq)return d5;oq=1,Object.defineProperty(d5,"__esModule",{value:!0}),d5.parseGwei=r;const t=_2(),e=Ax();function r(n,i="wei"){return(0,e.parseUnits)(n,t.gweiUnits[i])}return d5}var Ph={},aq;function UX(){if(aq)return Ph;aq=1,Object.defineProperty(Ph,"__esModule",{value:!0}),Ph.nonceManager=void 0,Ph.createNonceManager=r,Ph.jsonRpc=n;const t=ox(),e=y2();function r(i){const{source:s}=i,o=new Map,a=new e.LruMap(8192),c=new Map,u=({address:l,chainId:d})=>`${l}.${d}`;return{async consume({address:l,chainId:d,client:h}){const f=u({address:l,chainId:d}),g=this.get({address:l,chainId:d,client:h});this.increment({address:l,chainId:d});const p=await g;return await s.set({address:l,chainId:d},p),a.set(f,p),p},async increment({address:l,chainId:d}){const h=u({address:l,chainId:d}),f=o.get(h)??0;o.set(h,f+1)},async get({address:l,chainId:d,client:h}){const f=u({address:l,chainId:d});let g=c.get(f);return g||(g=(async()=>{try{const m=await s.get({address:l,chainId:d,client:h}),b=a.get(f)??0;return b>0&&m<=b?b+1:(a.delete(f),m)}finally{this.reset({address:l,chainId:d})}})(),c.set(f,g)),(o.get(f)??0)+await g},reset({address:l,chainId:d}){const h=u({address:l,chainId:d});o.delete(h),c.delete(h)}}}function n(){return{async get(i){const{address:s,client:o}=i;return(0,t.getTransactionCount)(o,{address:s,blockTag:"pending"})},set(){}}}return Ph.nonceManager=r({source:n()}),Ph}var cq;function sR(){return cq||(cq=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getContractAddress=t.publicKeyToAddress=t.parseAccount=t.verifyAuthorization=t.serializeAuthorizationList=t.recoverAuthorizationAddress=t.hashAuthorization=t.formatAbiParams=t.formatAbiItem=t.formatAbiItemWithArgs=t.encodePacked=t.parseAbiParameters=t.parseAbiParameter=t.parseAbiItem=t.parseAbi=t.getAbiItem=t.parseEventLogs=t.encodeFunctionResult=t.encodeFunctionData=t.encodeEventTopics=t.encodeErrorResult=t.encodeDeployData=t.encodeAbiParameters=t.decodeFunctionResult=t.decodeFunctionData=t.decodeEventLog=t.decodeErrorResult=t.decodeAbiParameters=t.validateTypedData=t.serializeTypedData=t.stringify=t.getWebSocketRpcClient=t.socketClientCache=t.getSocketRpcClient=t.getHttpRpcClient=t.rpc=t.getSocket=t.integerRegex=t.bytesRegex=t.arrayRegex=t.getChainContractAddress=t.extractChain=t.defineChain=t.assertCurrentChain=t.offchainLookupSignature=t.offchainLookupAbiItem=t.offchainLookup=t.ccipFetch=t.ccipRequest=t.buildRequest=void 0,t.hexToString=t.hexToNumber=t.hexToBigInt=t.hexToBool=t.fromHex=t.fromBytes=t.bytesToString=t.bytesToNumber=t.bytesToBool=t.bytesToBigint=t.bytesToBigInt=t.stringToHex=t.numberToHex=t.toHex=t.bytesToHex=t.boolToHex=t.stringToBytes=t.numberToBytes=t.hexToBytes=t.toBytes=t.boolToBytes=t.toRlp=t.extract=t.formatTransactionRequest=t.defineTransactionRequest=t.defineTransactionReceipt=t.formatLog=t.transactionType=t.formatTransaction=t.defineTransaction=t.formatBlock=t.defineBlock=t.trim=t.sliceHex=t.sliceBytes=t.slice=t.size=t.padHex=t.padBytes=t.pad=t.isHex=t.isBytes=t.concatHex=t.concatBytes=t.concat=t.isAddressEqual=t.isAddress=t.getAddress=t.getCreate2Address=t.getCreateAddress=void 0,t.parseEther=t.parseUnits=t.formatUnits=t.formatGwei=t.formatEther=t.serializeAccessList=t.serializeTransaction=t.parseTransaction=t.assertTransactionLegacy=t.assertTransactionEIP2930=t.assertTransactionEIP1559=t.assertRequest=t.getTransactionType=t.getSerializedTransactionType=t.serializeErc6492Signature=t.isErc6492Signature=t.parseErc6492Signature=t.hashMessage=t.verifyTypedData=t.verifyMessage=t.verifyHash=t.recoverTypedDataAddress=t.recoverPublicKey=t.recoverMessageAddress=t.recoverAddress=t.hashTypedData=t.hashStruct=t.ripemd160=t.sha256=t.keccak256=t.isHash=t.toFunctionHash=t.toEventHash=t.getFunctionSignature=t.toFunctionSignature=t.getEventSignature=t.toEventSignature=t.getFunctionSelector=t.toFunctionSelector=t.getEventSelector=t.toEventSelector=t.defineFormatter=t.getAction=t.getTransactionError=t.getEstimateGasError=t.getContractError=t.getCallError=t.getNodeError=t.containsNodeError=t.fromRlp=void 0,t.nonceManager=t.createNonceManager=t.parseGwei=void 0;var e=cX();Object.defineProperty(t,"buildRequest",{enumerable:!0,get:function(){return e.buildRequest}});var r=MO();Object.defineProperty(t,"ccipRequest",{enumerable:!0,get:function(){return r.ccipRequest}}),Object.defineProperty(t,"ccipFetch",{enumerable:!0,get:function(){return r.ccipRequest}}),Object.defineProperty(t,"offchainLookup",{enumerable:!0,get:function(){return r.offchainLookup}}),Object.defineProperty(t,"offchainLookupAbiItem",{enumerable:!0,get:function(){return r.offchainLookupAbiItem}}),Object.defineProperty(t,"offchainLookupSignature",{enumerable:!0,get:function(){return r.offchainLookupSignature}});var n=gx();Object.defineProperty(t,"assertCurrentChain",{enumerable:!0,get:function(){return n.assertCurrentChain}});var i=wX();Object.defineProperty(t,"defineChain",{enumerable:!0,get:function(){return i.defineChain}});var s=bX();Object.defineProperty(t,"extractChain",{enumerable:!0,get:function(){return s.extractChain}});var o=nh();Object.defineProperty(t,"getChainContractAddress",{enumerable:!0,get:function(){return o.getChainContractAddress}});var a=JA();Object.defineProperty(t,"arrayRegex",{enumerable:!0,get:function(){return a.arrayRegex}}),Object.defineProperty(t,"bytesRegex",{enumerable:!0,get:function(){return a.bytesRegex}}),Object.defineProperty(t,"integerRegex",{enumerable:!0,get:function(){return a.integerRegex}});var c=vX();Object.defineProperty(t,"getSocket",{enumerable:!0,get:function(){return c.getSocket}}),Object.defineProperty(t,"rpc",{enumerable:!0,get:function(){return c.rpc}});var u=WO();Object.defineProperty(t,"getHttpRpcClient",{enumerable:!0,get:function(){return u.getHttpRpcClient}});var l=yX();Object.defineProperty(t,"getSocketRpcClient",{enumerable:!0,get:function(){return l.getSocketRpcClient}}),Object.defineProperty(t,"socketClientCache",{enumerable:!0,get:function(){return l.socketClientCache}});var d=KO();Object.defineProperty(t,"getWebSocketRpcClient",{enumerable:!0,get:function(){return d.getWebSocketRpcClient}});var h=Gn();Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}});var f=vx();Object.defineProperty(t,"serializeTypedData",{enumerable:!0,get:function(){return f.serializeTypedData}}),Object.defineProperty(t,"validateTypedData",{enumerable:!0,get:function(){return f.validateTypedData}});var g=Jd();Object.defineProperty(t,"decodeAbiParameters",{enumerable:!0,get:function(){return g.decodeAbiParameters}});var p=ex();Object.defineProperty(t,"decodeErrorResult",{enumerable:!0,get:function(){return p.decodeErrorResult}});var m=P2();Object.defineProperty(t,"decodeEventLog",{enumerable:!0,get:function(){return m.decodeEventLog}});var b=$O();Object.defineProperty(t,"decodeFunctionData",{enumerable:!0,get:function(){return b.decodeFunctionData}});var v=al();Object.defineProperty(t,"decodeFunctionResult",{enumerable:!0,get:function(){return v.decodeFunctionResult}});var E=da();Object.defineProperty(t,"encodeAbiParameters",{enumerable:!0,get:function(){return E.encodeAbiParameters}});var w=k2();Object.defineProperty(t,"encodeDeployData",{enumerable:!0,get:function(){return w.encodeDeployData}});var C=jO();Object.defineProperty(t,"encodeErrorResult",{enumerable:!0,get:function(){return C.encodeErrorResult}});var y=Up();Object.defineProperty(t,"encodeEventTopics",{enumerable:!0,get:function(){return y.encodeEventTopics}});var _=Bs();Object.defineProperty(t,"encodeFunctionData",{enumerable:!0,get:function(){return _.encodeFunctionData}});var x=BO();Object.defineProperty(t,"encodeFunctionResult",{enumerable:!0,get:function(){return x.encodeFunctionResult}});var A=O2();Object.defineProperty(t,"parseEventLogs",{enumerable:!0,get:function(){return A.parseEventLogs}});var T=rl();Object.defineProperty(t,"getAbiItem",{enumerable:!0,get:function(){return T.getAbiItem}});var O=Kd();Object.defineProperty(t,"parseAbi",{enumerable:!0,get:function(){return O.parseAbi}}),Object.defineProperty(t,"parseAbiItem",{enumerable:!0,get:function(){return O.parseAbiItem}}),Object.defineProperty(t,"parseAbiParameter",{enumerable:!0,get:function(){return O.parseAbiParameter}}),Object.defineProperty(t,"parseAbiParameters",{enumerable:!0,get:function(){return O.parseAbiParameters}});var k=EX();Object.defineProperty(t,"encodePacked",{enumerable:!0,get:function(){return k.encodePacked}});var j=$Q();Object.defineProperty(t,"formatAbiItemWithArgs",{enumerable:!0,get:function(){return j.formatAbiItemWithArgs}});var N=el();Object.defineProperty(t,"formatAbiItem",{enumerable:!0,get:function(){return N.formatAbiItem}}),Object.defineProperty(t,"formatAbiParams",{enumerable:!0,get:function(){return N.formatAbiParams}});var S=LQ();Object.defineProperty(t,"hashAuthorization",{enumerable:!0,get:function(){return S.hashAuthorization}});var P=nx();Object.defineProperty(t,"recoverAuthorizationAddress",{enumerable:!0,get:function(){return P.recoverAuthorizationAddress}});var I=CX();Object.defineProperty(t,"serializeAuthorizationList",{enumerable:!0,get:function(){return I.serializeAuthorizationList}});var B=zIe();Object.defineProperty(t,"verifyAuthorization",{enumerable:!0,get:function(){return B.verifyAuthorization}});var $=sn();Object.defineProperty(t,"parseAccount",{enumerable:!0,get:function(){return $.parseAccount}});var R=jQ();Object.defineProperty(t,"publicKeyToAddress",{enumerable:!0,get:function(){return R.publicKeyToAddress}});var D=AX();Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return D.getContractAddress}}),Object.defineProperty(t,"getCreateAddress",{enumerable:!0,get:function(){return D.getCreateAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return D.getCreate2Address}});var L=js();Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return L.getAddress}});var U=is();Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return U.isAddress}});var z=fa();Object.defineProperty(t,"isAddressEqual",{enumerable:!0,get:function(){return z.isAddressEqual}});var W=oi();Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return W.concat}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return W.concatBytes}}),Object.defineProperty(t,"concatHex",{enumerable:!0,get:function(){return W.concatHex}});var K=YO();Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return K.isBytes}});var J=ki();Object.defineProperty(t,"isHex",{enumerable:!0,get:function(){return J.isHex}});var ne=Zd();Object.defineProperty(t,"pad",{enumerable:!0,get:function(){return ne.pad}}),Object.defineProperty(t,"padBytes",{enumerable:!0,get:function(){return ne.padBytes}}),Object.defineProperty(t,"padHex",{enumerable:!0,get:function(){return ne.padHex}});var ae=rs();Object.defineProperty(t,"size",{enumerable:!0,get:function(){return ae.size}});var he=go();Object.defineProperty(t,"slice",{enumerable:!0,get:function(){return he.slice}}),Object.defineProperty(t,"sliceBytes",{enumerable:!0,get:function(){return he.sliceBytes}}),Object.defineProperty(t,"sliceHex",{enumerable:!0,get:function(){return he.sliceHex}});var ie=tl();Object.defineProperty(t,"trim",{enumerable:!0,get:function(){return ie.trim}});var Ee=sx();Object.defineProperty(t,"defineBlock",{enumerable:!0,get:function(){return Ee.defineBlock}}),Object.defineProperty(t,"formatBlock",{enumerable:!0,get:function(){return Ee.formatBlock}});var pe=I2();Object.defineProperty(t,"defineTransaction",{enumerable:!0,get:function(){return pe.defineTransaction}}),Object.defineProperty(t,"formatTransaction",{enumerable:!0,get:function(){return pe.formatTransaction}}),Object.defineProperty(t,"transactionType",{enumerable:!0,get:function(){return pe.transactionType}});var ve=ol();Object.defineProperty(t,"formatLog",{enumerable:!0,get:function(){return ve.formatLog}});var je=wx();Object.defineProperty(t,"defineTransactionReceipt",{enumerable:!0,get:function(){return je.defineTransactionReceipt}});var rt=il();Object.defineProperty(t,"defineTransactionRequest",{enumerable:!0,get:function(){return rt.defineTransactionRequest}}),Object.defineProperty(t,"formatTransactionRequest",{enumerable:!0,get:function(){return rt.formatTransactionRequest}});var Ce=_1();Object.defineProperty(t,"extract",{enumerable:!0,get:function(){return Ce.extract}});var fe=x2();Object.defineProperty(t,"toRlp",{enumerable:!0,get:function(){return fe.toRlp}});var ft=Tr();Object.defineProperty(t,"boolToBytes",{enumerable:!0,get:function(){return ft.boolToBytes}}),Object.defineProperty(t,"toBytes",{enumerable:!0,get:function(){return ft.toBytes}}),Object.defineProperty(t,"hexToBytes",{enumerable:!0,get:function(){return ft.hexToBytes}}),Object.defineProperty(t,"numberToBytes",{enumerable:!0,get:function(){return ft.numberToBytes}}),Object.defineProperty(t,"stringToBytes",{enumerable:!0,get:function(){return ft.stringToBytes}});var Wt=ze();Object.defineProperty(t,"boolToHex",{enumerable:!0,get:function(){return Wt.boolToHex}}),Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return Wt.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return Wt.toHex}}),Object.defineProperty(t,"numberToHex",{enumerable:!0,get:function(){return Wt.numberToHex}}),Object.defineProperty(t,"stringToHex",{enumerable:!0,get:function(){return Wt.stringToHex}});var lr=mO();Object.defineProperty(t,"bytesToBigInt",{enumerable:!0,get:function(){return lr.bytesToBigInt}}),Object.defineProperty(t,"bytesToBigint",{enumerable:!0,get:function(){return lr.bytesToBigInt}}),Object.defineProperty(t,"bytesToBool",{enumerable:!0,get:function(){return lr.bytesToBool}}),Object.defineProperty(t,"bytesToNumber",{enumerable:!0,get:function(){return lr.bytesToNumber}}),Object.defineProperty(t,"bytesToString",{enumerable:!0,get:function(){return lr.bytesToString}}),Object.defineProperty(t,"fromBytes",{enumerable:!0,get:function(){return lr.fromBytes}});var dr=nn();Object.defineProperty(t,"fromHex",{enumerable:!0,get:function(){return dr.fromHex}}),Object.defineProperty(t,"hexToBool",{enumerable:!0,get:function(){return dr.hexToBool}}),Object.defineProperty(t,"hexToBigInt",{enumerable:!0,get:function(){return dr.hexToBigInt}}),Object.defineProperty(t,"hexToNumber",{enumerable:!0,get:function(){return dr.hexToNumber}}),Object.defineProperty(t,"hexToString",{enumerable:!0,get:function(){return dr.hexToString}});var hr=JO();Object.defineProperty(t,"fromRlp",{enumerable:!0,get:function(){return hr.fromRlp}});var Er=S2();Object.defineProperty(t,"containsNodeError",{enumerable:!0,get:function(){return Er.containsNodeError}}),Object.defineProperty(t,"getNodeError",{enumerable:!0,get:function(){return Er.getNodeError}});var be=RO();Object.defineProperty(t,"getCallError",{enumerable:!0,get:function(){return be.getCallError}});var Te=eh();Object.defineProperty(t,"getContractError",{enumerable:!0,get:function(){return Te.getContractError}});var Me=FQ();Object.defineProperty(t,"getEstimateGasError",{enumerable:!0,get:function(){return Me.getEstimateGasError}});var st=UO();Object.defineProperty(t,"getTransactionError",{enumerable:!0,get:function(){return st.getTransactionError}});var Cr=ur();Object.defineProperty(t,"getAction",{enumerable:!0,get:function(){return Cr.getAction}});var hn=T2();Object.defineProperty(t,"defineFormatter",{enumerable:!0,get:function(){return hn.defineFormatter}});var ai=v1();Object.defineProperty(t,"toEventSelector",{enumerable:!0,get:function(){return ai.toEventSelector}}),Object.defineProperty(t,"getEventSelector",{enumerable:!0,get:function(){return ai.toEventSelector}});var fn=Lp();Object.defineProperty(t,"toFunctionSelector",{enumerable:!0,get:function(){return fn.toFunctionSelector}}),Object.defineProperty(t,"getFunctionSelector",{enumerable:!0,get:function(){return fn.toFunctionSelector}});var Ms=xX();Object.defineProperty(t,"toEventSignature",{enumerable:!0,get:function(){return Ms.toEventSignature}}),Object.defineProperty(t,"getEventSignature",{enumerable:!0,get:function(){return Ms.toEventSignature}});var mo=SX();Object.defineProperty(t,"toFunctionSignature",{enumerable:!0,get:function(){return mo.toFunctionSignature}}),Object.defineProperty(t,"getFunctionSignature",{enumerable:!0,get:function(){return mo.toFunctionSignature}});var U2=TX();Object.defineProperty(t,"toEventHash",{enumerable:!0,get:function(){return U2.toEventHash}});var F2=IX();Object.defineProperty(t,"toFunctionHash",{enumerable:!0,get:function(){return F2.toFunctionHash}});var Px=QO();Object.defineProperty(t,"isHash",{enumerable:!0,get:function(){return Px.isHash}});var Ox=ns();Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return Ox.keccak256}});var Rx=AO();Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return Rx.sha256}});var kx=OX();Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return kx.ripemd160}});var H2=B2();Object.defineProperty(t,"hashStruct",{enumerable:!0,get:function(){return H2.hashStruct}}),Object.defineProperty(t,"hashTypedData",{enumerable:!0,get:function(){return H2.hashTypedData}});var Nx=th();Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return Nx.recoverAddress}});var q2=XO();Object.defineProperty(t,"recoverMessageAddress",{enumerable:!0,get:function(){return q2.recoverMessageAddress}});var z2=yO();Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return z2.recoverPublicKey}});var x1=eR();Object.defineProperty(t,"recoverTypedDataAddress",{enumerable:!0,get:function(){return x1.recoverTypedDataAddress}});var $x=NX();Object.defineProperty(t,"verifyHash",{enumerable:!0,get:function(){return $x.verifyHash}});var jx=$X();Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return jx.verifyMessage}});var Bx=jX();Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return Bx.verifyTypedData}});var Dx=D2();Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return Dx.hashMessage}});var Mx=BX();Object.defineProperty(t,"parseErc6492Signature",{enumerable:!0,get:function(){return Mx.parseErc6492Signature}});var Lx=Cx();Object.defineProperty(t,"isErc6492Signature",{enumerable:!0,get:function(){return Lx.isErc6492Signature}});var Ux=rR();Object.defineProperty(t,"serializeErc6492Signature",{enumerable:!0,get:function(){return Ux.serializeErc6492Signature}});var S1=nR();Object.defineProperty(t,"getSerializedTransactionType",{enumerable:!0,get:function(){return S1.getSerializedTransactionType}});var ih=lx();Object.defineProperty(t,"getTransactionType",{enumerable:!0,get:function(){return ih.getTransactionType}});var sh=sl();Object.defineProperty(t,"assertRequest",{enumerable:!0,get:function(){return sh.assertRequest}});var gc=_x();Object.defineProperty(t,"assertTransactionEIP1559",{enumerable:!0,get:function(){return gc.assertTransactionEIP1559}}),Object.defineProperty(t,"assertTransactionEIP2930",{enumerable:!0,get:function(){return gc.assertTransactionEIP2930}}),Object.defineProperty(t,"assertTransactionLegacy",{enumerable:!0,get:function(){return gc.assertTransactionLegacy}});var oh=iR();Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return oh.parseTransaction}});var Fx=Ex();Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return Fx.serializeTransaction}});var Hx=ZO();Object.defineProperty(t,"serializeAccessList",{enumerable:!0,get:function(){return Hx.serializeAccessList}});var qx=E2();Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return qx.formatEther}});var zx=Fp();Object.defineProperty(t,"formatGwei",{enumerable:!0,get:function(){return zx.formatGwei}});var Wx=tx();Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return Wx.formatUnits}});var Vx=Ax();Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return Vx.parseUnits}});var Gx=MX();Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return Gx.parseEther}});var Kx=LX();Object.defineProperty(t,"parseGwei",{enumerable:!0,get:function(){return Kx.parseGwei}});var W2=UX();Object.defineProperty(t,"createNonceManager",{enumerable:!0,get:function(){return W2.createNonceManager}}),Object.defineProperty(t,"nonceManager",{enumerable:!0,get:function(){return W2.nonceManager}})}(RT)),RT}var uq;function VIe(){if(uq)return UE;uq=1,Object.defineProperty(UE,"__esModule",{value:!0}),UE.formatProof=r;const t=sR();function e(n){return n.map(i=>({...i,value:BigInt(i.value)}))}function r(n){return{...n,balance:n.balance?BigInt(n.balance):void 0,nonce:n.nonce?(0,t.hexToNumber)(n.nonce):void 0,storageProof:n.storageProof?e(n.storageProof):void 0}}return UE}var lq;function GIe(){if(lq)return LE;lq=1,Object.defineProperty(LE,"__esModule",{value:!0}),LE.getProof=r;const t=ze(),e=VIe();async function r(n,{address:i,blockNumber:s,blockTag:o,storageKeys:a}){const c=o??"latest",u=s!==void 0?(0,t.numberToHex)(s):void 0,l=await n.request({method:"eth_getProof",params:[i,a,u||c]});return(0,e.formatProof)(l)}return LE}var h5={},dq;function KIe(){if(dq)return h5;dq=1,Object.defineProperty(h5,"__esModule",{value:!0}),h5.getStorageAt=e;const t=ze();async function e(r,{address:n,blockNumber:i,blockTag:s="latest",slot:o}){const a=i!==void 0?(0,t.numberToHex)(i):void 0;return await r.request({method:"eth_getStorageAt",params:[n,o,a||s]})}return h5}var f5={},hq;function oR(){if(hq)return f5;hq=1,Object.defineProperty(f5,"__esModule",{value:!0}),f5.getTransaction=n;const t=Ds(),e=ze(),r=I2();async function n(i,{blockHash:s,blockNumber:o,blockTag:a,hash:c,index:u}){var g,p,m;const l=a||"latest",d=o!==void 0?(0,e.numberToHex)(o):void 0;let h=null;if(c?h=await i.request({method:"eth_getTransactionByHash",params:[c]},{dedupe:!0}):s?h=await i.request({method:"eth_getTransactionByBlockHashAndIndex",params:[s,(0,e.numberToHex)(u)]},{dedupe:!0}):h=await i.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[d||l,(0,e.numberToHex)(u)]},{dedupe:!!d}),!h)throw new t.TransactionNotFoundError({blockHash:s,blockNumber:o,blockTag:l,hash:c,index:u});return(((m=(p=(g=i.chain)==null?void 0:g.formatters)==null?void 0:p.transaction)==null?void 0:m.format)||r.formatTransaction)(h)}return f5}var p5={},fq;function ZIe(){if(fq)return p5;fq=1,Object.defineProperty(p5,"__esModule",{value:!0}),p5.getTransactionConfirmations=n;const t=ur(),e=$2(),r=oR();async function n(i,{hash:s,transactionReceipt:o}){const[a,c]=await Promise.all([(0,t.getAction)(i,e.getBlockNumber,"getBlockNumber")({}),s?(0,t.getAction)(i,r.getTransaction,"getTransaction")({hash:s}):void 0]),u=(o==null?void 0:o.blockNumber)||(c==null?void 0:c.blockNumber);return u?a-u+1n:0n}return p5}var g5={},pq;function FX(){if(pq)return g5;pq=1,Object.defineProperty(g5,"__esModule",{value:!0}),g5.getTransactionReceipt=r;const t=Ds(),e=wx();async function r(n,{hash:i}){var a,c,u;const s=await n.request({method:"eth_getTransactionReceipt",params:[i]},{dedupe:!0});if(!s)throw new t.TransactionReceiptNotFoundError({hash:i});return(((u=(c=(a=n.chain)==null?void 0:a.formatters)==null?void 0:c.transactionReceipt)==null?void 0:u.format)||e.formatTransactionReceipt)(s)}return g5}var m5={},gq;function YIe(){if(gq)return m5;gq=1,Object.defineProperty(m5,"__esModule",{value:!0}),m5.multicall=l;const t=rh(),e=$r(),r=_t(),n=Qd(),i=al(),s=Bs(),o=nh(),a=eh(),c=ur(),u=ul();async function l(d,h){var k;const{account:f,allowFailure:g=!0,batchSize:p,blockNumber:m,blockTag:b,multicallAddress:v,stateOverride:E}=h,w=h.contracts,C=p??(typeof((k=d.batch)==null?void 0:k.multicall)=="object"&&d.batch.multicall.batchSize||1024);let y=v;if(!y){if(!d.chain)throw new Error("client chain not configured. multicallAddress is required.");y=(0,o.getChainContractAddress)({blockNumber:m,chain:d.chain,contract:"multicall3"})}const _=[[]];let x=0,A=0;for(let j=0;j<w.length;j++){const{abi:N,address:S,args:P,functionName:I}=w[j];try{const B=(0,s.encodeFunctionData)({abi:N,args:P,functionName:I});A+=(B.length-2)/2,C>0&&A>C&&_[x].length>0&&(x++,A=(B.length-2)/2,_[x]=[]),_[x]=[..._[x],{allowFailure:!0,callData:B,target:S}]}catch(B){const $=(0,a.getContractError)(B,{abi:N,address:S,args:P,docsPath:"/docs/contract/multicall",functionName:I,sender:f});if(!g)throw $;_[x]=[..._[x],{allowFailure:!0,callData:"0x",target:S}]}}const T=await Promise.allSettled(_.map(j=>(0,c.getAction)(d,u.readContract,"readContract")({abi:t.multicall3Abi,account:f,address:y,args:[j],blockNumber:m,blockTag:b,functionName:"aggregate3",stateOverride:E}))),O=[];for(let j=0;j<T.length;j++){const N=T[j];if(N.status==="rejected"){if(!g)throw N.reason;for(let P=0;P<_[j].length;P++)O.push({status:"failure",error:N.reason,result:void 0});continue}const S=N.value;for(let P=0;P<S.length;P++){const{returnData:I,success:B}=S[P],{callData:$}=_[j][P],{abi:R,address:D,functionName:L,args:U}=w[O.length];try{if($==="0x")throw new e.AbiDecodingZeroDataError;if(!B)throw new n.RawContractError({data:I});const z=(0,i.decodeFunctionResult)({abi:R,args:U,data:I,functionName:L});O.push(g?{result:z,status:"success"}:z)}catch(z){const W=(0,a.getContractError)(z,{abi:R,address:D,args:U,docsPath:"/docs/contract/multicall",functionName:L});if(!g)throw W;O.push({error:W,result:void 0,status:"failure"})}}}if(O.length!==w.length)throw new r.BaseError("multicall results mismatch");return O}return m5}var w5={},mq;function HX(){if(mq)return w5;mq=1,Object.defineProperty(w5,"__esModule",{value:!0}),w5.simulateBlocks=p;const t=XQ(),e=sn(),r=$r(),n=Qd(),i=nl(),s=al(),o=Bs(),a=ze(),c=eh(),u=S2(),l=sx(),d=ol(),h=il(),f=vO(),g=sl();async function p(m,b){const{blockNumber:v,blockTag:E="latest",blocks:w,returnFullTransactions:C,traceTransfers:y,validation:_}=b;try{const x=[];for(const k of w){const j=k.blockOverrides?t.toRpc(k.blockOverrides):void 0,N=k.calls.map(P=>{const I=P,B=I.account?(0,e.parseAccount)(I.account):void 0,$={...I,data:I.abi?(0,o.encodeFunctionData)(I):I.data,from:I.from??(B==null?void 0:B.address)};return(0,g.assertRequest)($),(0,h.formatTransactionRequest)($)}),S=k.stateOverrides?(0,f.serializeStateOverride)(k.stateOverrides):void 0;x.push({blockOverrides:j,calls:N,stateOverrides:S})}const T=(typeof v=="bigint"?(0,a.numberToHex)(v):void 0)||E;return(await m.request({method:"eth_simulateV1",params:[{blockStateCalls:x,returnFullTransactions:C,traceTransfers:y,validation:_},T]})).map((k,j)=>({...(0,l.formatBlock)(k),calls:k.calls.map((N,S)=>{var K,J;const{abi:P,args:I,functionName:B,to:$}=w[j].calls[S],R=((K=N.error)==null?void 0:K.data)??N.returnData,D=BigInt(N.gasUsed),L=(J=N.logs)==null?void 0:J.map(ne=>(0,d.formatLog)(ne)),U=N.status==="0x1"?"success":"failure",z=P&&U==="success"&&R!=="0x"?(0,s.decodeFunctionResult)({abi:P,data:R,functionName:B}):null,W=(()=>{var ae;if(U==="success")return;let ne;if(((ae=N.error)==null?void 0:ae.data)==="0x"?ne=new r.AbiDecodingZeroDataError:N.error&&(ne=new n.RawContractError(N.error)),!!ne)return(0,c.getContractError)(ne,{abi:P??[],address:$,args:I,functionName:B??"<unknown>"})})();return{data:R,gasUsed:D,logs:L,status:U,...U==="success"?{result:z}:{error:W}}})}))}catch(x){const A=x,T=(0,u.getNodeError)(A,{});throw T instanceof i.UnknownNodeError?A:T}}return w5}var b5={},Rl={},di={},Oh={},wq;function qX(){if(wq)return Oh;wq=1,Object.defineProperty(Oh,"__esModule",{value:!0}),Oh.keccak256=s,Oh.ripemd160=o,Oh.sha256=a,Oh.validate=c;const t=PX(),e=fO(),r=zQ(),n=Hp(),i=pa();function s(u,l={}){const{as:d=typeof u=="string"?"Hex":"Bytes"}=l,h=(0,e.keccak_256)(n.from(u));return d==="Bytes"?h:i.fromBytes(h)}function o(u,l={}){const{as:d=typeof u=="string"?"Hex":"Bytes"}=l,h=(0,t.ripemd160)(n.from(u));return d==="Bytes"?h:i.fromBytes(h)}function a(u,l={}){const{as:d=typeof u=="string"?"Hex":"Bytes"}=l,h=(0,r.sha256)(n.from(u));return d==="Bytes"?h:i.fromBytes(h)}function c(u){return i.validate(u)&&i.size(u)===32}return Oh}var N0={},hi={},$0={},Yw={},bq;function JIe(){if(bq)return Yw;bq=1,Object.defineProperty(Yw,"__esModule",{value:!0}),Yw.LruMap=void 0;class t extends Map{constructor(r){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=r}get(r){const n=super.get(r);return super.has(r)&&n!==void 0&&(this.delete(r),super.set(r,n)),n}set(r,n){if(super.set(r,n),this.maxSize&&this.size>this.maxSize){const i=this.keys().next().value;i&&this.delete(i)}return this}}return Yw.LruMap=t,Yw}var yq;function QIe(){if(yq)return $0;yq=1,Object.defineProperty($0,"__esModule",{value:!0}),$0.checksum=void 0,$0.clear=r;const t=JIe(),e={checksum:new t.LruMap(8192)};$0.checksum=e.checksum;function r(){for(const n of Object.values(e))n.clear()}return $0}var zr={},vq;function XIe(){if(vq)return zr;vq=1,Object.defineProperty(zr,"__esModule",{value:!0}),zr.InvalidSerializedSizeError=zr.InvalidUncompressedPrefixError=zr.InvalidCompressedPrefixError=zr.InvalidPrefixError=zr.InvalidError=void 0,zr.assert=i,zr.compress=s,zr.from=o,zr.fromBytes=a,zr.fromHex=c,zr.toBytes=u,zr.toHex=l,zr.validate=d;const t=Hp(),e=cl(),r=pa(),n=OO();function i(b,v={}){const{compressed:E}=v,{prefix:w,x:C,y}=b;if(E===!1||typeof C=="bigint"&&typeof y=="bigint"){if(w!==4)throw new f({prefix:w,cause:new p});return}if(E===!0||typeof C=="bigint"&&typeof y>"u"){if(w!==3&&w!==2)throw new f({prefix:w,cause:new g});return}throw new h({publicKey:b})}function s(b){const{x:v,y:E}=b;return{prefix:E%2n===0n?2:3,x:v}}function o(b){const v=(()=>{if(r.validate(b))return c(b);if(t.validate(b))return a(b);const{prefix:E,x:w,y:C}=b;return typeof w=="bigint"&&typeof C=="bigint"?{prefix:E??4,x:w,y:C}:{prefix:E,x:w}})();return i(v),v}function a(b){return c(r.fromBytes(b))}function c(b){if(b.length!==132&&b.length!==130&&b.length!==68)throw new m({publicKey:b});if(b.length===130){const w=BigInt(r.slice(b,0,32)),C=BigInt(r.slice(b,32,64));return{prefix:4,x:w,y:C}}if(b.length===132){const w=Number(r.slice(b,0,1)),C=BigInt(r.slice(b,1,33)),y=BigInt(r.slice(b,33,65));return{prefix:w,x:C,y}}const v=Number(r.slice(b,0,1)),E=BigInt(r.slice(b,1,33));return{prefix:v,x:E}}function u(b,v={}){return t.fromHex(l(b,v))}function l(b,v={}){i(b);const{prefix:E,x:w,y:C}=b,{includePrefix:y=!0}=v;return r.concat(y?r.fromNumber(E,{size:1}):"0x",r.fromNumber(w,{size:32}),typeof C=="bigint"?r.fromNumber(C,{size:32}):"0x")}function d(b,v={}){try{return i(b,v),!0}catch{return!1}}class h extends e.BaseError{constructor({publicKey:v}){super(`Value \`${n.stringify(v)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}zr.InvalidError=h;class f extends e.BaseError{constructor({prefix:v,cause:E}){super(`Prefix "${v}" is invalid.`,{cause:E}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}zr.InvalidPrefixError=f;class g extends e.BaseError{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}zr.InvalidCompressedPrefixError=g;class p extends e.BaseError{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}zr.InvalidUncompressedPrefixError=p;class m extends e.BaseError{constructor({publicKey:v}){super(`Value \`${v}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${r.size(r.from(v))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}return zr.InvalidSerializedSizeError=m,zr}var _q;function aR(){if(_q)return hi;_q=1,Object.defineProperty(hi,"__esModule",{value:!0}),hi.InvalidChecksumError=hi.InvalidInputError=hi.InvalidAddressError=void 0,hi.assert=o,hi.checksum=a,hi.from=c,hi.fromPublicKey=u,hi.isEqual=l,hi.validate=d;const t=Hp(),e=QIe(),r=cl(),n=qX(),i=XIe(),s=/^0x[a-fA-F0-9]{40}$/;function o(p,m={}){const{strict:b=!0}=m;if(!s.test(p))throw new h({address:p,cause:new f});if(b){if(p.toLowerCase()===p)return;if(a(p)!==p)throw new h({address:p,cause:new g})}}function a(p){if(e.checksum.has(p))return e.checksum.get(p);o(p,{strict:!1});const m=p.substring(2).toLowerCase(),b=n.keccak256(t.fromString(m),{as:"Bytes"}),v=m.split("");for(let w=0;w<40;w+=2)b[w>>1]>>4>=8&&v[w]&&(v[w]=v[w].toUpperCase()),(b[w>>1]&15)>=8&&v[w+1]&&(v[w+1]=v[w+1].toUpperCase());const E=`0x${v.join("")}`;return e.checksum.set(p,E),E}function c(p,m={}){const{checksum:b=!1}=m;return o(p),b?a(p):p}function u(p,m={}){const b=n.keccak256(`0x${i.toHex(p).slice(4)}`).substring(26);return c(`0x${b}`,m)}function l(p,m){return o(p,{strict:!1}),o(m,{strict:!1}),p.toLowerCase()===m.toLowerCase()}function d(p,m={}){const{strict:b=!0}=m??{};try{return o(p,{strict:b}),!0}catch{return!1}}class h extends r.BaseError{constructor({address:m,cause:b}){super(`Address "${m}" is invalid.`,{cause:b}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}hi.InvalidAddressError=h;class f extends r.BaseError{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}hi.InvalidInputError=f;class g extends r.BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}return hi.InvalidChecksumError=g,hi}var Eq;function ePe(){if(Eq)return N0;Eq=1,Object.defineProperty(N0,"__esModule",{value:!0}),N0.normalizeSignature=r,N0.isArgOfType=n,N0.getAmbiguousTypes=i;const t=aR(),e=cl();function r(s){let o=!0,a="",c=0,u="",l=!1;for(let d=0;d<s.length;d++){const h=s[d];if(["(",")",","].includes(h)&&(o=!0),h==="("&&c++,h===")"&&c--,!!o){if(c===0){if(h===" "&&["event","function","error",""].includes(u))u="";else if(u+=h,h===")"){l=!0;break}continue}if(h===" "){s[d-1]!==","&&a!==","&&a!==",("&&(a="",o=!1);continue}u+=h,a+=h}}if(!l)throw new e.BaseError("Unable to normalize signature.");return u}function n(s,o){const a=typeof s,c=o.type;switch(c){case"address":return t.validate(s,{strict:!1});case"bool":return a==="boolean";case"function":return a==="string";case"string":return a==="string";default:return c==="tuple"&&"components"in o?Object.values(o.components).every((u,l)=>n(Object.values(s)[l],u)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(c)?a==="number"||a==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(c)?a==="string"||s instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(c)?Array.isArray(s)&&s.every(u=>n(u,{...o,type:c.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function i(s,o,a){for(const c in s){const u=s[c],l=o[c];if(u.type==="tuple"&&l.type==="tuple"&&"components"in u&&"components"in l)return i(u.components,l.components,a[c]);const d=[u.type,l.type];if(d.includes("address")&&d.includes("bytes20")?!0:d.includes("address")&&d.includes("string")?t.validate(a[c],{strict:!1}):d.includes("address")&&d.includes("bytes")?t.validate(a[c],{strict:!1}):!1)return d}}return N0}var Cq;function zX(){if(Cq)return di;Cq=1,Object.defineProperty(di,"__esModule",{value:!0}),di.InvalidSelectorSizeError=di.NotFoundError=di.AmbiguityError=void 0,di.format=s,di.from=o,di.fromAbi=a,di.getSelector=c,di.getSignature=u,di.getSignatureHash=l;const t=Kd(),e=cl(),r=qX(),n=pa(),i=ePe();function s(g){return t.formatAbiItem(g)}function o(g,p={}){const{prepare:m=!0}=p,b=Array.isArray(g)||typeof g=="string"?t.parseAbiItem(g):g;return{...b,...m?{hash:l(b)}:{}}}function a(g,p,m){const{args:b=[],prepare:v=!0}=m??{},E=n.validate(p,{strict:!1}),w=g.filter(_=>E?_.type==="function"||_.type==="error"?c(_)===n.slice(p,0,4):_.type==="event"?l(_)===p:!1:"name"in _&&_.name===p);if(w.length===0)throw new h({name:p});if(w.length===1)return{...w[0],...v?{hash:l(w[0])}:{}};let C;for(const _ of w){if(!("inputs"in _))continue;if(!b||b.length===0){if(!_.inputs||_.inputs.length===0)return{..._,...v?{hash:l(_)}:{}};continue}if(!_.inputs||_.inputs.length===0||_.inputs.length!==b.length)continue;if(b.every((A,T)=>{const O="inputs"in _&&_.inputs[T];return O?i.isArgOfType(A,O):!1})){if(C&&"inputs"in C&&C.inputs){const A=i.getAmbiguousTypes(_.inputs,C.inputs,b);if(A)throw new d({abiItem:_,type:A[0]},{abiItem:C,type:A[1]})}C=_}}const y=(()=>{if(C)return C;const[_,...x]=w;return{..._,overloads:x}})();if(!y)throw new h({name:p});return{...y,...v?{hash:l(y)}:{}}}function c(g){return n.slice(l(g),0,4)}function u(g){const p=typeof g=="string"?g:t.formatAbiItem(g);return i.normalizeSignature(p)}function l(g){return typeof g!="string"&&"hash"in g&&g.hash?g.hash:r.keccak256(n.fromString(u(g)))}class d extends e.BaseError{constructor(p,m){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${p.type}\` in \`${i.normalizeSignature(t.formatAbiItem(p.abiItem))}\`, and`,`\`${m.type}\` in \`${i.normalizeSignature(t.formatAbiItem(m.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}di.AmbiguityError=d;class h extends e.BaseError{constructor({name:p,data:m,type:b="item"}){const v=p?` with name "${p}"`:m?` with data "${m}"`:"";super(`ABI ${b}${v} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}di.NotFoundError=h;class f extends e.BaseError{constructor({data:p}){super(`Selector size is invalid. Expected 4 bytes. Received ${n.size(p)} bytes ("${p}").`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.InvalidSelectorSizeError"})}}return di.InvalidSelectorSizeError=f,di}var jr={},Y={},Aq;function WX(){return Aq||(Aq=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.minInt120=Y.minInt112=Y.minInt104=Y.minInt96=Y.minInt88=Y.minInt80=Y.minInt72=Y.minInt64=Y.minInt56=Y.minInt48=Y.minInt40=Y.minInt32=Y.minInt24=Y.minInt16=Y.minInt8=Y.maxInt256=Y.maxInt248=Y.maxInt240=Y.maxInt232=Y.maxInt224=Y.maxInt216=Y.maxInt208=Y.maxInt200=Y.maxInt192=Y.maxInt184=Y.maxInt176=Y.maxInt168=Y.maxInt160=Y.maxInt152=Y.maxInt144=Y.maxInt136=Y.maxInt128=Y.maxInt120=Y.maxInt112=Y.maxInt104=Y.maxInt96=Y.maxInt88=Y.maxInt80=Y.maxInt72=Y.maxInt64=Y.maxInt56=Y.maxInt48=Y.maxInt40=Y.maxInt32=Y.maxInt24=Y.maxInt16=Y.maxInt8=Y.integerRegex=Y.bytesRegex=Y.arrayRegex=void 0,Y.maxUint256=Y.maxUint248=Y.maxUint240=Y.maxUint232=Y.maxUint224=Y.maxUint216=Y.maxUint208=Y.maxUint200=Y.maxUint192=Y.maxUint184=Y.maxUint176=Y.maxUint168=Y.maxUint160=Y.maxUint152=Y.maxUint144=Y.maxUint136=Y.maxUint128=Y.maxUint120=Y.maxUint112=Y.maxUint104=Y.maxUint96=Y.maxUint88=Y.maxUint80=Y.maxUint72=Y.maxUint64=Y.maxUint56=Y.maxUint48=Y.maxUint40=Y.maxUint32=Y.maxUint24=Y.maxUint16=Y.maxUint8=Y.minInt256=Y.minInt248=Y.minInt240=Y.minInt232=Y.minInt224=Y.minInt216=Y.minInt208=Y.minInt200=Y.minInt192=Y.minInt184=Y.minInt176=Y.minInt168=Y.minInt160=Y.minInt152=Y.minInt144=Y.minInt136=Y.minInt128=void 0,Y.arrayRegex=/^(.*)\[([0-9]*)\]$/,Y.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Y.integerRegex=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Y.maxInt8=2n**(8n-1n)-1n,Y.maxInt16=2n**(16n-1n)-1n,Y.maxInt24=2n**(24n-1n)-1n,Y.maxInt32=2n**(32n-1n)-1n,Y.maxInt40=2n**(40n-1n)-1n,Y.maxInt48=2n**(48n-1n)-1n,Y.maxInt56=2n**(56n-1n)-1n,Y.maxInt64=2n**(64n-1n)-1n,Y.maxInt72=2n**(72n-1n)-1n,Y.maxInt80=2n**(80n-1n)-1n,Y.maxInt88=2n**(88n-1n)-1n,Y.maxInt96=2n**(96n-1n)-1n,Y.maxInt104=2n**(104n-1n)-1n,Y.maxInt112=2n**(112n-1n)-1n,Y.maxInt120=2n**(120n-1n)-1n,Y.maxInt128=2n**(128n-1n)-1n,Y.maxInt136=2n**(136n-1n)-1n,Y.maxInt144=2n**(144n-1n)-1n,Y.maxInt152=2n**(152n-1n)-1n,Y.maxInt160=2n**(160n-1n)-1n,Y.maxInt168=2n**(168n-1n)-1n,Y.maxInt176=2n**(176n-1n)-1n,Y.maxInt184=2n**(184n-1n)-1n,Y.maxInt192=2n**(192n-1n)-1n,Y.maxInt200=2n**(200n-1n)-1n,Y.maxInt208=2n**(208n-1n)-1n,Y.maxInt216=2n**(216n-1n)-1n,Y.maxInt224=2n**(224n-1n)-1n,Y.maxInt232=2n**(232n-1n)-1n,Y.maxInt240=2n**(240n-1n)-1n,Y.maxInt248=2n**(248n-1n)-1n,Y.maxInt256=2n**(256n-1n)-1n,Y.minInt8=-(2n**(8n-1n)),Y.minInt16=-(2n**(16n-1n)),Y.minInt24=-(2n**(24n-1n)),Y.minInt32=-(2n**(32n-1n)),Y.minInt40=-(2n**(40n-1n)),Y.minInt48=-(2n**(48n-1n)),Y.minInt56=-(2n**(56n-1n)),Y.minInt64=-(2n**(64n-1n)),Y.minInt72=-(2n**(72n-1n)),Y.minInt80=-(2n**(80n-1n)),Y.minInt88=-(2n**(88n-1n)),Y.minInt96=-(2n**(96n-1n)),Y.minInt104=-(2n**(104n-1n)),Y.minInt112=-(2n**(112n-1n)),Y.minInt120=-(2n**(120n-1n)),Y.minInt128=-(2n**(128n-1n)),Y.minInt136=-(2n**(136n-1n)),Y.minInt144=-(2n**(144n-1n)),Y.minInt152=-(2n**(152n-1n)),Y.minInt160=-(2n**(160n-1n)),Y.minInt168=-(2n**(168n-1n)),Y.minInt176=-(2n**(176n-1n)),Y.minInt184=-(2n**(184n-1n)),Y.minInt192=-(2n**(192n-1n)),Y.minInt200=-(2n**(200n-1n)),Y.minInt208=-(2n**(208n-1n)),Y.minInt216=-(2n**(216n-1n)),Y.minInt224=-(2n**(224n-1n)),Y.minInt232=-(2n**(232n-1n)),Y.minInt240=-(2n**(240n-1n)),Y.minInt248=-(2n**(248n-1n)),Y.minInt256=-(2n**(256n-1n)),Y.maxUint8=2n**8n-1n,Y.maxUint16=2n**16n-1n,Y.maxUint24=2n**24n-1n,Y.maxUint32=2n**32n-1n,Y.maxUint40=2n**40n-1n,Y.maxUint48=2n**48n-1n,Y.maxUint56=2n**56n-1n,Y.maxUint64=2n**64n-1n,Y.maxUint72=2n**72n-1n,Y.maxUint80=2n**80n-1n,Y.maxUint88=2n**88n-1n,Y.maxUint96=2n**96n-1n,Y.maxUint104=2n**104n-1n,Y.maxUint112=2n**112n-1n,Y.maxUint120=2n**120n-1n,Y.maxUint128=2n**128n-1n,Y.maxUint136=2n**136n-1n,Y.maxUint144=2n**144n-1n,Y.maxUint152=2n**152n-1n,Y.maxUint160=2n**160n-1n,Y.maxUint168=2n**168n-1n,Y.maxUint176=2n**176n-1n,Y.maxUint184=2n**184n-1n,Y.maxUint192=2n**192n-1n,Y.maxUint200=2n**200n-1n,Y.maxUint208=2n**208n-1n,Y.maxUint216=2n**216n-1n,Y.maxUint224=2n**224n-1n,Y.maxUint232=2n**232n-1n,Y.maxUint240=2n**240n-1n,Y.maxUint248=2n**248n-1n,Y.maxUint256=2n**256n-1n),Y}var Br={},xq;function tPe(){if(xq)return Br;xq=1,Object.defineProperty(Br,"__esModule",{value:!0}),Br.decodeParameter=o,Br.decodeAddress=u,Br.decodeArray=l,Br.decodeBool=d,Br.decodeBytes=h,Br.decodeNumber=f,Br.decodeTuple=g,Br.decodeString=p,Br.prepareParameters=m,Br.prepareParameter=b,Br.encode=v,Br.encodeAddress=E,Br.encodeArray=w,Br.encodeBytes=C,Br.encodeBoolean=y,Br.encodeNumber=_,Br.encodeString=x,Br.encodeTuple=A,Br.getArrayComponents=T,Br.hasDynamicChild=O;const t=cR(),e=aR(),r=Hp(),n=cl(),i=pa(),s=WX();function o(k,j,N){const{checksumAddress:S,staticPosition:P}=N,I=T(j.type);if(I){const[B,$]=I;return l(k,{...j,type:$},{checksumAddress:S,length:B,staticPosition:P})}if(j.type==="tuple")return g(k,j,{checksumAddress:S,staticPosition:P});if(j.type==="address")return u(k,{checksum:S});if(j.type==="bool")return d(k);if(j.type.startsWith("bytes"))return h(k,j,{staticPosition:P});if(j.type.startsWith("uint")||j.type.startsWith("int"))return f(k,j);if(j.type==="string")return p(k,{staticPosition:P});throw new t.InvalidTypeError(j.type)}const a=32,c=32;function u(k,j={}){const{checksum:N=!1}=j,S=k.readBytes(32);return[(I=>N?e.checksum(I):I)(i.fromBytes(r.slice(S,-20))),32]}function l(k,j,N){const{checksumAddress:S,length:P,staticPosition:I}=N;if(!P){const R=r.toNumber(k.readBytes(c)),D=I+R,L=D+a;k.setPosition(D);const U=r.toNumber(k.readBytes(a)),z=O(j);let W=0;const K=[];for(let J=0;J<U;++J){k.setPosition(L+(z?J*32:W));const[ne,ae]=o(k,j,{checksumAddress:S,staticPosition:L});W+=ae,K.push(ne)}return k.setPosition(I+32),[K,32]}if(O(j)){const R=r.toNumber(k.readBytes(c)),D=I+R,L=[];for(let U=0;U<P;++U){k.setPosition(D+U*32);const[z]=o(k,j,{checksumAddress:S,staticPosition:D});L.push(z)}return k.setPosition(I+32),[L,32]}let B=0;const $=[];for(let R=0;R<P;++R){const[D,L]=o(k,j,{checksumAddress:S,staticPosition:I+B});B+=L,$.push(D)}return[$,B]}function d(k){return[r.toBoolean(k.readBytes(32),{size:32}),32]}function h(k,j,{staticPosition:N}){const[S,P]=j.type.split("bytes");if(!P){const B=r.toNumber(k.readBytes(32));k.setPosition(N+B);const $=r.toNumber(k.readBytes(32));if($===0)return k.setPosition(N+32),["0x",32];const R=k.readBytes($);return k.setPosition(N+32),[i.fromBytes(R),32]}return[i.fromBytes(k.readBytes(Number.parseInt(P),32)),32]}function f(k,j){const N=j.type.startsWith("int"),S=Number.parseInt(j.type.split("int")[1]||"256"),P=k.readBytes(32);return[S>48?r.toBigInt(P,{signed:N}):r.toNumber(P,{signed:N}),32]}function g(k,j,N){const{checksumAddress:S,staticPosition:P}=N,I=j.components.length===0||j.components.some(({name:R})=>!R),B=I?[]:{};let $=0;if(O(j)){const R=r.toNumber(k.readBytes(c)),D=P+R;for(let L=0;L<j.components.length;++L){const U=j.components[L];k.setPosition(D+$);const[z,W]=o(k,U,{checksumAddress:S,staticPosition:D});$+=W,B[I?L:U==null?void 0:U.name]=z}return k.setPosition(P+32),[B,32]}for(let R=0;R<j.components.length;++R){const D=j.components[R],[L,U]=o(k,D,{checksumAddress:S,staticPosition:P});B[I?R:D==null?void 0:D.name]=L,$+=U}return[B,$]}function p(k,{staticPosition:j}){const N=r.toNumber(k.readBytes(32)),S=j+N;k.setPosition(S);const P=r.toNumber(k.readBytes(32));if(P===0)return k.setPosition(j+32),["",32];const I=k.readBytes(P,32),B=r.toString(r.trimLeft(I));return k.setPosition(j+32),[B,32]}function m({checksumAddress:k,parameters:j,values:N}){const S=[];for(let P=0;P<j.length;P++)S.push(b({checksumAddress:k,parameter:j[P],value:N[P]}));return S}function b({checksumAddress:k=!1,parameter:j,value:N}){const S=j,P=T(S.type);if(P){const[I,B]=P;return w(N,{checksumAddress:k,length:I,parameter:{...S,type:B}})}if(S.type==="tuple")return A(N,{checksumAddress:k,parameter:S});if(S.type==="address")return E(N,{checksum:k});if(S.type==="bool")return y(N);if(S.type.startsWith("uint")||S.type.startsWith("int")){const I=S.type.startsWith("int"),[,,B="256"]=s.integerRegex.exec(S.type)??[];return _(N,{signed:I,size:Number(B)})}if(S.type.startsWith("bytes"))return C(N,{type:S.type});if(S.type==="string")return x(N);throw new t.InvalidTypeError(S.type)}function v(k){let j=0;for(let I=0;I<k.length;I++){const{dynamic:B,encoded:$}=k[I];B?j+=32:j+=i.size($)}const N=[],S=[];let P=0;for(let I=0;I<k.length;I++){const{dynamic:B,encoded:$}=k[I];B?(N.push(i.fromNumber(j+P,{size:32})),S.push($),P+=i.size($)):N.push($)}return i.concat(...N,...S)}function E(k,j){const{checksum:N=!1}=j;return e.assert(k,{strict:N}),{dynamic:!1,encoded:i.padLeft(k.toLowerCase())}}function w(k,j){const{checksumAddress:N,length:S,parameter:P}=j,I=S===null;if(!Array.isArray(k))throw new t.InvalidArrayError(k);if(!I&&k.length!==S)throw new t.ArrayLengthMismatchError({expectedLength:S,givenLength:k.length,type:`${P.type}[${S}]`});let B=!1;const $=[];for(let R=0;R<k.length;R++){const D=b({checksumAddress:N,parameter:P,value:k[R]});D.dynamic&&(B=!0),$.push(D)}if(I||B){const R=v($);if(I){const D=i.fromNumber($.length,{size:32});return{dynamic:!0,encoded:$.length>0?i.concat(D,R):D}}if(B)return{dynamic:!0,encoded:R}}return{dynamic:!1,encoded:i.concat(...$.map(({encoded:R})=>R))}}function C(k,{type:j}){const[,N]=j.split("bytes"),S=i.size(k);if(!N){let P=k;return S%32!==0&&(P=i.padRight(P,Math.ceil((k.length-2)/2/32)*32)),{dynamic:!0,encoded:i.concat(i.padLeft(i.fromNumber(S,{size:32})),P)}}if(S!==Number.parseInt(N))throw new t.BytesSizeMismatchError({expectedSize:Number.parseInt(N),value:k});return{dynamic:!1,encoded:i.padRight(k)}}function y(k){if(typeof k!="boolean")throw new n.BaseError(`Invalid boolean value: "${k}" (type: ${typeof k}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:i.padLeft(i.fromBoolean(k))}}function _(k,{signed:j,size:N}){if(typeof N=="number"){const S=2n**(BigInt(N)-(j?1n:0n))-1n,P=j?-S-1n:0n;if(k>S||k<P)throw new i.IntegerOutOfRangeError({max:S.toString(),min:P.toString(),signed:j,size:N/8,value:k.toString()})}return{dynamic:!1,encoded:i.fromNumber(k,{size:32,signed:j})}}function x(k){const j=i.fromString(k),N=Math.ceil(i.size(j)/32),S=[];for(let P=0;P<N;P++)S.push(i.padRight(i.slice(j,P*32,(P+1)*32)));return{dynamic:!0,encoded:i.concat(i.padRight(i.fromNumber(i.size(j),{size:32})),...S)}}function A(k,j){const{checksumAddress:N,parameter:S}=j;let P=!1;const I=[];for(let B=0;B<S.components.length;B++){const $=S.components[B],R=Array.isArray(k)?B:$.name,D=b({checksumAddress:N,parameter:$,value:k[R]});I.push(D),D.dynamic&&(P=!0)}return{dynamic:P,encoded:P?v(I):i.concat(...I.map(({encoded:B})=>B))}}function T(k){const j=k.match(/^(.*)\[(\d+)?\]$/);return j?[j[2]?Number(j[2]):null,j[1]]:void 0}function O(k){var S;const{type:j}=k;if(j==="string"||j==="bytes"||j.endsWith("[]"))return!0;if(j==="tuple")return(S=k.components)==null?void 0:S.some(O);const N=T(k.type);return!!(N&&O({...k,type:N[1]}))}return Br}var Aa={},Sq;function rPe(){if(Sq)return Aa;Sq=1,Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.RecursiveReadLimitExceededError=Aa.PositionOutOfBoundsError=Aa.NegativeOffsetError=void 0,Aa.create=r;const t=cl(),e={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new s({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(o){if(o<0||o>this.bytes.length-1)throw new i({length:this.bytes.length,position:o})},decrementPosition(o){if(o<0)throw new n({offset:o});const a=this.position-o;this.assertPosition(a),this.position=a},getReadCount(o){return this.positionReadCount.get(o||this.position)||0},incrementPosition(o){if(o<0)throw new n({offset:o});const a=this.position+o;this.assertPosition(a),this.position=a},inspectByte(o){const a=o??this.position;return this.assertPosition(a),this.bytes[a]},inspectBytes(o,a){const c=a??this.position;return this.assertPosition(c+o-1),this.bytes.subarray(c,c+o)},inspectUint8(o){const a=o??this.position;return this.assertPosition(a),this.bytes[a]},inspectUint16(o){const a=o??this.position;return this.assertPosition(a+1),this.dataView.getUint16(a)},inspectUint24(o){const a=o??this.position;return this.assertPosition(a+2),(this.dataView.getUint16(a)<<8)+this.dataView.getUint8(a+2)},inspectUint32(o){const a=o??this.position;return this.assertPosition(a+3),this.dataView.getUint32(a)},pushByte(o){this.assertPosition(this.position),this.bytes[this.position]=o,this.position++},pushBytes(o){this.assertPosition(this.position+o.length-1),this.bytes.set(o,this.position),this.position+=o.length},pushUint8(o){this.assertPosition(this.position),this.bytes[this.position]=o,this.position++},pushUint16(o){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,o),this.position+=2},pushUint24(o){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,o>>8),this.dataView.setUint8(this.position+2,o&255),this.position+=3},pushUint32(o){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,o),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const o=this.inspectByte();return this.position++,o},readBytes(o,a){this.assertReadLimit(),this._touch();const c=this.inspectBytes(o);return this.position+=a??o,c},readUint8(){this.assertReadLimit(),this._touch();const o=this.inspectUint8();return this.position+=1,o},readUint16(){this.assertReadLimit(),this._touch();const o=this.inspectUint16();return this.position+=2,o},readUint24(){this.assertReadLimit(),this._touch();const o=this.inspectUint24();return this.position+=3,o},readUint32(){this.assertReadLimit(),this._touch();const o=this.inspectUint32();return this.position+=4,o},get remaining(){return this.bytes.length-this.position},setPosition(o){const a=this.position;return this.assertPosition(o),this.position=o,()=>this.position=a},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const o=this.getReadCount();this.positionReadCount.set(this.position,o+1),o>0&&this.recursiveReadCount++}};function r(o,{recursiveReadLimit:a=8192}={}){const c=Object.create(e);return c.bytes=o,c.dataView=new DataView(o.buffer,o.byteOffset,o.byteLength),c.positionReadCount=new Map,c.recursiveReadLimit=a,c}class n extends t.BaseError{constructor({offset:a}){super(`Offset \`${a}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}Aa.NegativeOffsetError=n;class i extends t.BaseError{constructor({length:a,position:c}){super(`Position \`${c}\` is out of bounds (\`0 < position < ${a}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}Aa.PositionOutOfBoundsError=i;class s extends t.BaseError{constructor({count:a,limit:c}){super(`Recursive read limit of \`${c}\` exceeded (recursive read count: \`${a}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}return Aa.RecursiveReadLimitExceededError=s,Aa}var Tq;function cR(){if(Tq)return jr;Tq=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.InvalidTypeError=jr.InvalidArrayError=jr.LengthMismatchError=jr.BytesSizeMismatchError=jr.ArrayLengthMismatchError=jr.ZeroDataError=jr.DataSizeTooSmallError=void 0,jr.decode=c,jr.encode=u,jr.encodePacked=l,jr.format=d,jr.from=h;const t=Kd(),e=aR(),r=Hp(),n=cl(),i=pa(),s=WX(),o=tPe(),a=rPe();function c(w,C,y={}){const{as:_="Array",checksumAddress:x=!1}=y,A=typeof C=="string"?r.fromHex(C):C,T=a.create(A);if(r.size(A)===0&&w.length>0)throw new g;if(r.size(A)&&r.size(A)<32)throw new f({data:typeof C=="string"?C:i.fromBytes(C),parameters:w,size:r.size(A)});let O=0;const k=_==="Array"?[]:{};for(let j=0;j<w.length;++j){const N=w[j];T.setPosition(O);const[S,P]=o.decodeParameter(T,N,{checksumAddress:x,staticPosition:0});O+=P,_==="Array"?k.push(S):k[N.name??j]=S}return k}function u(w,C,y){const{checksumAddress:_=!1}=y??{};if(w.length!==C.length)throw new b({expectedLength:w.length,givenLength:C.length});const x=o.prepareParameters({checksumAddress:_,parameters:w,values:C}),A=o.encode(x);return A.length===0?"0x":A}function l(w,C){if(w.length!==C.length)throw new b({expectedLength:w.length,givenLength:C.length});const y=[];for(let _=0;_<w.length;_++){const x=w[_],A=C[_];y.push(l.encode(x,A))}return i.concat(...y)}(function(w){function C(y,_,x=!1){if(y==="address"){const k=_;return e.assert(k),i.padLeft(k.toLowerCase(),x?32:0)}if(y==="string")return i.fromString(_);if(y==="bytes")return _;if(y==="bool")return i.padLeft(i.fromBoolean(_),x?32:1);const A=y.match(s.integerRegex);if(A){const[k,j,N="256"]=A,S=Number.parseInt(N)/8;return i.fromNumber(_,{size:x?32:S,signed:j==="int"})}const T=y.match(s.bytesRegex);if(T){const[k,j]=T;if(Number.parseInt(j)!==(_.length-2)/2)throw new m({expectedSize:Number.parseInt(j),value:_});return i.padRight(_,x?32:0)}const O=y.match(s.arrayRegex);if(O&&Array.isArray(_)){const[k,j]=O,N=[];for(let S=0;S<_.length;S++)N.push(C(j,_[S],!0));return N.length===0?"0x":i.concat(...N)}throw new E(y)}w.encode=C})(l||(jr.encodePacked=l={}));function d(w){return t.formatAbiParameters(w)}function h(w){return Array.isArray(w)&&typeof w[0]=="string"||typeof w=="string"?t.parseAbiParameters(w):w}class f extends n.BaseError{constructor({data:C,parameters:y,size:_}){super(`Data size of ${_} bytes is too small for given parameters.`,{metaMessages:[`Params: (${t.formatAbiParameters(y)})`,`Data: ${C} (${_} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}jr.DataSizeTooSmallError=f;class g extends n.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}jr.ZeroDataError=g;class p extends n.BaseError{constructor({expectedLength:C,givenLength:y,type:_}){super(`Array length mismatch for type \`${_}\`. Expected: \`${C}\`. Given: \`${y}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}jr.ArrayLengthMismatchError=p;class m extends n.BaseError{constructor({expectedSize:C,value:y}){super(`Size of bytes "${y}" (bytes${i.size(y)}) does not match expected size (bytes${C}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}jr.BytesSizeMismatchError=m;class b extends n.BaseError{constructor({expectedLength:C,givenLength:y}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${C}`,`Given length (values): ${y}`].join(`
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}jr.LengthMismatchError=b;class v extends n.BaseError{constructor(C){super(`Value \`${C}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}jr.InvalidArrayError=v;class E extends n.BaseError{constructor(C){super(`Type \`${C}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}return jr.InvalidTypeError=E,jr}var Iq;function nPe(){if(Iq)return Rl;Iq=1,Object.defineProperty(Rl,"__esModule",{value:!0}),Rl.decode=i,Rl.encode=s,Rl.format=o,Rl.from=a,Rl.fromAbi=c;const t=Kd(),e=zX(),r=cR(),n=pa();function i(u,l){const{bytecode:d}=l;if(u.inputs.length===0)return;const h=l.data.replace(d,"0x");return r.decode(u.inputs,h)}function s(u,l){var f;const{bytecode:d,args:h}=l;return n.concat(d,(f=u.inputs)!=null&&f.length&&(h!=null&&h.length)?r.encode(u.inputs,h):"0x")}function o(u){return t.formatAbiItem(u)}function a(u){return e.from(u)}function c(u){const l=u.find(d=>d.type==="constructor");if(!l)throw new e.NotFoundError({name:"constructor"});return l}return Rl}var So={},Pq;function iPe(){if(Pq)return So;Pq=1,Object.defineProperty(So,"__esModule",{value:!0}),So.decodeData=i,So.decodeResult=s,So.encodeData=o,So.encodeResult=a,So.format=c,So.from=u,So.fromAbi=l,So.getSelector=d;const t=Kd(),e=zX(),r=cR(),n=pa();function i(h,f){const{overloads:g}=h;if(n.size(f)<4)throw new e.InvalidSelectorSizeError({data:f});if(h.inputs.length===0)return;const p=g?l([h,...g],f):h;if(!(n.size(f)<=4))return r.decode(p.inputs,n.slice(f,4))}function s(h,f,g={}){const p=r.decode(h.outputs,f,g);if(!(p&&Object.keys(p).length===0))return p&&Object.keys(p).length===1?Array.isArray(p)?p[0]:Object.values(p)[0]:p}function o(h,...f){const{overloads:g}=h,p=g?l([h,...g],h.name,{args:f[0]}):h,m=d(p),b=f.length>0?r.encode(p.inputs,f[0]):void 0;return b?n.concat(m,b):m}function a(h,f,g={}){const{as:p="Array"}=g,m=h.outputs.length===1?[f]:Array.isArray(f)?f:p==="Object"?Object.values(f):[f];return r.encode(h.outputs,m)}function c(h){return t.formatAbiItem(h)}function u(h,f={}){return e.from(h,f)}function l(h,f,g){const p=e.fromAbi(h,f,g);if(p.type!=="function")throw new e.NotFoundError({name:f,type:"function"});return p}function d(h){return e.getSelector(h)}return So}var ls={},Oq;function VX(){return Oq||(Oq=1,Object.defineProperty(ls,"__esModule",{value:!0}),ls.zeroAddress=ls.ethAddress=ls.entryPoint08Address=ls.entryPoint07Address=ls.entryPoint06Address=void 0,ls.entryPoint06Address="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",ls.entryPoint07Address="0x0000000071727De22E5E9d8BAf0edAc6f37da032",ls.entryPoint08Address="0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108",ls.ethAddress="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",ls.zeroAddress="0x0000000000000000000000000000000000000000"),ls}var Rq;function sPe(){if(Rq)return b5;Rq=1,Object.defineProperty(b5,"__esModule",{value:!0}),b5.simulateCalls=d;const t=nPe(),e=iPe(),r=sn(),n=VX(),i=hx(),s=_t(),o=Bs(),a=sR(),c=pX(),u=HX(),l="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function d(h,f){const{blockNumber:g,blockTag:p,calls:m,stateOverrides:b,traceAssetChanges:v,traceTransfers:E,validation:w}=f,C=f.account?(0,r.parseAccount)(f.account):void 0;if(v&&!C)throw new s.BaseError("`account` is required when `traceAssetChanges` is true");const y=C?t.encode(t.from("constructor(bytes, bytes)"),{bytecode:i.deploylessCallViaBytecodeBytecode,args:[l,e.encodeData(e.from("function getBalance(address)"),[C.address])]}):void 0,_=v?await Promise.all(f.calls.map(async ie=>{if(!ie.data&&!ie.abi)return;const{accessList:Ee}=await(0,c.createAccessList)(h,{account:C.address,...ie,data:ie.abi?(0,o.encodeFunctionData)(ie):ie.data});return Ee.map(({address:pe,storageKeys:ve})=>ve.length>0?pe:null)})).then(ie=>ie.flat().filter(Boolean)):[],x=b==null?void 0:b.map(ie=>ie.address===(C==null?void 0:C.address)?{...ie,nonce:0}:ie),A=await(0,u.simulateBlocks)(h,{blockNumber:g,blockTag:p,blocks:[...v?[{calls:[{data:y}],stateOverrides:b},{calls:_.map((ie,Ee)=>({abi:[e.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[C.address],to:ie,from:n.zeroAddress,nonce:Ee})),stateOverrides:[{address:n.zeroAddress,nonce:0}]}]:[],{calls:[...m,{}].map((ie,Ee)=>({...ie,from:C==null?void 0:C.address,nonce:Ee})),stateOverrides:x},...v?[{calls:[{data:y}]},{calls:_.map((ie,Ee)=>({abi:[e.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[C.address],to:ie,from:n.zeroAddress,nonce:Ee})),stateOverrides:[{address:n.zeroAddress,nonce:0}]},{calls:_.map((ie,Ee)=>({to:ie,abi:[e.from("function decimals() returns (uint256)")],functionName:"decimals",from:n.zeroAddress,nonce:Ee})),stateOverrides:[{address:n.zeroAddress,nonce:0}]},{calls:_.map((ie,Ee)=>({to:ie,abi:[e.from("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:n.zeroAddress,nonce:Ee})),stateOverrides:[{address:n.zeroAddress,nonce:0}]},{calls:_.map((ie,Ee)=>({to:ie,abi:[e.from("function symbol() returns (string)")],functionName:"symbol",from:n.zeroAddress,nonce:Ee})),stateOverrides:[{address:n.zeroAddress,nonce:0}]}]:[]],traceTransfers:E,validation:w}),T=v?A[2]:A[0],[O,k,,j,N,S,P,I]=v?A:[],{calls:B,...$}=T,R=B.slice(0,-1)??[],D=(O==null?void 0:O.calls)??[],L=(k==null?void 0:k.calls)??[],U=[...D,...L].map(ie=>ie.status==="success"?(0,a.hexToBigInt)(ie.data):null),z=(j==null?void 0:j.calls)??[],W=(N==null?void 0:N.calls)??[],K=[...z,...W].map(ie=>ie.status==="success"?(0,a.hexToBigInt)(ie.data):null),J=((S==null?void 0:S.calls)??[]).map(ie=>ie.status==="success"?ie.result:null),ne=((I==null?void 0:I.calls)??[]).map(ie=>ie.status==="success"?ie.result:null),ae=((P==null?void 0:P.calls)??[]).map(ie=>ie.status==="success"?ie.result:null),he=[];for(const[ie,Ee]of K.entries()){const pe=U[ie];if(typeof Ee!="bigint"||typeof pe!="bigint")continue;const ve=J[ie-1],je=ne[ie-1],rt=ae[ie-1],Ce=ie===0?{address:n.ethAddress,decimals:18,symbol:"ETH"}:{address:_[ie-1],decimals:rt||ve?Number(ve??1):void 0,symbol:je??void 0};he.some(fe=>fe.token.address===Ce.address)||he.push({token:Ce,value:{pre:pe,post:Ee,diff:Ee-pe}})}return{assetChanges:he,block:$,results:R}}return b5}var y5={},v5={},_5={},kq;function GX(){if(kq)return _5;kq=1,Object.defineProperty(_5,"__esModule",{value:!0}),_5.serializeSignature=n;const t=A2(),e=nn(),r=Tr();function n({r:i,s,to:o="hex",v:a,yParity:c}){const u=(()=>{if(c===0||c===1)return c;if(a&&(a===27n||a===28n||a>=35n))return a%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),l=`0x${new t.secp256k1.Signature((0,e.hexToBigInt)(i),(0,e.hexToBigInt)(s)).toCompactHex()}${u===0?"1b":"1c"}`;return o==="hex"?l:(0,r.hexToBytes)(l)}return _5}var Nq;function uR(){if(Nq)return v5;Nq=1,Object.defineProperty(v5,"__esModule",{value:!0}),v5.verifyHash=p;const t=rh(),e=hx(),r=Qd(),n=k2(),i=js(),s=fa(),o=ki(),a=ze(),c=ur(),u=sR(),l=Cx(),d=th(),h=rR(),f=GX(),g=N2();async function p(m,b){var O,k,j;const{address:v,factory:E,factoryData:w,hash:C,signature:y,universalSignatureVerifierAddress:_=(j=(k=(O=m.chain)==null?void 0:O.contracts)==null?void 0:k.universalSignatureVerifier)==null?void 0:j.address,...x}=b,A=(0,o.isHex)(y)?y:typeof y=="object"&&"r"in y&&"s"in y?(0,f.serializeSignature)(y):(0,a.bytesToHex)(y),T=await(async()=>!E&&!w||(0,l.isErc6492Signature)(A)?A:(0,h.serializeErc6492Signature)({address:E,data:w,signature:A}))();try{const N=_?{to:_,data:(0,u.encodeFunctionData)({abi:t.universalSignatureValidatorAbi,functionName:"isValidSig",args:[v,C,T]}),...x}:{data:(0,n.encodeDeployData)({abi:t.universalSignatureValidatorAbi,args:[v,C,T],bytecode:e.universalSignatureValidatorByteCode}),...x},{data:S}=await(0,c.getAction)(m,g.call,"call")(N);return(0,u.hexToBool)(S??"0x0")}catch(N){try{if((0,s.isAddressEqual)((0,i.getAddress)(v),await(0,d.recoverAddress)({hash:C,signature:y})))return!0}catch{}if(N instanceof r.CallExecutionError)return!1;throw N}}return v5}var $q;function oPe(){if($q)return y5;$q=1,Object.defineProperty(y5,"__esModule",{value:!0}),y5.verifyMessage=r;const t=D2(),e=uR();async function r(n,{address:i,message:s,factory:o,factoryData:a,signature:c,...u}){const l=(0,t.hashMessage)(s);return(0,e.verifyHash)(n,{address:i,factory:o,factoryData:a,hash:l,signature:c,...u})}return y5}var E5={},jq;function aPe(){if(jq)return E5;jq=1,Object.defineProperty(E5,"__esModule",{value:!0}),E5.verifyTypedData=r;const t=B2(),e=uR();async function r(n,i){const{address:s,factory:o,factoryData:a,signature:c,message:u,primaryType:l,types:d,domain:h,...f}=i,g=(0,t.hashTypedData)({message:u,primaryType:l,types:d,domain:h});return(0,e.verifyHash)(n,{address:s,factory:o,factoryData:a,hash:g,signature:c,...f})}return E5}var C5={},A5={},Bq;function KX(){if(Bq)return A5;Bq=1,Object.defineProperty(A5,"__esModule",{value:!0}),A5.watchBlockNumber=o;const t=nn(),e=ur(),r=qp(),n=A1(),i=Gn(),s=$2();function o(a,{emitOnBegin:c=!1,emitMissed:u=!1,onBlockNumber:l,onError:d,poll:h,pollingInterval:f=a.pollingInterval}){const g=typeof h<"u"?h:!(a.transport.type==="webSocket"||a.transport.type==="fallback"&&a.transport.transports[0].config.type==="webSocket");let p;return g?(()=>{const v=(0,i.stringify)(["watchBlockNumber",a.uid,c,u,f]);return(0,r.observe)(v,{onBlockNumber:l,onError:d},E=>(0,n.poll)(async()=>{var w;try{const C=await(0,e.getAction)(a,s.getBlockNumber,"getBlockNumber")({cacheTime:0});if(p){if(C===p)return;if(C-p>1&&u)for(let y=p+1n;y<C;y++)E.onBlockNumber(y,p),p=y}(!p||C>p)&&(E.onBlockNumber(C,p),p=C)}catch(C){(w=E.onError)==null||w.call(E,C)}},{emitOnBegin:c,interval:f}))})():(()=>{const v=(0,i.stringify)(["watchBlockNumber",a.uid,c,u]);return(0,r.observe)(v,{onBlockNumber:l,onError:d},E=>{let w=!0,C=()=>w=!1;return(async()=>{try{const y=(()=>{if(a.transport.type==="fallback"){const x=a.transport.transports.find(A=>A.config.type==="webSocket");return x?x.value:a.transport}return a.transport})(),{unsubscribe:_}=await y.subscribe({params:["newHeads"],onData(x){var T;if(!w)return;const A=(0,t.hexToBigInt)((T=x.result)==null?void 0:T.number);E.onBlockNumber(A,p),p=A},onError(x){var A;(A=E.onError)==null||A.call(E,x)}});C=_,w||C()}catch(y){d==null||d(y)}})(),()=>C()})})()}return A5}var Dq;function cPe(){if(Dq)return C5;Dq=1,Object.defineProperty(C5,"__esModule",{value:!0}),C5.waitForTransactionReceipt=d;const t=EO(),e=Ds(),r=ur(),n=qp(),i=kO(),s=HO(),o=Gn(),a=E1(),c=oR(),u=FX(),l=KX();async function d(h,{confirmations:f=1,hash:g,onReplaced:p,pollingInterval:m=h.pollingInterval,retryCount:b=6,retryDelay:v=({count:w})=>~~(1<<w)*200,timeout:E=18e4}){const w=(0,o.stringify)(["waitForTransactionReceipt",h.uid,g]);let C,y,_,x=!1,A,T;const{promise:O,resolve:k,reject:j}=(0,i.withResolvers)(),N=E?setTimeout(()=>{T(),A(),j(new e.WaitForTransactionReceiptTimeoutError({hash:g}))},E):void 0;return A=(0,n.observe)(w,{onReplaced:p,resolve:k,reject:j},S=>{T=(0,r.getAction)(h,l.watchBlockNumber,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:m,async onBlockNumber(P){const I=$=>{clearTimeout(N),T(),$(),A()};let B=P;if(!x)try{if(_){if(f>1&&(!_.blockNumber||B-_.blockNumber+1n<f))return;I(()=>S.resolve(_));return}if(C||(x=!0,await(0,s.withRetry)(async()=>{C=await(0,r.getAction)(h,c.getTransaction,"getTransaction")({hash:g}),C.blockNumber&&(B=C.blockNumber)},{delay:v,retryCount:b}),x=!1),_=await(0,r.getAction)(h,u.getTransactionReceipt,"getTransactionReceipt")({hash:g}),f>1&&(!_.blockNumber||B-_.blockNumber+1n<f))return;I(()=>S.resolve(_))}catch($){if($ instanceof e.TransactionNotFoundError||$ instanceof e.TransactionReceiptNotFoundError){if(!C){x=!1;return}try{y=C,x=!0;const R=await(0,s.withRetry)(()=>(0,r.getAction)(h,a.getBlock,"getBlock")({blockNumber:B,includeTransactions:!0}),{delay:v,retryCount:b,shouldRetry:({error:U})=>U instanceof t.BlockNotFoundError});x=!1;const D=R.transactions.find(({from:U,nonce:z})=>U===y.from&&z===y.nonce);if(!D||(_=await(0,r.getAction)(h,u.getTransactionReceipt,"getTransactionReceipt")({hash:D.hash}),f>1&&(!_.blockNumber||B-_.blockNumber+1n<f)))return;let L="replaced";D.to===y.to&&D.value===y.value&&D.input===y.input?L="repriced":D.from===D.to&&D.value===0n&&(L="cancelled"),I(()=>{var U;(U=S.onReplaced)==null||U.call(S,{reason:L,replacedTransaction:y,transaction:D,transactionReceipt:_}),S.resolve(_)})}catch(R){I(()=>S.reject(R))}}else I(()=>S.reject($))}}})}),O}return C5}var x5={},Mq;function uPe(){if(Mq)return x5;Mq=1,Object.defineProperty(x5,"__esModule",{value:!0}),x5.watchBlocks=s;const t=ur(),e=qp(),r=A1(),n=Gn(),i=E1();function s(o,{blockTag:a="latest",emitMissed:c=!1,emitOnBegin:u=!1,onBlock:l,onError:d,includeTransactions:h,poll:f,pollingInterval:g=o.pollingInterval}){const p=typeof f<"u"?f:!(o.transport.type==="webSocket"||o.transport.type==="fallback"&&o.transport.transports[0].config.type==="webSocket"),m=h??!1;let b;return p?(()=>{const w=(0,n.stringify)(["watchBlocks",o.uid,a,c,u,m,g]);return(0,e.observe)(w,{onBlock:l,onError:d},C=>(0,r.poll)(async()=>{var y;try{const _=await(0,t.getAction)(o,i.getBlock,"getBlock")({blockTag:a,includeTransactions:m});if(_.number!==null&&(b==null?void 0:b.number)!=null){if(_.number===b.number)return;if(_.number-b.number>1&&c)for(let x=(b==null?void 0:b.number)+1n;x<_.number;x++){const A=await(0,t.getAction)(o,i.getBlock,"getBlock")({blockNumber:x,includeTransactions:m});C.onBlock(A,b),b=A}}((b==null?void 0:b.number)==null||a==="pending"&&(_==null?void 0:_.number)==null||_.number!==null&&_.number>b.number)&&(C.onBlock(_,b),b=_)}catch(_){(y=C.onError)==null||y.call(C,_)}},{emitOnBegin:u,interval:g}))})():(()=>{let w=!0,C=!0,y=()=>w=!1;return(async()=>{try{u&&(0,t.getAction)(o,i.getBlock,"getBlock")({blockTag:a,includeTransactions:m}).then(A=>{w&&C&&(l(A,void 0),C=!1)}).catch(d);const _=(()=>{if(o.transport.type==="fallback"){const A=o.transport.transports.find(T=>T.config.type==="webSocket");return A?A.value:o.transport}return o.transport})(),{unsubscribe:x}=await _.subscribe({params:["newHeads"],async onData(A){if(!w)return;const T=await(0,t.getAction)(o,i.getBlock,"getBlock")({blockNumber:A.blockNumber,includeTransactions:m}).catch(()=>{});w&&(l(T,b),C=!1,b=T)},onError(A){d==null||d(A)}});y=x,w||y()}catch(_){d==null||d(_)}})(),()=>y()})()}return x5}var S5={},Lq;function lPe(){if(Lq)return S5;Lq=1,Object.defineProperty(S5,"__esModule",{value:!0}),S5.watchEvent=g;const t=Up(),e=qp(),r=A1(),n=Gn(),i=$r(),s=Xd(),o=P2(),a=ol(),c=ur(),u=gX(),l=$2(),d=fx(),h=IO(),f=px();function g(p,{address:m,args:b,batch:v=!0,event:E,events:w,fromBlock:C,onError:y,onLogs:_,poll:x,pollingInterval:A=p.pollingInterval,strict:T}){const O=typeof x<"u"?x:typeof C=="bigint"?!0:!(p.transport.type==="webSocket"||p.transport.type==="fallback"&&p.transport.transports[0].config.type==="webSocket"),k=T??!1;return O?(()=>{const S=(0,n.stringify)(["watchEvent",m,b,v,p.uid,E,A,C]);return(0,e.observe)(S,{onLogs:_,onError:y},P=>{let I;C!==void 0&&(I=C-1n);let B,$=!1;const R=(0,r.poll)(async()=>{var D;if(!$){try{B=await(0,c.getAction)(p,u.createEventFilter,"createEventFilter")({address:m,args:b,event:E,events:w,strict:k,fromBlock:C})}catch{}$=!0;return}try{let L;if(B)L=await(0,c.getAction)(p,d.getFilterChanges,"getFilterChanges")({filter:B});else{const U=await(0,c.getAction)(p,l.getBlockNumber,"getBlockNumber")({});I&&I!==U?L=await(0,c.getAction)(p,h.getLogs,"getLogs")({address:m,args:b,event:E,events:w,fromBlock:I+1n,toBlock:U}):L=[],I=U}if(L.length===0)return;if(v)P.onLogs(L);else for(const U of L)P.onLogs([U])}catch(L){B&&L instanceof s.InvalidInputRpcError&&($=!1),(D=P.onError)==null||D.call(P,L)}},{emitOnBegin:!0,interval:A});return async()=>{B&&await(0,c.getAction)(p,f.uninstallFilter,"uninstallFilter")({filter:B}),R()}})})():(()=>{let S=!0,P=()=>S=!1;return(async()=>{try{const I=(()=>{if(p.transport.type==="fallback"){const D=p.transport.transports.find(L=>L.config.type==="webSocket");return D?D.value:p.transport}return p.transport})(),B=w??(E?[E]:void 0);let $=[];B&&($=[B.flatMap(L=>(0,t.encodeEventTopics)({abi:[L],eventName:L.name,args:b}))],E&&($=$[0]));const{unsubscribe:R}=await I.subscribe({params:["logs",{address:m,topics:$}],onData(D){var U;if(!S)return;const L=D.result;try{const{eventName:z,args:W}=(0,o.decodeEventLog)({abi:B??[],data:L.data,topics:L.topics,strict:k}),K=(0,a.formatLog)(L,{args:W,eventName:z});_([K])}catch(z){let W,K;if(z instanceof i.DecodeLogDataMismatch||z instanceof i.DecodeLogTopicsMismatch){if(T)return;W=z.abiItem.name,K=(U=z.abiItem.inputs)==null?void 0:U.some(ne=>!("name"in ne&&ne.name))}const J=(0,a.formatLog)(L,{args:K?[]:{},eventName:W});_([J])}},onError(D){y==null||y(D)}});P=R,S||P()}catch(I){y==null||y(I)}})(),()=>P()})()}return S5}var T5={},Uq;function dPe(){if(Uq)return T5;Uq=1,Object.defineProperty(T5,"__esModule",{value:!0}),T5.watchPendingTransactions=a;const t=ur(),e=qp(),r=A1(),n=Gn(),i=mX(),s=fx(),o=px();function a(c,{batch:u=!0,onError:l,onTransactions:d,poll:h,pollingInterval:f=c.pollingInterval}){return(typeof h<"u"?h:c.transport.type!=="webSocket")?(()=>{const b=(0,n.stringify)(["watchPendingTransactions",c.uid,u,f]);return(0,e.observe)(b,{onTransactions:d,onError:l},v=>{let E;const w=(0,r.poll)(async()=>{var C;try{if(!E)try{E=await(0,t.getAction)(c,i.createPendingTransactionFilter,"createPendingTransactionFilter")({});return}catch(_){throw w(),_}const y=await(0,t.getAction)(c,s.getFilterChanges,"getFilterChanges")({filter:E});if(y.length===0)return;if(u)v.onTransactions(y);else for(const _ of y)v.onTransactions([_])}catch(y){(C=v.onError)==null||C.call(v,y)}},{emitOnBegin:!0,interval:f});return async()=>{E&&await(0,t.getAction)(c,o.uninstallFilter,"uninstallFilter")({filter:E}),w()}})})():(()=>{let b=!0,v=()=>b=!1;return(async()=>{try{const{unsubscribe:E}=await c.transport.subscribe({params:["newPendingTransactions"],onData(w){if(!b)return;const C=w.result;d([C])},onError(w){l==null||l(w)}});v=E,b||v()}catch(E){l==null||l(E)}})(),()=>v()})()}return T5}var I5={},P5={},Fq;function hPe(){if(Fq)return P5;Fq=1,Object.defineProperty(P5,"__esModule",{value:!0}),P5.parseSiweMessage=t;function t(n){var g,p,m;const{scheme:i,statement:s,...o}=((g=n.match(e))==null?void 0:g.groups)??{},{chainId:a,expirationTime:c,issuedAt:u,notBefore:l,requestId:d,...h}=((p=n.match(r))==null?void 0:p.groups)??{},f=(m=n.split("Resources:")[1])==null?void 0:m.split(`
- - `).slice(1);return{...o,...h,...a?{chainId:Number(a)}:{},...c?{expirationTime:new Date(c)}:{},...u?{issuedAt:new Date(u)}:{},...l?{notBefore:new Date(l)}:{},...d?{requestId:d}:{},...f?{resources:f}:{},...i?{scheme:i}:{},...s?{statement:s}:{}}}const e=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,r=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;return P5}var O5={},Hq;function fPe(){if(Hq)return O5;Hq=1,Object.defineProperty(O5,"__esModule",{value:!0}),O5.validateSiweMessage=r;const t=is(),e=fa();function r(n){const{address:i,domain:s,message:o,nonce:a,scheme:c,time:u=new Date}=n;if(s&&o.domain!==s||a&&o.nonce!==a||c&&o.scheme!==c||o.expirationTime&&u>=o.expirationTime||o.notBefore&&u<o.notBefore)return!1;try{if(!o.address||!(0,t.isAddress)(o.address,{strict:!1})||i&&!(0,e.isAddressEqual)(o.address,i))return!1}catch{return!1}return!0}return O5}var qq;function pPe(){if(qq)return I5;qq=1,Object.defineProperty(I5,"__esModule",{value:!0}),I5.verifySiweMessage=i;const t=D2(),e=hPe(),r=fPe(),n=uR();async function i(s,o){const{address:a,domain:c,message:u,nonce:l,scheme:d,signature:h,time:f=new Date,...g}=o,p=(0,e.parseSiweMessage)(u);if(!p.address||!(0,r.validateSiweMessage)({address:a,domain:c,message:p,nonce:l,scheme:d,time:f}))return!1;const b=(0,t.hashMessage)(u);return(0,n.verifyHash)(s,{address:p.address,hash:b,signature:h,...g})}return I5}var zq;function ZX(){if(zq)return gE;zq=1,Object.defineProperty(gE,"__esModule",{value:!0}),gE.publicActions=rt;const t=IIe(),e=RIe(),r=kIe(),n=NIe(),i=fX(),s=N2(),o=pX(),a=$Ie(),c=gO(),u=gX(),l=mX(),d=ZQ(),h=qQ(),f=TO(),g=HQ(),p=KQ(),m=jIe(),b=E1(),v=$2(),E=BIe(),w=C1(),C=DIe(),y=PO(),_=LIe(),x=FIe(),A=fx(),T=HIe(),O=CO(),k=IO(),j=GIe(),N=KIe(),S=oR(),P=ZIe(),I=ox(),B=FX(),$=YIe(),R=ul(),D=HX(),L=sPe(),U=eX(),z=px(),W=oPe(),K=aPe(),J=cPe(),ne=KX(),ae=uPe(),he=rX(),ie=lPe(),Ee=dPe(),pe=pPe(),ve=dx(),je=FO();function rt(Ce){return{call:fe=>(0,s.call)(Ce,fe),createAccessList:fe=>(0,o.createAccessList)(Ce,fe),createBlockFilter:()=>(0,a.createBlockFilter)(Ce),createContractEventFilter:fe=>(0,c.createContractEventFilter)(Ce,fe),createEventFilter:fe=>(0,u.createEventFilter)(Ce,fe),createPendingTransactionFilter:()=>(0,l.createPendingTransactionFilter)(Ce),estimateContractGas:fe=>(0,d.estimateContractGas)(Ce,fe),estimateGas:fe=>(0,f.estimateGas)(Ce,fe),getBalance:fe=>(0,p.getBalance)(Ce,fe),getBlobBaseFee:()=>(0,m.getBlobBaseFee)(Ce),getBlock:fe=>(0,b.getBlock)(Ce,fe),getBlockNumber:fe=>(0,v.getBlockNumber)(Ce,fe),getBlockTransactionCount:fe=>(0,E.getBlockTransactionCount)(Ce,fe),getBytecode:fe=>(0,C.getCode)(Ce,fe),getChainId:()=>(0,w.getChainId)(Ce),getCode:fe=>(0,C.getCode)(Ce,fe),getContractEvents:fe=>(0,y.getContractEvents)(Ce,fe),getEip712Domain:fe=>(0,_.getEip712Domain)(Ce,fe),getEnsAddress:fe=>(0,t.getEnsAddress)(Ce,fe),getEnsAvatar:fe=>(0,e.getEnsAvatar)(Ce,fe),getEnsName:fe=>(0,r.getEnsName)(Ce,fe),getEnsResolver:fe=>(0,n.getEnsResolver)(Ce,fe),getEnsText:fe=>(0,i.getEnsText)(Ce,fe),getFeeHistory:fe=>(0,x.getFeeHistory)(Ce,fe),estimateFeesPerGas:fe=>(0,h.estimateFeesPerGas)(Ce,fe),getFilterChanges:fe=>(0,A.getFilterChanges)(Ce,fe),getFilterLogs:fe=>(0,T.getFilterLogs)(Ce,fe),getGasPrice:()=>(0,O.getGasPrice)(Ce),getLogs:fe=>(0,k.getLogs)(Ce,fe),getProof:fe=>(0,j.getProof)(Ce,fe),estimateMaxPriorityFeePerGas:fe=>(0,g.estimateMaxPriorityFeePerGas)(Ce,fe),getStorageAt:fe=>(0,N.getStorageAt)(Ce,fe),getTransaction:fe=>(0,S.getTransaction)(Ce,fe),getTransactionConfirmations:fe=>(0,P.getTransactionConfirmations)(Ce,fe),getTransactionCount:fe=>(0,I.getTransactionCount)(Ce,fe),getTransactionReceipt:fe=>(0,B.getTransactionReceipt)(Ce,fe),multicall:fe=>(0,$.multicall)(Ce,fe),prepareTransactionRequest:fe=>(0,ve.prepareTransactionRequest)(Ce,fe),readContract:fe=>(0,R.readContract)(Ce,fe),sendRawTransaction:fe=>(0,je.sendRawTransaction)(Ce,fe),simulate:fe=>(0,D.simulateBlocks)(Ce,fe),simulateBlocks:fe=>(0,D.simulateBlocks)(Ce,fe),simulateCalls:fe=>(0,L.simulateCalls)(Ce,fe),simulateContract:fe=>(0,U.simulateContract)(Ce,fe),verifyMessage:fe=>(0,W.verifyMessage)(Ce,fe),verifySiweMessage:fe=>(0,pe.verifySiweMessage)(Ce,fe),verifyTypedData:fe=>(0,K.verifyTypedData)(Ce,fe),uninstallFilter:fe=>(0,z.uninstallFilter)(Ce,fe),waitForTransactionReceipt:fe=>(0,J.waitForTransactionReceipt)(Ce,fe),watchBlocks:fe=>(0,ae.watchBlocks)(Ce,fe),watchBlockNumber:fe=>(0,ne.watchBlockNumber)(Ce,fe),watchContractEvent:fe=>(0,he.watchContractEvent)(Ce,fe),watchEvent:fe=>(0,ie.watchEvent)(Ce,fe),watchPendingTransactions:fe=>(0,Ee.watchPendingTransactions)(Ce,fe)}}return gE}var Wq;function gPe(){if(Wq)return pE;Wq=1,Object.defineProperty(pE,"__esModule",{value:!0}),pE.createPublicClient=r;const t=bx(),e=ZX();function r(n){const{key:i="public",name:s="Public Client"}=n;return(0,t.createClient)({...n,key:i,name:s,type:"publicClient"}).extend(e.publicActions)}return pE}var R5={},k5={},N5={},Vq;function mPe(){if(Vq)return N5;Vq=1,Object.defineProperty(N5,"__esModule",{value:!0}),N5.dropTransaction=t;async function t(e,{hash:r}){await e.request({method:`${e.mode}_dropTransaction`,params:[r]})}return N5}var $5={},Gq;function wPe(){if(Gq)return $5;Gq=1,Object.defineProperty($5,"__esModule",{value:!0}),$5.dumpState=t;async function t(e){return e.request({method:`${e.mode}_dumpState`})}return $5}var j5={},Kq;function bPe(){if(Kq)return j5;Kq=1,Object.defineProperty(j5,"__esModule",{value:!0}),j5.getAutomine=t;async function t(e){return e.mode==="ganache"?await e.request({method:"eth_mining"}):await e.request({method:`${e.mode}_getAutomine`})}return j5}var B5={},Zq;function yPe(){if(Zq)return B5;Zq=1,Object.defineProperty(B5,"__esModule",{value:!0}),B5.getTxpoolContent=t;async function t(e){return await e.request({method:"txpool_content"})}return B5}var D5={},Yq;function vPe(){if(Yq)return D5;Yq=1,Object.defineProperty(D5,"__esModule",{value:!0}),D5.getTxpoolStatus=e;const t=nn();async function e(r){const{pending:n,queued:i}=await r.request({method:"txpool_status"});return{pending:(0,t.hexToNumber)(n),queued:(0,t.hexToNumber)(i)}}return D5}var M5={},Jq;function _Pe(){if(Jq)return M5;Jq=1,Object.defineProperty(M5,"__esModule",{value:!0}),M5.impersonateAccount=t;async function t(e,{address:r}){await e.request({method:`${e.mode}_impersonateAccount`,params:[r]})}return M5}var L5={},Qq;function EPe(){if(Qq)return L5;Qq=1,Object.defineProperty(L5,"__esModule",{value:!0}),L5.increaseTime=e;const t=ze();async function e(r,{seconds:n}){return await r.request({method:"evm_increaseTime",params:[(0,t.numberToHex)(n)]})}return L5}var U5={},Xq;function CPe(){if(Xq)return U5;Xq=1,Object.defineProperty(U5,"__esModule",{value:!0}),U5.inspectTxpool=t;async function t(e){return await e.request({method:"txpool_inspect"})}return U5}var F5={},ez;function APe(){if(ez)return F5;ez=1,Object.defineProperty(F5,"__esModule",{value:!0}),F5.loadState=t;async function t(e,{state:r}){await e.request({method:`${e.mode}_loadState`,params:[r]})}return F5}var H5={},tz;function xPe(){if(tz)return H5;tz=1,Object.defineProperty(H5,"__esModule",{value:!0}),H5.mine=e;const t=ze();async function e(r,{blocks:n,interval:i}){r.mode==="ganache"?await r.request({method:"evm_mine",params:[{blocks:(0,t.numberToHex)(n)}]}):await r.request({method:`${r.mode}_mine`,params:[(0,t.numberToHex)(n),(0,t.numberToHex)(i||0)]})}return H5}var q5={},rz;function SPe(){if(rz)return q5;rz=1,Object.defineProperty(q5,"__esModule",{value:!0}),q5.removeBlockTimestampInterval=t;async function t(e){await e.request({method:`${e.mode}_removeBlockTimestampInterval`})}return q5}var z5={},nz;function TPe(){if(nz)return z5;nz=1,Object.defineProperty(z5,"__esModule",{value:!0}),z5.reset=t;async function t(e,{blockNumber:r,jsonRpcUrl:n}={}){await e.request({method:`${e.mode}_reset`,params:[{forking:{blockNumber:Number(r),jsonRpcUrl:n}}]})}return z5}var W5={},iz;function IPe(){if(iz)return W5;iz=1,Object.defineProperty(W5,"__esModule",{value:!0}),W5.revert=t;async function t(e,{id:r}){await e.request({method:"evm_revert",params:[r]})}return W5}var V5={},sz;function PPe(){if(sz)return V5;sz=1,Object.defineProperty(V5,"__esModule",{value:!0}),V5.sendUnsignedTransaction=r;const t=_1(),e=il();async function r(n,i){var w,C,y;const{accessList:s,data:o,from:a,gas:c,gasPrice:u,maxFeePerGas:l,maxPriorityFeePerGas:d,nonce:h,to:f,value:g,...p}=i,m=(y=(C=(w=n.chain)==null?void 0:w.formatters)==null?void 0:C.transactionRequest)==null?void 0:y.format,v=(m||e.formatTransactionRequest)({...(0,t.extract)(p,{format:m}),accessList:s,data:o,from:a,gas:c,gasPrice:u,maxFeePerGas:l,maxPriorityFeePerGas:d,nonce:h,to:f,value:g});return await n.request({method:"eth_sendUnsignedTransaction",params:[v]})}return V5}var G5={},oz;function OPe(){if(oz)return G5;oz=1,Object.defineProperty(G5,"__esModule",{value:!0}),G5.setAutomine=t;async function t(e,r){e.mode==="ganache"?r?await e.request({method:"miner_start"}):await e.request({method:"miner_stop"}):await e.request({method:"evm_setAutomine",params:[r]})}return G5}var K5={},az;function RPe(){if(az)return K5;az=1,Object.defineProperty(K5,"__esModule",{value:!0}),K5.setBalance=e;const t=ze();async function e(r,{address:n,value:i}){r.mode==="ganache"?await r.request({method:"evm_setAccountBalance",params:[n,(0,t.numberToHex)(i)]}):await r.request({method:`${r.mode}_setBalance`,params:[n,(0,t.numberToHex)(i)]})}return K5}var Z5={},cz;function kPe(){if(cz)return Z5;cz=1,Object.defineProperty(Z5,"__esModule",{value:!0}),Z5.setBlockGasLimit=e;const t=ze();async function e(r,{gasLimit:n}){await r.request({method:"evm_setBlockGasLimit",params:[(0,t.numberToHex)(n)]})}return Z5}var Y5={},uz;function NPe(){if(uz)return Y5;uz=1,Object.defineProperty(Y5,"__esModule",{value:!0}),Y5.setBlockTimestampInterval=t;async function t(e,{interval:r}){const n=e.mode==="hardhat"?r*1e3:r;await e.request({method:`${e.mode}_setBlockTimestampInterval`,params:[n]})}return Y5}var J5={},lz;function $Pe(){if(lz)return J5;lz=1,Object.defineProperty(J5,"__esModule",{value:!0}),J5.setCode=t;async function t(e,{address:r,bytecode:n}){e.mode==="ganache"?await e.request({method:"evm_setAccountCode",params:[r,n]}):await e.request({method:`${e.mode}_setCode`,params:[r,n]})}return J5}var Q5={},dz;function jPe(){if(dz)return Q5;dz=1,Object.defineProperty(Q5,"__esModule",{value:!0}),Q5.setCoinbase=t;async function t(e,{address:r}){await e.request({method:`${e.mode}_setCoinbase`,params:[r]})}return Q5}var X5={},hz;function BPe(){if(hz)return X5;hz=1,Object.defineProperty(X5,"__esModule",{value:!0}),X5.setIntervalMining=t;async function t(e,{interval:r}){const n=e.mode==="hardhat"?r*1e3:r;await e.request({method:"evm_setIntervalMining",params:[n]})}return X5}var e4={},fz;function DPe(){if(fz)return e4;fz=1,Object.defineProperty(e4,"__esModule",{value:!0}),e4.setLoggingEnabled=t;async function t(e,r){await e.request({method:`${e.mode}_setLoggingEnabled`,params:[r]})}return e4}var t4={},pz;function MPe(){if(pz)return t4;pz=1,Object.defineProperty(t4,"__esModule",{value:!0}),t4.setMinGasPrice=e;const t=ze();async function e(r,{gasPrice:n}){await r.request({method:`${r.mode}_setMinGasPrice`,params:[(0,t.numberToHex)(n)]})}return t4}var r4={},gz;function LPe(){if(gz)return r4;gz=1,Object.defineProperty(r4,"__esModule",{value:!0}),r4.setNextBlockBaseFeePerGas=e;const t=ze();async function e(r,{baseFeePerGas:n}){await r.request({method:`${r.mode}_setNextBlockBaseFeePerGas`,params:[(0,t.numberToHex)(n)]})}return r4}var n4={},mz;function UPe(){if(mz)return n4;mz=1,Object.defineProperty(n4,"__esModule",{value:!0}),n4.setNextBlockTimestamp=e;const t=ze();async function e(r,{timestamp:n}){await r.request({method:"evm_setNextBlockTimestamp",params:[(0,t.numberToHex)(n)]})}return n4}var i4={},wz;function FPe(){if(wz)return i4;wz=1,Object.defineProperty(i4,"__esModule",{value:!0}),i4.setNonce=e;const t=ze();async function e(r,{address:n,nonce:i}){await r.request({method:`${r.mode}_setNonce`,params:[n,(0,t.numberToHex)(i)]})}return i4}var s4={},bz;function HPe(){if(bz)return s4;bz=1,Object.defineProperty(s4,"__esModule",{value:!0}),s4.setRpcUrl=t;async function t(e,r){await e.request({method:`${e.mode}_setRpcUrl`,params:[r]})}return s4}var o4={},yz;function qPe(){if(yz)return o4;yz=1,Object.defineProperty(o4,"__esModule",{value:!0}),o4.setStorageAt=e;const t=ze();async function e(r,{address:n,index:i,value:s}){await r.request({method:`${r.mode}_setStorageAt`,params:[n,typeof i=="number"?(0,t.numberToHex)(i):i,s]})}return o4}var a4={},vz;function zPe(){if(vz)return a4;vz=1,Object.defineProperty(a4,"__esModule",{value:!0}),a4.snapshot=t;async function t(e){return await e.request({method:"evm_snapshot"})}return a4}var c4={},_z;function WPe(){if(_z)return c4;_z=1,Object.defineProperty(c4,"__esModule",{value:!0}),c4.stopImpersonatingAccount=t;async function t(e,{address:r}){await e.request({method:`${e.mode}_stopImpersonatingAccount`,params:[r]})}return c4}var Ez;function YX(){if(Ez)return k5;Ez=1,Object.defineProperty(k5,"__esModule",{value:!0}),k5.testActions=N;const t=mPe(),e=wPe(),r=bPe(),n=yPe(),i=vPe(),s=_Pe(),o=EPe(),a=CPe(),c=APe(),u=xPe(),l=SPe(),d=TPe(),h=IPe(),f=PPe(),g=OPe(),p=RPe(),m=kPe(),b=NPe(),v=$Pe(),E=jPe(),w=BPe(),C=DPe(),y=MPe(),_=LPe(),x=UPe(),A=FPe(),T=HPe(),O=qPe(),k=zPe(),j=WPe();function N({mode:S}){return P=>{const I=P.extend(()=>({mode:S}));return{dropTransaction:B=>(0,t.dropTransaction)(I,B),dumpState:()=>(0,e.dumpState)(I),getAutomine:()=>(0,r.getAutomine)(I),getTxpoolContent:()=>(0,n.getTxpoolContent)(I),getTxpoolStatus:()=>(0,i.getTxpoolStatus)(I),impersonateAccount:B=>(0,s.impersonateAccount)(I,B),increaseTime:B=>(0,o.increaseTime)(I,B),inspectTxpool:()=>(0,a.inspectTxpool)(I),loadState:B=>(0,c.loadState)(I,B),mine:B=>(0,u.mine)(I,B),removeBlockTimestampInterval:()=>(0,l.removeBlockTimestampInterval)(I),reset:B=>(0,d.reset)(I,B),revert:B=>(0,h.revert)(I,B),sendUnsignedTransaction:B=>(0,f.sendUnsignedTransaction)(I,B),setAutomine:B=>(0,g.setAutomine)(I,B),setBalance:B=>(0,p.setBalance)(I,B),setBlockGasLimit:B=>(0,m.setBlockGasLimit)(I,B),setBlockTimestampInterval:B=>(0,b.setBlockTimestampInterval)(I,B),setCode:B=>(0,v.setCode)(I,B),setCoinbase:B=>(0,E.setCoinbase)(I,B),setIntervalMining:B=>(0,w.setIntervalMining)(I,B),setLoggingEnabled:B=>(0,C.setLoggingEnabled)(I,B),setMinGasPrice:B=>(0,y.setMinGasPrice)(I,B),setNextBlockBaseFeePerGas:B=>(0,_.setNextBlockBaseFeePerGas)(I,B),setNextBlockTimestamp:B=>(0,x.setNextBlockTimestamp)(I,B),setNonce:B=>(0,A.setNonce)(I,B),setRpcUrl:B=>(0,T.setRpcUrl)(I,B),setStorageAt:B=>(0,O.setStorageAt)(I,B),snapshot:()=>(0,k.snapshot)(I),stopImpersonatingAccount:B=>(0,j.stopImpersonatingAccount)(I,B)}}}return k5}var Cz;function VPe(){if(Cz)return R5;Cz=1,Object.defineProperty(R5,"__esModule",{value:!0}),R5.createTestClient=r;const t=bx(),e=YX();function r(n){const{key:i="test",name:s="Test Client",mode:o}=n;return(0,t.createClient)({...n,key:i,name:s,type:"testClient"}).extend(c=>({mode:o,...(0,e.testActions)({mode:o})(c)}))}return R5}var u4={},l4={},Az;function GPe(){if(Az)return l4;Az=1,Object.defineProperty(l4,"__esModule",{value:!0}),l4.addChain=e;const t=ze();async function e(r,{chain:n}){const{id:i,name:s,nativeCurrency:o,rpcUrls:a,blockExplorers:c}=n;await r.request({method:"wallet_addEthereumChain",params:[{chainId:(0,t.numberToHex)(i),chainName:s,nativeCurrency:o,rpcUrls:a.default.http,blockExplorerUrls:c?Object.values(c).map(({url:u})=>u):void 0}]},{dedupe:!0,retryCount:0})}return l4}var d4={},xz;function KPe(){if(xz)return d4;xz=1,Object.defineProperty(d4,"__esModule",{value:!0}),d4.deployContract=r;const t=k2(),e=mx();function r(n,i){const{abi:s,args:o,bytecode:a,...c}=i,u=(0,t.encodeDeployData)({abi:s,args:o,bytecode:a});return(0,e.sendTransaction)(n,{...c,...c.authorizationList?{to:null}:{},data:u})}return d4}var h4={},Sz;function ZPe(){if(Sz)return h4;Sz=1,Object.defineProperty(h4,"__esModule",{value:!0}),h4.getAddresses=e;const t=js();async function e(r){var i;return((i=r.account)==null?void 0:i.type)==="local"?[r.account.address]:(await r.request({method:"eth_accounts"},{dedupe:!0})).map(s=>(0,t.checksumAddress)(s))}return h4}var f4={},Tz;function YPe(){if(Tz)return f4;Tz=1,Object.defineProperty(f4,"__esModule",{value:!0}),f4.getCapabilities=r;const t=sn(),e=ze();async function r(n,i={}){const{account:s=n.account,chainId:o}=i,a=s?(0,t.parseAccount)(s):void 0,c=o?[a==null?void 0:a.address,[(0,e.numberToHex)(o)]]:[a==null?void 0:a.address],u=await n.request({method:"wallet_getCapabilities",params:c}),l={};for(const[d,h]of Object.entries(u)){l[Number(d)]={};for(let[f,g]of Object.entries(h))f==="addSubAccount"&&(f="unstable_addSubAccount"),l[Number(d)][f]=g}return typeof o=="number"?l[o]:l}return f4}var p4={},Iz;function JPe(){if(Iz)return p4;Iz=1,Object.defineProperty(p4,"__esModule",{value:!0}),p4.getPermissions=t;async function t(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}return p4}var g4={},Pz;function JX(){if(Pz)return g4;Pz=1,Object.defineProperty(g4,"__esModule",{value:!0}),g4.prepareAuthorization=o;const t=sn(),e=zp(),r=fa(),n=ur(),i=C1(),s=ox();async function o(a,c){var p;const{account:u=a.account,chainId:l,nonce:d}=c;if(!u)throw new e.AccountNotFoundError({docsPath:"/docs/eip7702/prepareAuthorization"});const h=(0,t.parseAccount)(u),f=(()=>{if(c.executor)return c.executor==="self"?c.executor:(0,t.parseAccount)(c.executor)})(),g={address:c.contractAddress??c.address,chainId:l,nonce:d};return typeof g.chainId>"u"&&(g.chainId=((p=a.chain)==null?void 0:p.id)??await(0,n.getAction)(a,i.getChainId,"getChainId")({})),typeof g.nonce>"u"&&(g.nonce=await(0,n.getAction)(a,s.getTransactionCount,"getTransactionCount")({address:h.address,blockTag:"pending"}),(f==="self"||f!=null&&f.address&&(0,r.isAddressEqual)(f.address,h.address))&&(g.nonce+=1)),g}return g4}var m4={},Oz;function QPe(){if(Oz)return m4;Oz=1,Object.defineProperty(m4,"__esModule",{value:!0}),m4.requestAddresses=e;const t=js();async function e(r){return(await r.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(i=>(0,t.getAddress)(i))}return m4}var w4={},Rz;function XPe(){if(Rz)return w4;Rz=1,Object.defineProperty(w4,"__esModule",{value:!0}),w4.requestPermissions=t;async function t(e,r){return e.request({method:"wallet_requestPermissions",params:[r]},{retryCount:0})}return w4}var b4={},kz;function e9e(){if(kz)return b4;kz=1,Object.defineProperty(b4,"__esModule",{value:!0}),b4.showCallsStatus=t;async function t(e,r){const{id:n}=r;await e.request({method:"wallet_showCallsStatus",params:[n]})}return b4}var y4={},Nz;function t9e(){if(Nz)return y4;Nz=1,Object.defineProperty(y4,"__esModule",{value:!0}),y4.signAuthorization=n;const t=sn(),e=zp(),r=JX();async function n(i,s){const{account:o=i.account}=s;if(!o)throw new e.AccountNotFoundError({docsPath:"/docs/eip7702/signAuthorization"});const a=(0,t.parseAccount)(o);if(!a.signAuthorization)throw new e.AccountTypeNotSupportedError({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:a.type});const c=await(0,r.prepareAuthorization)(i,s);return a.signAuthorization(c)}return y4}var v4={},$z;function r9e(){if($z)return v4;$z=1,Object.defineProperty(v4,"__esModule",{value:!0}),v4.signMessage=n;const t=sn(),e=zp(),r=ze();async function n(i,{account:s=i.account,message:o}){if(!s)throw new e.AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const a=(0,t.parseAccount)(s);if(a.signMessage)return a.signMessage({message:o});const c=typeof o=="string"?(0,r.stringToHex)(o):o.raw instanceof Uint8Array?(0,r.toHex)(o.raw):o.raw;return i.request({method:"personal_sign",params:[c,a.address]},{retryCount:0})}return v4}var _4={},jz;function n9e(){if(jz)return _4;jz=1,Object.defineProperty(_4,"__esModule",{value:!0}),_4.signTransaction=c;const t=sn(),e=zp(),r=gx(),n=ze(),i=il(),s=ur(),o=sl(),a=C1();async function c(u,l){var v,E,w,C;const{account:d=u.account,chain:h=u.chain,...f}=l;if(!d)throw new e.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTransaction"});const g=(0,t.parseAccount)(d);(0,o.assertRequest)({account:g,...l});const p=await(0,s.getAction)(u,a.getChainId,"getChainId")({});h!==null&&(0,r.assertCurrentChain)({currentChainId:p,chain:h});const m=(h==null?void 0:h.formatters)||((v=u.chain)==null?void 0:v.formatters),b=((E=m==null?void 0:m.transactionRequest)==null?void 0:E.format)||i.formatTransactionRequest;return g.signTransaction?g.signTransaction({...f,chainId:p},{serializer:(C=(w=u.chain)==null?void 0:w.serializers)==null?void 0:C.transaction}):await u.request({method:"eth_signTransaction",params:[{...b(f),chainId:(0,n.numberToHex)(p),from:g.address}]},{retryCount:0})}return _4}var E4={},Bz;function i9e(){if(Bz)return E4;Bz=1,Object.defineProperty(E4,"__esModule",{value:!0}),E4.signTypedData=n;const t=sn(),e=zp(),r=vx();async function n(i,s){const{account:o=i.account,domain:a,message:c,primaryType:u}=s;if(!o)throw new e.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});const l=(0,t.parseAccount)(o),d={EIP712Domain:(0,r.getTypesForEIP712Domain)({domain:a}),...s.types};if((0,r.validateTypedData)({domain:a,message:c,primaryType:u,types:d}),l.signTypedData)return l.signTypedData({domain:a,message:c,primaryType:u,types:d});const h=(0,r.serializeTypedData)({domain:a,message:c,primaryType:u,types:d});return i.request({method:"eth_signTypedData_v4",params:[l.address,h]},{retryCount:0})}return E4}var C4={},Dz;function s9e(){if(Dz)return C4;Dz=1,Object.defineProperty(C4,"__esModule",{value:!0}),C4.switchChain=e;const t=ze();async function e(r,{id:n}){await r.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,t.numberToHex)(n)}]},{retryCount:0})}return C4}var A4={},Mz;function o9e(){if(Mz)return A4;Mz=1,Object.defineProperty(A4,"__esModule",{value:!0}),A4.watchAsset=t;async function t(e,r){return await e.request({method:"wallet_watchAsset",params:r},{retryCount:0})}return A4}var Lz;function QX(){if(Lz)return u4;Lz=1,Object.defineProperty(u4,"__esModule",{value:!0}),u4.walletActions=_;const t=C1(),e=GPe(),r=KPe(),n=ZPe(),i=sX(),s=YPe(),o=JPe(),a=JX(),c=dx(),u=QPe(),l=XPe(),d=iX(),h=FO(),f=mx(),g=e9e(),p=t9e(),m=r9e(),b=n9e(),v=i9e(),E=s9e(),w=oX(),C=o9e(),y=nX();function _(x){return{addChain:A=>(0,e.addChain)(x,A),deployContract:A=>(0,r.deployContract)(x,A),getAddresses:()=>(0,n.getAddresses)(x),getCallsStatus:A=>(0,i.getCallsStatus)(x,A),getCapabilities:A=>(0,s.getCapabilities)(x,A),getChainId:()=>(0,t.getChainId)(x),getPermissions:()=>(0,o.getPermissions)(x),prepareAuthorization:A=>(0,a.prepareAuthorization)(x,A),prepareTransactionRequest:A=>(0,c.prepareTransactionRequest)(x,A),requestAddresses:()=>(0,u.requestAddresses)(x),requestPermissions:A=>(0,l.requestPermissions)(x,A),sendCalls:A=>(0,d.sendCalls)(x,A),sendRawTransaction:A=>(0,h.sendRawTransaction)(x,A),sendTransaction:A=>(0,f.sendTransaction)(x,A),showCallsStatus:A=>(0,g.showCallsStatus)(x,A),signAuthorization:A=>(0,p.signAuthorization)(x,A),signMessage:A=>(0,m.signMessage)(x,A),signTransaction:A=>(0,b.signTransaction)(x,A),signTypedData:A=>(0,v.signTypedData)(x,A),switchChain:A=>(0,E.switchChain)(x,A),waitForCallsStatus:A=>(0,w.waitForCallsStatus)(x,A),watchAsset:A=>(0,C.watchAsset)(x,A),writeContract:A=>(0,y.writeContract)(x,A)}}return u4}var x4={},Uz;function a9e(){if(Uz)return x4;Uz=1,Object.defineProperty(x4,"__esModule",{value:!0}),x4.createWalletClient=r;const t=bx(),e=QX();function r(n){const{key:i="wallet",name:s="Wallet Client",transport:o}=n;return(0,t.createClient)({...n,key:i,name:s,transport:o,type:"walletClient"}).extend(e.walletActions)}return x4}var S4={},Fz;function c9e(){if(Fz)return S4;Fz=1,Object.defineProperty(S4,"__esModule",{value:!0}),S4.webSocket=s;const t=ha(),e=qO(),r=vX(),n=KO(),i=j2();function s(o,a={}){const{keepAlive:c,key:u="webSocket",methods:l,name:d="WebSocket JSON-RPC",reconnect:h,retryDelay:f}=a;return({chain:g,retryCount:p,timeout:m})=>{var C;const b=a.retryCount??p,v=m??a.timeout??1e4,E=o||((C=g==null?void 0:g.rpcUrls.default.webSocket)==null?void 0:C[0]),w={keepAlive:c,reconnect:h};if(!E)throw new e.UrlRequiredError;return(0,i.createTransport)({key:u,methods:l,name:d,async request({method:y,params:_}){const x={method:y,params:_},A=await(0,n.getWebSocketRpcClient)(E,w),{error:T,result:O}=await A.requestAsync({body:x,timeout:v});if(T)throw new t.RpcRequestError({body:x,error:T,url:E});return O},retryCount:b,retryDelay:f,timeout:v,type:"webSocket"},{getSocket(){return(0,r.getSocket)(E)},getRpcClient(){return(0,n.getWebSocketRpcClient)(E,w)},async subscribe({params:y,onData:_,onError:x}){const A=await(0,n.getWebSocketRpcClient)(E,w),{result:T}=await new Promise((O,k)=>A.request({body:{method:"eth_subscribe",params:y},onError(j){k(j),x==null||x(j)},onResponse(j){if(j.error){k(j.error),x==null||x(j.error);return}if(typeof j.id=="number"){O(j);return}j.method==="eth_subscription"&&_(j.params)}}));return{subscriptionId:T,async unsubscribe(){return new Promise(O=>A.request({body:{method:"eth_unsubscribe",params:[T]},onResponse:O}))}}}})}}return S4}var Jw={},Hz;function u9e(){if(Hz)return Jw;Hz=1,Object.defineProperty(Jw,"__esModule",{value:!0}),Jw.ProviderRpcError=void 0;class t extends Error{constructor(r,n){super(n),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r,this.details=n}}return Jw.ProviderRpcError=t,Jw}var T4={},qz;function l9e(){if(qz)return T4;qz=1,Object.defineProperty(T4,"__esModule",{value:!0}),T4.decodeDeployData=n;const t=$r(),e=Jd(),r="/docs/contract/decodeDeployData";function n(i){const{abi:s,bytecode:o,data:a}=i;if(a===o)return{bytecode:o};const c=s.find(l=>"type"in l&&l.type==="constructor");if(!c)throw new t.AbiConstructorNotFoundError({docsPath:r});if(!("inputs"in c))throw new t.AbiConstructorParamsNotFoundError({docsPath:r});if(!c.inputs||c.inputs.length===0)throw new t.AbiConstructorParamsNotFoundError({docsPath:r});return{args:(0,e.decodeAbiParameters)(c.inputs,`0x${a.replace(o,"")}`),bytecode:o}}return T4}var I4={},zz;function d9e(){if(zz)return I4;zz=1,Object.defineProperty(I4,"__esModule",{value:!0}),I4.compactSignatureToSignature=r;const t=Tr(),e=ze();function r({r:n,yParityAndS:i}){const s=(0,t.hexToBytes)(i),o=s[0]&128?1:0,a=s;return o===1&&(a[0]&=127),{r:n,s:(0,e.bytesToHex)(a),yParity:o}}return I4}var P4={},Wz;function h9e(){if(Wz)return P4;Wz=1,Object.defineProperty(P4,"__esModule",{value:!0}),P4.parseCompactSignature=r;const t=A2(),e=ze();function r(n){const{r:i,s}=t.secp256k1.Signature.fromCompact(n.slice(2,130));return{r:(0,e.numberToHex)(i,{size:32}),yParityAndS:(0,e.numberToHex)(s,{size:32})}}return P4}var O4={},Vz;function f9e(){if(Vz)return O4;Vz=1,Object.defineProperty(O4,"__esModule",{value:!0}),O4.parseSignature=r;const t=A2(),e=ze();function r(n){const{r:i,s}=t.secp256k1.Signature.fromCompact(n.slice(2,130)),o=+`0x${n.slice(130)}`,[a,c]=(()=>{if(o===0||o===1)return[void 0,o];if(o===27)return[BigInt(o),0];if(o===28)return[BigInt(o),1];throw new Error("Invalid yParityOrV value")})();return typeof a<"u"?{r:(0,e.numberToHex)(i,{size:32}),s:(0,e.numberToHex)(s,{size:32}),v:a,yParity:c}:{r:(0,e.numberToHex)(i,{size:32}),s:(0,e.numberToHex)(s,{size:32}),yParity:c}}return O4}var R4={},Gz;function p9e(){if(Gz)return R4;Gz=1,Object.defineProperty(R4,"__esModule",{value:!0}),R4.recoverTransactionAddress=i;const t=ns(),e=iR(),r=Ex(),n=th();async function i(s){const{serializedTransaction:o,signature:a}=s,c=(0,e.parseTransaction)(o),u=a??{r:c.r,s:c.s,v:c.v,yParity:c.yParity},l=(0,r.serializeTransaction)({...c,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await(0,n.recoverAddress)({hash:(0,t.keccak256)(l),signature:u})}return R4}var k4={},Kz;function g9e(){if(Kz)return k4;Kz=1,Object.defineProperty(k4,"__esModule",{value:!0}),k4.signatureToCompactSignature=r;const t=Tr(),e=ze();function r(n){const{r:i,s,v:o,yParity:a}=n,c=Number(a??o-27n);let u=s;if(c===1){const l=(0,t.hexToBytes)(s);l[0]|=128,u=(0,e.bytesToHex)(l)}return{r:i,yParityAndS:u}}return k4}var N4={},Zz;function m9e(){if(Zz)return N4;Zz=1,Object.defineProperty(N4,"__esModule",{value:!0}),N4.serializeCompactSignature=r;const t=A2(),e=nn();function r({r:n,yParityAndS:i}){return`0x${new t.secp256k1.Signature((0,e.hexToBigInt)(n),(0,e.hexToBigInt)(i)).toCompactHex()}`}return N4}var $4={},Yz;function w9e(){if(Yz)return $4;Yz=1,Object.defineProperty($4,"__esModule",{value:!0}),$4.sidecarsToVersionedHashes=e;const t=xO();function e(r){const{sidecars:n,version:i}=r,s=r.to??(typeof n[0].blob=="string"?"hex":"bytes"),o=[];for(const{commitment:a}of n)o.push((0,t.commitmentToVersionedHash)({commitment:a,to:s,version:i}));return o}return $4}var j4={},Jz;function b9e(){if(Jz)return j4;Jz=1,Object.defineProperty(j4,"__esModule",{value:!0}),j4.fromBlobs=n;const t=v2(),e=Tr(),r=ze();function n(i){const s=i.to??(typeof i.blobs[0]=="string"?"hex":"bytes"),o=typeof i.blobs[0]=="string"?i.blobs.map(d=>(0,e.hexToBytes)(d)):i.blobs,a=o.reduce((d,h)=>d+h.length,0),c=(0,t.createCursor)(new Uint8Array(a));let u=!0;for(const d of o){const h=(0,t.createCursor)(d);for(;u&&h.position<d.length;){h.incrementPosition(1);let f=31;d.length-h.position<31&&(f=d.length-h.position);for(const g in Array.from({length:f})){const p=h.readByte();if(p===128&&!h.inspectBytes(h.remaining).includes(128)){u=!1;break}c.pushByte(p)}}}const l=c.bytes.slice(0,c.position);return s==="hex"?(0,r.bytesToHex)(l):l}return j4}var B4={},Qz;function XX(){if(Qz)return B4;Qz=1,Object.defineProperty(B4,"__esModule",{value:!0}),B4.defineKzg=t;function t({blobToKzgCommitment:e,computeBlobKzgProof:r}){return{blobToKzgCommitment:e,computeBlobKzgProof:r}}return B4}var D4={},Xz;function y9e(){if(Xz)return D4;Xz=1,Object.defineProperty(D4,"__esModule",{value:!0}),D4.setupKzg=e;const t=XX();function e(r,n){try{r.loadTrustedSetup(n)}catch(i){const s=i;if(!s.message.includes("trusted setup is already loaded"))throw s}return(0,t.defineKzg)(r)}return D4}var eW;function v9e(){return eW||(eW=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.maxInt8=t.weiUnits=t.gweiUnits=t.etherUnits=t.universalSignatureValidatorByteCode=t.deploylessCallViaFactoryBytecode=t.deploylessCallViaBytecodeBytecode=t.zeroAddress=t.ethAddress=t.universalSignatureValidatorAbi=t.erc4626Abi=t.erc1155Abi=t.erc721Abi=t.erc20Abi_bytes32=t.erc20Abi=t.multicall3Abi=t.webSocket=t.createWalletClient=t.createTransport=t.walletActions=t.testActions=t.publicActions=t.createTestClient=t.createPublicClient=t.http=t.shouldThrow=t.fallback=t.custom=t.rpcSchema=t.createClient=t.WaitForCallsStatusTimeoutError=t.getContract=t.parseAbiParameters=t.parseAbiParameter=t.parseAbiItem=t.parseAbi=t.UnknownSignatureError=t.UnknownTypeError=t.SolidityProtectedKeywordError=t.InvalidStructSignatureError=t.InvalidSignatureError=t.InvalidParenthesisError=t.InvalidParameterError=t.InvalidModifierError=t.InvalidFunctionModifierError=t.InvalidAbiTypeParameterError=t.InvalidAbiItemError=t.InvalidAbiParametersError=t.InvalidAbiParameterError=t.CircularReferenceError=void 0,t.maxUint152=t.maxUint144=t.maxUint136=t.maxUint128=t.maxUint120=t.maxUint112=t.maxUint104=t.maxUint96=t.maxUint88=t.maxUint80=t.maxUint72=t.maxUint64=t.maxUint56=t.maxUint48=t.maxUint40=t.maxUint32=t.maxUint24=t.maxUint16=t.maxUint8=t.maxInt256=t.maxInt248=t.maxInt240=t.maxInt232=t.maxInt224=t.maxInt216=t.maxInt208=t.maxInt200=t.maxInt192=t.maxInt184=t.maxInt176=t.maxInt168=t.maxInt160=t.maxInt152=t.maxInt144=t.maxInt136=t.maxInt128=t.maxInt120=t.maxInt112=t.maxInt104=t.maxInt96=t.maxInt88=t.maxInt80=t.maxInt72=t.maxInt64=t.maxInt56=t.maxInt48=t.maxInt40=t.maxInt32=t.maxInt24=t.maxInt16=void 0,t.AbiDecodingDataSizeInvalidError=t.AbiConstructorParamsNotFoundError=t.AbiConstructorNotFoundError=t.presignMessagePrefix=t.zeroHash=t.minInt256=t.minInt248=t.minInt240=t.minInt232=t.minInt224=t.minInt216=t.minInt208=t.minInt200=t.minInt192=t.minInt184=t.minInt176=t.minInt168=t.minInt160=t.minInt152=t.minInt144=t.minInt136=t.minInt128=t.minInt120=t.minInt112=t.minInt104=t.minInt96=t.minInt88=t.minInt80=t.minInt72=t.minInt64=t.minInt56=t.minInt48=t.minInt40=t.minInt32=t.minInt24=t.minInt16=t.minInt8=t.maxUint256=t.maxUint248=t.maxUint240=t.maxUint232=t.maxUint224=t.maxUint216=t.maxUint208=t.maxUint200=t.maxUint192=t.maxUint184=t.maxUint176=t.maxUint168=t.maxUint160=void 0,t.ProviderRpcError=t.ProviderDisconnectedError=t.ParseRpcError=t.MethodNotSupportedRpcError=t.MethodNotFoundRpcError=t.LimitExceededRpcError=t.JsonRpcVersionUnsupportedError=t.InvalidRequestRpcError=t.InvalidParamsRpcError=t.InvalidInputRpcError=t.InternalRpcError=t.DuplicateIdError=t.ChainDisconnectedError=t.BundleTooLargeError=t.AtomicityNotSupportedError=t.AtomicReadyWalletRejectedUpgradeError=t.MaxFeePerGasTooLowError=t.Eip1559FeesNotSupportedError=t.BaseFeeScalarError=t.CounterfactualDeploymentFailedError=t.RawContractError=t.ContractFunctionZeroDataError=t.ContractFunctionRevertedError=t.ContractFunctionExecutionError=t.CallExecutionError=t.BlockNotFoundError=t.setErrorConfig=t.BaseError=t.UnsupportedPackedAbiType=t.InvalidDefinitionTypeError=t.InvalidArrayError=t.InvalidAbiEncodingTypeError=t.InvalidAbiDecodingTypeError=t.DecodeLogTopicsMismatch=t.DecodeLogDataMismatch=t.BytesSizeMismatchError=t.AbiFunctionSignatureNotFoundError=t.AbiFunctionOutputsNotFoundError=t.AbiFunctionNotFoundError=t.AbiEventSignatureNotFoundError=t.AbiEventSignatureEmptyTopicsError=t.AbiEventNotFoundError=t.AbiErrorSignatureNotFoundError=t.AbiErrorNotFoundError=t.AbiErrorInputsNotFoundError=t.AbiEncodingBytesSizeMismatchError=t.AbiEncodingLengthMismatchError=t.AbiEncodingArrayLengthMismatchError=t.AbiDecodingZeroDataError=t.AbiDecodingDataSizeTooSmallError=void 0,t.InvalidSerializedTransactionError=t.InvalidSerializableTransactionError=t.InvalidLegacyVError=t.FeeConflictError=t.InvalidAddressError=t.WebSocketRequestError=t.SocketClosedError=t.TimeoutError=t.RpcRequestError=t.HttpRequestError=t.FilterTypeNotSupportedError=t.UnknownNodeError=t.TransactionTypeNotSupportedError=t.TipAboveFeeCapError=t.NonceTooLowError=t.NonceTooHighError=t.NonceMaxValueError=t.IntrinsicGasTooLowError=t.IntrinsicGasTooHighError=t.InsufficientFundsError=t.FeeCapTooLowError=t.FeeCapTooHighError=t.ExecutionRevertedError=t.EstimateGasExecutionError=t.InvalidDecimalNumberError=t.EnsAvatarUnsupportedNamespaceError=t.EnsAvatarInvalidNftUriError=t.EnsAvatarUriResolutionError=t.SizeOverflowError=t.InvalidHexValueError=t.InvalidHexBooleanError=t.IntegerOutOfRangeError=t.InvalidBytesBooleanError=t.InvalidChainIdError=t.ClientChainNotConfiguredError=t.ChainNotFoundError=t.ChainMismatchError=t.ChainDoesNotSupportContract=t.UserRejectedRequestError=t.UnsupportedProviderMethodError=t.UnsupportedNonOptionalCapabilityError=t.UnsupportedChainIdError=t.UnknownRpcError=t.UnknownBundleIdError=t.UnauthorizedProviderError=t.TransactionRejectedRpcError=t.SwitchChainError=t.RpcError=t.ResourceUnavailableRpcError=t.ResourceNotFoundRpcError=void 0,t.hashStruct=t.hashDomain=t.getTransactionType=t.getSerializedTransactionType=t.getCreateAddress=t.getCreate2Address=t.getContractAddress=t.getAbiItem=t.rpcTransactionType=t.formatTransactionRequest=t.defineTransactionRequest=t.formatTransactionReceipt=t.defineTransactionReceipt=t.transactionType=t.formatTransaction=t.defineTransaction=t.parseEventLogs=t.encodeFunctionResult=t.prepareEncodeFunctionData=t.encodeFunctionData=t.encodeEventTopics=t.encodeErrorResult=t.encodeDeployData=t.encodeAbiParameters=t.decodeFunctionResult=t.decodeFunctionData=t.decodeEventLog=t.decodeErrorResult=t.decodeDeployData=t.decodeAbiParameters=t.formatLog=t.formatBlock=t.defineBlock=t.namehash=t.labelhash=t.EIP1193ProviderRpcError=t.InvalidStructTypeError=t.InvalidPrimaryTypeError=t.InvalidDomainError=t.StateAssignmentConflictError=t.AccountStateConflictError=t.UrlRequiredError=t.SliceOffsetOutOfBoundsError=t.SizeExceedsPaddingSizeError=t.WaitForTransactionReceiptTimeoutError=t.TransactionReceiptNotFoundError=t.TransactionNotFoundError=t.TransactionExecutionError=t.InvalidStorageKeySizeError=t.InvalidSerializedTransactionTypeError=void 0,t.blobsToCommitments=t.offchainLookupSignature=t.offchainLookupAbiItem=t.offchainLookup=t.ccipFetch=t.ccipRequest=t.fromBytes=t.bytesToString=t.bytesToNumber=t.bytesToBool=t.bytesToBigInt=t.toHex=t.stringToHex=t.numberToHex=t.bytesToHex=t.boolToHex=t.toBytes=t.stringToBytes=t.numberToBytes=t.hexToBytes=t.boolToBytes=t.assertTransactionLegacy=t.assertTransactionEIP2930=t.assertTransactionEIP1559=t.assertRequest=t.serializeErc6492Signature=t.isErc6492Signature=t.parseErc6492Signature=t.verifyTypedData=t.verifyMessage=t.verifyHash=t.toRlp=t.hexToRlp=t.bytesToRlp=t.serializeSignature=t.signatureToHex=t.serializeCompactSignature=t.compactSignatureToHex=t.signatureToCompactSignature=t.recoverTypedDataAddress=t.recoverTransactionAddress=t.recoverPublicKey=t.recoverMessageAddress=t.recoverAddress=t.parseSignature=t.hexToSignature=t.parseCompactSignature=t.hexToCompactSignature=t.compactSignatureToSignature=t.hashTypedData=void 0,t.keccak256=t.isHex=t.isHash=t.isBytes=t.isAddressEqual=t.isAddress=t.toPrefixedMessage=t.hashMessage=t.toFunctionHash=t.toEventHash=t.getFunctionSignature=t.toFunctionSignature=t.getEventSignature=t.toEventSignature=t.getFunctionSelector=t.toFunctionSelector=t.getEventSelector=t.toEventSelector=t.getContractError=t.getAddress=t.checksumAddress=t.fromRlp=t.hexToString=t.hexToNumber=t.hexToBool=t.hexToBigInt=t.fromHex=t.formatUnits=t.formatGwei=t.formatEther=t.withTimeout=t.withRetry=t.withCache=t.encodePacked=t.getChainContractAddress=t.extractChain=t.defineChain=t.assertCurrentChain=t.concatHex=t.concatBytes=t.concat=t.setupKzg=t.defineKzg=t.toBlobs=t.toBlobSidecars=t.fromBlobs=t.blobsToProofs=t.sidecarsToVersionedHashes=t.commitmentsToVersionedHashes=t.commitmentToVersionedHash=void 0,t.nonceManager=t.createNonceManager=t.getTypesForEIP712Domain=t.domainSeparator=t.validateTypedData=t.serializeTypedData=t.trim=t.stringify=t.sliceHex=t.sliceBytes=t.slice=t.size=t.serializeTransaction=t.serializeAccessList=t.parseUnits=t.parseTransaction=t.parseGwei=t.parseEther=t.padHex=t.padBytes=t.pad=t.ripemd160=t.sha256=void 0;var e=Kd();Object.defineProperty(t,"CircularReferenceError",{enumerable:!0,get:function(){return e.CircularReferenceError}}),Object.defineProperty(t,"InvalidAbiParameterError",{enumerable:!0,get:function(){return e.InvalidAbiParameterError}}),Object.defineProperty(t,"InvalidAbiParametersError",{enumerable:!0,get:function(){return e.InvalidAbiParametersError}}),Object.defineProperty(t,"InvalidAbiItemError",{enumerable:!0,get:function(){return e.InvalidAbiItemError}}),Object.defineProperty(t,"InvalidAbiTypeParameterError",{enumerable:!0,get:function(){return e.InvalidAbiTypeParameterError}}),Object.defineProperty(t,"InvalidFunctionModifierError",{enumerable:!0,get:function(){return e.InvalidFunctionModifierError}}),Object.defineProperty(t,"InvalidModifierError",{enumerable:!0,get:function(){return e.InvalidModifierError}}),Object.defineProperty(t,"InvalidParameterError",{enumerable:!0,get:function(){return e.InvalidParameterError}}),Object.defineProperty(t,"InvalidParenthesisError",{enumerable:!0,get:function(){return e.InvalidParenthesisError}}),Object.defineProperty(t,"InvalidSignatureError",{enumerable:!0,get:function(){return e.InvalidSignatureError}}),Object.defineProperty(t,"InvalidStructSignatureError",{enumerable:!0,get:function(){return e.InvalidStructSignatureError}}),Object.defineProperty(t,"SolidityProtectedKeywordError",{enumerable:!0,get:function(){return e.SolidityProtectedKeywordError}}),Object.defineProperty(t,"UnknownTypeError",{enumerable:!0,get:function(){return e.UnknownTypeError}}),Object.defineProperty(t,"UnknownSignatureError",{enumerable:!0,get:function(){return e.UnknownSignatureError}}),Object.defineProperty(t,"parseAbi",{enumerable:!0,get:function(){return e.parseAbi}}),Object.defineProperty(t,"parseAbiItem",{enumerable:!0,get:function(){return e.parseAbiItem}}),Object.defineProperty(t,"parseAbiParameter",{enumerable:!0,get:function(){return e.parseAbiParameter}}),Object.defineProperty(t,"parseAbiParameters",{enumerable:!0,get:function(){return e.parseAbiParameters}});var r=EIe();Object.defineProperty(t,"getContract",{enumerable:!0,get:function(){return r.getContract}});var n=oX();Object.defineProperty(t,"WaitForCallsStatusTimeoutError",{enumerable:!0,get:function(){return n.WaitForCallsStatusTimeoutError}});var i=bx();Object.defineProperty(t,"createClient",{enumerable:!0,get:function(){return i.createClient}}),Object.defineProperty(t,"rpcSchema",{enumerable:!0,get:function(){return i.rpcSchema}});var s=AIe();Object.defineProperty(t,"custom",{enumerable:!0,get:function(){return s.custom}});var o=xIe();Object.defineProperty(t,"fallback",{enumerable:!0,get:function(){return o.fallback}}),Object.defineProperty(t,"shouldThrow",{enumerable:!0,get:function(){return o.shouldThrow}});var a=SIe();Object.defineProperty(t,"http",{enumerable:!0,get:function(){return a.http}});var c=gPe();Object.defineProperty(t,"createPublicClient",{enumerable:!0,get:function(){return c.createPublicClient}});var u=VPe();Object.defineProperty(t,"createTestClient",{enumerable:!0,get:function(){return u.createTestClient}});var l=ZX();Object.defineProperty(t,"publicActions",{enumerable:!0,get:function(){return l.publicActions}});var d=YX();Object.defineProperty(t,"testActions",{enumerable:!0,get:function(){return d.testActions}});var h=QX();Object.defineProperty(t,"walletActions",{enumerable:!0,get:function(){return h.walletActions}});var f=j2();Object.defineProperty(t,"createTransport",{enumerable:!0,get:function(){return f.createTransport}});var g=a9e();Object.defineProperty(t,"createWalletClient",{enumerable:!0,get:function(){return g.createWalletClient}});var p=c9e();Object.defineProperty(t,"webSocket",{enumerable:!0,get:function(){return p.webSocket}});var m=rh();Object.defineProperty(t,"multicall3Abi",{enumerable:!0,get:function(){return m.multicall3Abi}}),Object.defineProperty(t,"erc20Abi",{enumerable:!0,get:function(){return m.erc20Abi}}),Object.defineProperty(t,"erc20Abi_bytes32",{enumerable:!0,get:function(){return m.erc20Abi_bytes32}}),Object.defineProperty(t,"erc721Abi",{enumerable:!0,get:function(){return m.erc721Abi}}),Object.defineProperty(t,"erc1155Abi",{enumerable:!0,get:function(){return m.erc1155Abi}}),Object.defineProperty(t,"erc4626Abi",{enumerable:!0,get:function(){return m.erc4626Abi}}),Object.defineProperty(t,"universalSignatureValidatorAbi",{enumerable:!0,get:function(){return m.universalSignatureValidatorAbi}});var b=VX();Object.defineProperty(t,"ethAddress",{enumerable:!0,get:function(){return b.ethAddress}}),Object.defineProperty(t,"zeroAddress",{enumerable:!0,get:function(){return b.zeroAddress}});var v=hx();Object.defineProperty(t,"deploylessCallViaBytecodeBytecode",{enumerable:!0,get:function(){return v.deploylessCallViaBytecodeBytecode}}),Object.defineProperty(t,"deploylessCallViaFactoryBytecode",{enumerable:!0,get:function(){return v.deploylessCallViaFactoryBytecode}}),Object.defineProperty(t,"universalSignatureValidatorByteCode",{enumerable:!0,get:function(){return v.universalSignatureValidatorByteCode}});var E=_2();Object.defineProperty(t,"etherUnits",{enumerable:!0,get:function(){return E.etherUnits}}),Object.defineProperty(t,"gweiUnits",{enumerable:!0,get:function(){return E.gweiUnits}}),Object.defineProperty(t,"weiUnits",{enumerable:!0,get:function(){return E.weiUnits}});var w=_O();Object.defineProperty(t,"maxInt8",{enumerable:!0,get:function(){return w.maxInt8}}),Object.defineProperty(t,"maxInt16",{enumerable:!0,get:function(){return w.maxInt16}}),Object.defineProperty(t,"maxInt24",{enumerable:!0,get:function(){return w.maxInt24}}),Object.defineProperty(t,"maxInt32",{enumerable:!0,get:function(){return w.maxInt32}}),Object.defineProperty(t,"maxInt40",{enumerable:!0,get:function(){return w.maxInt40}}),Object.defineProperty(t,"maxInt48",{enumerable:!0,get:function(){return w.maxInt48}}),Object.defineProperty(t,"maxInt56",{enumerable:!0,get:function(){return w.maxInt56}}),Object.defineProperty(t,"maxInt64",{enumerable:!0,get:function(){return w.maxInt64}}),Object.defineProperty(t,"maxInt72",{enumerable:!0,get:function(){return w.maxInt72}}),Object.defineProperty(t,"maxInt80",{enumerable:!0,get:function(){return w.maxInt80}}),Object.defineProperty(t,"maxInt88",{enumerable:!0,get:function(){return w.maxInt88}}),Object.defineProperty(t,"maxInt96",{enumerable:!0,get:function(){return w.maxInt96}}),Object.defineProperty(t,"maxInt104",{enumerable:!0,get:function(){return w.maxInt104}}),Object.defineProperty(t,"maxInt112",{enumerable:!0,get:function(){return w.maxInt112}}),Object.defineProperty(t,"maxInt120",{enumerable:!0,get:function(){return w.maxInt120}}),Object.defineProperty(t,"maxInt128",{enumerable:!0,get:function(){return w.maxInt128}}),Object.defineProperty(t,"maxInt136",{enumerable:!0,get:function(){return w.maxInt136}}),Object.defineProperty(t,"maxInt144",{enumerable:!0,get:function(){return w.maxInt144}}),Object.defineProperty(t,"maxInt152",{enumerable:!0,get:function(){return w.maxInt152}}),Object.defineProperty(t,"maxInt160",{enumerable:!0,get:function(){return w.maxInt160}}),Object.defineProperty(t,"maxInt168",{enumerable:!0,get:function(){return w.maxInt168}}),Object.defineProperty(t,"maxInt176",{enumerable:!0,get:function(){return w.maxInt176}}),Object.defineProperty(t,"maxInt184",{enumerable:!0,get:function(){return w.maxInt184}}),Object.defineProperty(t,"maxInt192",{enumerable:!0,get:function(){return w.maxInt192}}),Object.defineProperty(t,"maxInt200",{enumerable:!0,get:function(){return w.maxInt200}}),Object.defineProperty(t,"maxInt208",{enumerable:!0,get:function(){return w.maxInt208}}),Object.defineProperty(t,"maxInt216",{enumerable:!0,get:function(){return w.maxInt216}}),Object.defineProperty(t,"maxInt224",{enumerable:!0,get:function(){return w.maxInt224}}),Object.defineProperty(t,"maxInt232",{enumerable:!0,get:function(){return w.maxInt232}}),Object.defineProperty(t,"maxInt240",{enumerable:!0,get:function(){return w.maxInt240}}),Object.defineProperty(t,"maxInt248",{enumerable:!0,get:function(){return w.maxInt248}}),Object.defineProperty(t,"maxInt256",{enumerable:!0,get:function(){return w.maxInt256}}),Object.defineProperty(t,"maxUint8",{enumerable:!0,get:function(){return w.maxUint8}}),Object.defineProperty(t,"maxUint16",{enumerable:!0,get:function(){return w.maxUint16}}),Object.defineProperty(t,"maxUint24",{enumerable:!0,get:function(){return w.maxUint24}}),Object.defineProperty(t,"maxUint32",{enumerable:!0,get:function(){return w.maxUint32}}),Object.defineProperty(t,"maxUint40",{enumerable:!0,get:function(){return w.maxUint40}}),Object.defineProperty(t,"maxUint48",{enumerable:!0,get:function(){return w.maxUint48}}),Object.defineProperty(t,"maxUint56",{enumerable:!0,get:function(){return w.maxUint56}}),Object.defineProperty(t,"maxUint64",{enumerable:!0,get:function(){return w.maxUint64}}),Object.defineProperty(t,"maxUint72",{enumerable:!0,get:function(){return w.maxUint72}}),Object.defineProperty(t,"maxUint80",{enumerable:!0,get:function(){return w.maxUint80}}),Object.defineProperty(t,"maxUint88",{enumerable:!0,get:function(){return w.maxUint88}}),Object.defineProperty(t,"maxUint96",{enumerable:!0,get:function(){return w.maxUint96}}),Object.defineProperty(t,"maxUint104",{enumerable:!0,get:function(){return w.maxUint104}}),Object.defineProperty(t,"maxUint112",{enumerable:!0,get:function(){return w.maxUint112}}),Object.defineProperty(t,"maxUint120",{enumerable:!0,get:function(){return w.maxUint120}}),Object.defineProperty(t,"maxUint128",{enumerable:!0,get:function(){return w.maxUint128}}),Object.defineProperty(t,"maxUint136",{enumerable:!0,get:function(){return w.maxUint136}}),Object.defineProperty(t,"maxUint144",{enumerable:!0,get:function(){return w.maxUint144}}),Object.defineProperty(t,"maxUint152",{enumerable:!0,get:function(){return w.maxUint152}}),Object.defineProperty(t,"maxUint160",{enumerable:!0,get:function(){return w.maxUint160}}),Object.defineProperty(t,"maxUint168",{enumerable:!0,get:function(){return w.maxUint168}}),Object.defineProperty(t,"maxUint176",{enumerable:!0,get:function(){return w.maxUint176}}),Object.defineProperty(t,"maxUint184",{enumerable:!0,get:function(){return w.maxUint184}}),Object.defineProperty(t,"maxUint192",{enumerable:!0,get:function(){return w.maxUint192}}),Object.defineProperty(t,"maxUint200",{enumerable:!0,get:function(){return w.maxUint200}}),Object.defineProperty(t,"maxUint208",{enumerable:!0,get:function(){return w.maxUint208}}),Object.defineProperty(t,"maxUint216",{enumerable:!0,get:function(){return w.maxUint216}}),Object.defineProperty(t,"maxUint224",{enumerable:!0,get:function(){return w.maxUint224}}),Object.defineProperty(t,"maxUint232",{enumerable:!0,get:function(){return w.maxUint232}}),Object.defineProperty(t,"maxUint240",{enumerable:!0,get:function(){return w.maxUint240}}),Object.defineProperty(t,"maxUint248",{enumerable:!0,get:function(){return w.maxUint248}}),Object.defineProperty(t,"maxUint256",{enumerable:!0,get:function(){return w.maxUint256}}),Object.defineProperty(t,"minInt8",{enumerable:!0,get:function(){return w.minInt8}}),Object.defineProperty(t,"minInt16",{enumerable:!0,get:function(){return w.minInt16}}),Object.defineProperty(t,"minInt24",{enumerable:!0,get:function(){return w.minInt24}}),Object.defineProperty(t,"minInt32",{enumerable:!0,get:function(){return w.minInt32}}),Object.defineProperty(t,"minInt40",{enumerable:!0,get:function(){return w.minInt40}}),Object.defineProperty(t,"minInt48",{enumerable:!0,get:function(){return w.minInt48}}),Object.defineProperty(t,"minInt56",{enumerable:!0,get:function(){return w.minInt56}}),Object.defineProperty(t,"minInt64",{enumerable:!0,get:function(){return w.minInt64}}),Object.defineProperty(t,"minInt72",{enumerable:!0,get:function(){return w.minInt72}}),Object.defineProperty(t,"minInt80",{enumerable:!0,get:function(){return w.minInt80}}),Object.defineProperty(t,"minInt88",{enumerable:!0,get:function(){return w.minInt88}}),Object.defineProperty(t,"minInt96",{enumerable:!0,get:function(){return w.minInt96}}),Object.defineProperty(t,"minInt104",{enumerable:!0,get:function(){return w.minInt104}}),Object.defineProperty(t,"minInt112",{enumerable:!0,get:function(){return w.minInt112}}),Object.defineProperty(t,"minInt120",{enumerable:!0,get:function(){return w.minInt120}}),Object.defineProperty(t,"minInt128",{enumerable:!0,get:function(){return w.minInt128}}),Object.defineProperty(t,"minInt136",{enumerable:!0,get:function(){return w.minInt136}}),Object.defineProperty(t,"minInt144",{enumerable:!0,get:function(){return w.minInt144}}),Object.defineProperty(t,"minInt152",{enumerable:!0,get:function(){return w.minInt152}}),Object.defineProperty(t,"minInt160",{enumerable:!0,get:function(){return w.minInt160}}),Object.defineProperty(t,"minInt168",{enumerable:!0,get:function(){return w.minInt168}}),Object.defineProperty(t,"minInt176",{enumerable:!0,get:function(){return w.minInt176}}),Object.defineProperty(t,"minInt184",{enumerable:!0,get:function(){return w.minInt184}}),Object.defineProperty(t,"minInt192",{enumerable:!0,get:function(){return w.minInt192}}),Object.defineProperty(t,"minInt200",{enumerable:!0,get:function(){return w.minInt200}}),Object.defineProperty(t,"minInt208",{enumerable:!0,get:function(){return w.minInt208}}),Object.defineProperty(t,"minInt216",{enumerable:!0,get:function(){return w.minInt216}}),Object.defineProperty(t,"minInt224",{enumerable:!0,get:function(){return w.minInt224}}),Object.defineProperty(t,"minInt232",{enumerable:!0,get:function(){return w.minInt232}}),Object.defineProperty(t,"minInt240",{enumerable:!0,get:function(){return w.minInt240}}),Object.defineProperty(t,"minInt248",{enumerable:!0,get:function(){return w.minInt248}}),Object.defineProperty(t,"minInt256",{enumerable:!0,get:function(){return w.minInt256}});var C=tR();Object.defineProperty(t,"zeroHash",{enumerable:!0,get:function(){return C.zeroHash}});var y=RX();Object.defineProperty(t,"presignMessagePrefix",{enumerable:!0,get:function(){return y.presignMessagePrefix}});var _=$r();Object.defineProperty(t,"AbiConstructorNotFoundError",{enumerable:!0,get:function(){return _.AbiConstructorNotFoundError}}),Object.defineProperty(t,"AbiConstructorParamsNotFoundError",{enumerable:!0,get:function(){return _.AbiConstructorParamsNotFoundError}}),Object.defineProperty(t,"AbiDecodingDataSizeInvalidError",{enumerable:!0,get:function(){return _.AbiDecodingDataSizeInvalidError}}),Object.defineProperty(t,"AbiDecodingDataSizeTooSmallError",{enumerable:!0,get:function(){return _.AbiDecodingDataSizeTooSmallError}}),Object.defineProperty(t,"AbiDecodingZeroDataError",{enumerable:!0,get:function(){return _.AbiDecodingZeroDataError}}),Object.defineProperty(t,"AbiEncodingArrayLengthMismatchError",{enumerable:!0,get:function(){return _.AbiEncodingArrayLengthMismatchError}}),Object.defineProperty(t,"AbiEncodingLengthMismatchError",{enumerable:!0,get:function(){return _.AbiEncodingLengthMismatchError}}),Object.defineProperty(t,"AbiEncodingBytesSizeMismatchError",{enumerable:!0,get:function(){return _.AbiEncodingBytesSizeMismatchError}}),Object.defineProperty(t,"AbiErrorInputsNotFoundError",{enumerable:!0,get:function(){return _.AbiErrorInputsNotFoundError}}),Object.defineProperty(t,"AbiErrorNotFoundError",{enumerable:!0,get:function(){return _.AbiErrorNotFoundError}}),Object.defineProperty(t,"AbiErrorSignatureNotFoundError",{enumerable:!0,get:function(){return _.AbiErrorSignatureNotFoundError}}),Object.defineProperty(t,"AbiEventNotFoundError",{enumerable:!0,get:function(){return _.AbiEventNotFoundError}}),Object.defineProperty(t,"AbiEventSignatureEmptyTopicsError",{enumerable:!0,get:function(){return _.AbiEventSignatureEmptyTopicsError}}),Object.defineProperty(t,"AbiEventSignatureNotFoundError",{enumerable:!0,get:function(){return _.AbiEventSignatureNotFoundError}}),Object.defineProperty(t,"AbiFunctionNotFoundError",{enumerable:!0,get:function(){return _.AbiFunctionNotFoundError}}),Object.defineProperty(t,"AbiFunctionOutputsNotFoundError",{enumerable:!0,get:function(){return _.AbiFunctionOutputsNotFoundError}}),Object.defineProperty(t,"AbiFunctionSignatureNotFoundError",{enumerable:!0,get:function(){return _.AbiFunctionSignatureNotFoundError}}),Object.defineProperty(t,"BytesSizeMismatchError",{enumerable:!0,get:function(){return _.BytesSizeMismatchError}}),Object.defineProperty(t,"DecodeLogDataMismatch",{enumerable:!0,get:function(){return _.DecodeLogDataMismatch}}),Object.defineProperty(t,"DecodeLogTopicsMismatch",{enumerable:!0,get:function(){return _.DecodeLogTopicsMismatch}}),Object.defineProperty(t,"InvalidAbiDecodingTypeError",{enumerable:!0,get:function(){return _.InvalidAbiDecodingTypeError}}),Object.defineProperty(t,"InvalidAbiEncodingTypeError",{enumerable:!0,get:function(){return _.InvalidAbiEncodingTypeError}}),Object.defineProperty(t,"InvalidArrayError",{enumerable:!0,get:function(){return _.InvalidArrayError}}),Object.defineProperty(t,"InvalidDefinitionTypeError",{enumerable:!0,get:function(){return _.InvalidDefinitionTypeError}}),Object.defineProperty(t,"UnsupportedPackedAbiType",{enumerable:!0,get:function(){return _.UnsupportedPackedAbiType}});var x=_t();Object.defineProperty(t,"BaseError",{enumerable:!0,get:function(){return x.BaseError}}),Object.defineProperty(t,"setErrorConfig",{enumerable:!0,get:function(){return x.setErrorConfig}});var A=EO();Object.defineProperty(t,"BlockNotFoundError",{enumerable:!0,get:function(){return A.BlockNotFoundError}});var T=Qd();Object.defineProperty(t,"CallExecutionError",{enumerable:!0,get:function(){return T.CallExecutionError}}),Object.defineProperty(t,"ContractFunctionExecutionError",{enumerable:!0,get:function(){return T.ContractFunctionExecutionError}}),Object.defineProperty(t,"ContractFunctionRevertedError",{enumerable:!0,get:function(){return T.ContractFunctionRevertedError}}),Object.defineProperty(t,"ContractFunctionZeroDataError",{enumerable:!0,get:function(){return T.ContractFunctionZeroDataError}}),Object.defineProperty(t,"RawContractError",{enumerable:!0,get:function(){return T.RawContractError}}),Object.defineProperty(t,"CounterfactualDeploymentFailedError",{enumerable:!0,get:function(){return T.CounterfactualDeploymentFailedError}});var O=ix();Object.defineProperty(t,"BaseFeeScalarError",{enumerable:!0,get:function(){return O.BaseFeeScalarError}}),Object.defineProperty(t,"Eip1559FeesNotSupportedError",{enumerable:!0,get:function(){return O.Eip1559FeesNotSupportedError}}),Object.defineProperty(t,"MaxFeePerGasTooLowError",{enumerable:!0,get:function(){return O.MaxFeePerGasTooLowError}});var k=Xd();Object.defineProperty(t,"AtomicReadyWalletRejectedUpgradeError",{enumerable:!0,get:function(){return k.AtomicReadyWalletRejectedUpgradeError}}),Object.defineProperty(t,"AtomicityNotSupportedError",{enumerable:!0,get:function(){return k.AtomicityNotSupportedError}}),Object.defineProperty(t,"BundleTooLargeError",{enumerable:!0,get:function(){return k.BundleTooLargeError}}),Object.defineProperty(t,"ChainDisconnectedError",{enumerable:!0,get:function(){return k.ChainDisconnectedError}}),Object.defineProperty(t,"DuplicateIdError",{enumerable:!0,get:function(){return k.DuplicateIdError}}),Object.defineProperty(t,"InternalRpcError",{enumerable:!0,get:function(){return k.InternalRpcError}}),Object.defineProperty(t,"InvalidInputRpcError",{enumerable:!0,get:function(){return k.InvalidInputRpcError}}),Object.defineProperty(t,"InvalidParamsRpcError",{enumerable:!0,get:function(){return k.InvalidParamsRpcError}}),Object.defineProperty(t,"InvalidRequestRpcError",{enumerable:!0,get:function(){return k.InvalidRequestRpcError}}),Object.defineProperty(t,"JsonRpcVersionUnsupportedError",{enumerable:!0,get:function(){return k.JsonRpcVersionUnsupportedError}}),Object.defineProperty(t,"LimitExceededRpcError",{enumerable:!0,get:function(){return k.LimitExceededRpcError}}),Object.defineProperty(t,"MethodNotFoundRpcError",{enumerable:!0,get:function(){return k.MethodNotFoundRpcError}}),Object.defineProperty(t,"MethodNotSupportedRpcError",{enumerable:!0,get:function(){return k.MethodNotSupportedRpcError}}),Object.defineProperty(t,"ParseRpcError",{enumerable:!0,get:function(){return k.ParseRpcError}}),Object.defineProperty(t,"ProviderDisconnectedError",{enumerable:!0,get:function(){return k.ProviderDisconnectedError}}),Object.defineProperty(t,"ProviderRpcError",{enumerable:!0,get:function(){return k.ProviderRpcError}}),Object.defineProperty(t,"ResourceNotFoundRpcError",{enumerable:!0,get:function(){return k.ResourceNotFoundRpcError}}),Object.defineProperty(t,"ResourceUnavailableRpcError",{enumerable:!0,get:function(){return k.ResourceUnavailableRpcError}}),Object.defineProperty(t,"RpcError",{enumerable:!0,get:function(){return k.RpcError}}),Object.defineProperty(t,"SwitchChainError",{enumerable:!0,get:function(){return k.SwitchChainError}}),Object.defineProperty(t,"TransactionRejectedRpcError",{enumerable:!0,get:function(){return k.TransactionRejectedRpcError}}),Object.defineProperty(t,"UnauthorizedProviderError",{enumerable:!0,get:function(){return k.UnauthorizedProviderError}}),Object.defineProperty(t,"UnknownBundleIdError",{enumerable:!0,get:function(){return k.UnknownBundleIdError}}),Object.defineProperty(t,"UnknownRpcError",{enumerable:!0,get:function(){return k.UnknownRpcError}}),Object.defineProperty(t,"UnsupportedChainIdError",{enumerable:!0,get:function(){return k.UnsupportedChainIdError}}),Object.defineProperty(t,"UnsupportedNonOptionalCapabilityError",{enumerable:!0,get:function(){return k.UnsupportedNonOptionalCapabilityError}}),Object.defineProperty(t,"UnsupportedProviderMethodError",{enumerable:!0,get:function(){return k.UnsupportedProviderMethodError}}),Object.defineProperty(t,"UserRejectedRequestError",{enumerable:!0,get:function(){return k.UserRejectedRequestError}});var j=R2();Object.defineProperty(t,"ChainDoesNotSupportContract",{enumerable:!0,get:function(){return j.ChainDoesNotSupportContract}}),Object.defineProperty(t,"ChainMismatchError",{enumerable:!0,get:function(){return j.ChainMismatchError}}),Object.defineProperty(t,"ChainNotFoundError",{enumerable:!0,get:function(){return j.ChainNotFoundError}}),Object.defineProperty(t,"ClientChainNotConfiguredError",{enumerable:!0,get:function(){return j.ClientChainNotConfiguredError}}),Object.defineProperty(t,"InvalidChainIdError",{enumerable:!0,get:function(){return j.InvalidChainIdError}});var N=y1();Object.defineProperty(t,"InvalidBytesBooleanError",{enumerable:!0,get:function(){return N.InvalidBytesBooleanError}}),Object.defineProperty(t,"IntegerOutOfRangeError",{enumerable:!0,get:function(){return N.IntegerOutOfRangeError}}),Object.defineProperty(t,"InvalidHexBooleanError",{enumerable:!0,get:function(){return N.InvalidHexBooleanError}}),Object.defineProperty(t,"InvalidHexValueError",{enumerable:!0,get:function(){return N.InvalidHexValueError}}),Object.defineProperty(t,"SizeOverflowError",{enumerable:!0,get:function(){return N.SizeOverflowError}});var S=hX();Object.defineProperty(t,"EnsAvatarUriResolutionError",{enumerable:!0,get:function(){return S.EnsAvatarUriResolutionError}}),Object.defineProperty(t,"EnsAvatarInvalidNftUriError",{enumerable:!0,get:function(){return S.EnsAvatarInvalidNftUriError}}),Object.defineProperty(t,"EnsAvatarUnsupportedNamespaceError",{enumerable:!0,get:function(){return S.EnsAvatarUnsupportedNamespaceError}});var P=DX();Object.defineProperty(t,"InvalidDecimalNumberError",{enumerable:!0,get:function(){return P.InvalidDecimalNumberError}});var I=UQ();Object.defineProperty(t,"EstimateGasExecutionError",{enumerable:!0,get:function(){return I.EstimateGasExecutionError}});var B=nl();Object.defineProperty(t,"ExecutionRevertedError",{enumerable:!0,get:function(){return B.ExecutionRevertedError}}),Object.defineProperty(t,"FeeCapTooHighError",{enumerable:!0,get:function(){return B.FeeCapTooHighError}}),Object.defineProperty(t,"FeeCapTooLowError",{enumerable:!0,get:function(){return B.FeeCapTooLowError}}),Object.defineProperty(t,"InsufficientFundsError",{enumerable:!0,get:function(){return B.InsufficientFundsError}}),Object.defineProperty(t,"IntrinsicGasTooHighError",{enumerable:!0,get:function(){return B.IntrinsicGasTooHighError}}),Object.defineProperty(t,"IntrinsicGasTooLowError",{enumerable:!0,get:function(){return B.IntrinsicGasTooLowError}}),Object.defineProperty(t,"NonceMaxValueError",{enumerable:!0,get:function(){return B.NonceMaxValueError}}),Object.defineProperty(t,"NonceTooHighError",{enumerable:!0,get:function(){return B.NonceTooHighError}}),Object.defineProperty(t,"NonceTooLowError",{enumerable:!0,get:function(){return B.NonceTooLowError}}),Object.defineProperty(t,"TipAboveFeeCapError",{enumerable:!0,get:function(){return B.TipAboveFeeCapError}}),Object.defineProperty(t,"TransactionTypeNotSupportedError",{enumerable:!0,get:function(){return B.TransactionTypeNotSupportedError}}),Object.defineProperty(t,"UnknownNodeError",{enumerable:!0,get:function(){return B.UnknownNodeError}});var $=OQ();Object.defineProperty(t,"FilterTypeNotSupportedError",{enumerable:!0,get:function(){return $.FilterTypeNotSupportedError}});var R=ha();Object.defineProperty(t,"HttpRequestError",{enumerable:!0,get:function(){return R.HttpRequestError}}),Object.defineProperty(t,"RpcRequestError",{enumerable:!0,get:function(){return R.RpcRequestError}}),Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return R.TimeoutError}}),Object.defineProperty(t,"SocketClosedError",{enumerable:!0,get:function(){return R.SocketClosedError}}),Object.defineProperty(t,"WebSocketRequestError",{enumerable:!0,get:function(){return R.WebSocketRequestError}});var D=la();Object.defineProperty(t,"InvalidAddressError",{enumerable:!0,get:function(){return D.InvalidAddressError}});var L=Ds();Object.defineProperty(t,"FeeConflictError",{enumerable:!0,get:function(){return L.FeeConflictError}}),Object.defineProperty(t,"InvalidLegacyVError",{enumerable:!0,get:function(){return L.InvalidLegacyVError}}),Object.defineProperty(t,"InvalidSerializableTransactionError",{enumerable:!0,get:function(){return L.InvalidSerializableTransactionError}}),Object.defineProperty(t,"InvalidSerializedTransactionError",{enumerable:!0,get:function(){return L.InvalidSerializedTransactionError}}),Object.defineProperty(t,"InvalidSerializedTransactionTypeError",{enumerable:!0,get:function(){return L.InvalidSerializedTransactionTypeError}}),Object.defineProperty(t,"InvalidStorageKeySizeError",{enumerable:!0,get:function(){return L.InvalidStorageKeySizeError}}),Object.defineProperty(t,"TransactionExecutionError",{enumerable:!0,get:function(){return L.TransactionExecutionError}}),Object.defineProperty(t,"TransactionNotFoundError",{enumerable:!0,get:function(){return L.TransactionNotFoundError}}),Object.defineProperty(t,"TransactionReceiptNotFoundError",{enumerable:!0,get:function(){return L.TransactionReceiptNotFoundError}}),Object.defineProperty(t,"WaitForTransactionReceiptTimeoutError",{enumerable:!0,get:function(){return L.WaitForTransactionReceiptTimeoutError}});var U=ZA();Object.defineProperty(t,"SizeExceedsPaddingSizeError",{enumerable:!0,get:function(){return U.SizeExceedsPaddingSizeError}}),Object.defineProperty(t,"SliceOffsetOutOfBoundsError",{enumerable:!0,get:function(){return U.SliceOffsetOutOfBoundsError}});var z=qO();Object.defineProperty(t,"UrlRequiredError",{enumerable:!0,get:function(){return z.UrlRequiredError}});var W=wO();Object.defineProperty(t,"AccountStateConflictError",{enumerable:!0,get:function(){return W.AccountStateConflictError}}),Object.defineProperty(t,"StateAssignmentConflictError",{enumerable:!0,get:function(){return W.StateAssignmentConflictError}});var K=_X();Object.defineProperty(t,"InvalidDomainError",{enumerable:!0,get:function(){return K.InvalidDomainError}}),Object.defineProperty(t,"InvalidPrimaryTypeError",{enumerable:!0,get:function(){return K.InvalidPrimaryTypeError}}),Object.defineProperty(t,"InvalidStructTypeError",{enumerable:!0,get:function(){return K.InvalidStructTypeError}});var J=u9e();Object.defineProperty(t,"EIP1193ProviderRpcError",{enumerable:!0,get:function(){return J.ProviderRpcError}});var ne=dX();Object.defineProperty(t,"labelhash",{enumerable:!0,get:function(){return ne.labelhash}});var ae=GO();Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return ae.namehash}});var he=sx();Object.defineProperty(t,"defineBlock",{enumerable:!0,get:function(){return he.defineBlock}}),Object.defineProperty(t,"formatBlock",{enumerable:!0,get:function(){return he.formatBlock}});var ie=ol();Object.defineProperty(t,"formatLog",{enumerable:!0,get:function(){return ie.formatLog}});var Ee=Jd();Object.defineProperty(t,"decodeAbiParameters",{enumerable:!0,get:function(){return Ee.decodeAbiParameters}});var pe=l9e();Object.defineProperty(t,"decodeDeployData",{enumerable:!0,get:function(){return pe.decodeDeployData}});var ve=ex();Object.defineProperty(t,"decodeErrorResult",{enumerable:!0,get:function(){return ve.decodeErrorResult}});var je=P2();Object.defineProperty(t,"decodeEventLog",{enumerable:!0,get:function(){return je.decodeEventLog}});var rt=$O();Object.defineProperty(t,"decodeFunctionData",{enumerable:!0,get:function(){return rt.decodeFunctionData}});var Ce=al();Object.defineProperty(t,"decodeFunctionResult",{enumerable:!0,get:function(){return Ce.decodeFunctionResult}});var fe=da();Object.defineProperty(t,"encodeAbiParameters",{enumerable:!0,get:function(){return fe.encodeAbiParameters}});var ft=k2();Object.defineProperty(t,"encodeDeployData",{enumerable:!0,get:function(){return ft.encodeDeployData}});var Wt=jO();Object.defineProperty(t,"encodeErrorResult",{enumerable:!0,get:function(){return Wt.encodeErrorResult}});var lr=Up();Object.defineProperty(t,"encodeEventTopics",{enumerable:!0,get:function(){return lr.encodeEventTopics}});var dr=Bs();Object.defineProperty(t,"encodeFunctionData",{enumerable:!0,get:function(){return dr.encodeFunctionData}});var hr=kQ();Object.defineProperty(t,"prepareEncodeFunctionData",{enumerable:!0,get:function(){return hr.prepareEncodeFunctionData}});var Er=BO();Object.defineProperty(t,"encodeFunctionResult",{enumerable:!0,get:function(){return Er.encodeFunctionResult}});var be=O2();Object.defineProperty(t,"parseEventLogs",{enumerable:!0,get:function(){return be.parseEventLogs}});var Te=I2();Object.defineProperty(t,"defineTransaction",{enumerable:!0,get:function(){return Te.defineTransaction}}),Object.defineProperty(t,"formatTransaction",{enumerable:!0,get:function(){return Te.formatTransaction}}),Object.defineProperty(t,"transactionType",{enumerable:!0,get:function(){return Te.transactionType}});var Me=wx();Object.defineProperty(t,"defineTransactionReceipt",{enumerable:!0,get:function(){return Me.defineTransactionReceipt}}),Object.defineProperty(t,"formatTransactionReceipt",{enumerable:!0,get:function(){return Me.formatTransactionReceipt}});var st=il();Object.defineProperty(t,"defineTransactionRequest",{enumerable:!0,get:function(){return st.defineTransactionRequest}}),Object.defineProperty(t,"formatTransactionRequest",{enumerable:!0,get:function(){return st.formatTransactionRequest}}),Object.defineProperty(t,"rpcTransactionType",{enumerable:!0,get:function(){return st.rpcTransactionType}});var Cr=rl();Object.defineProperty(t,"getAbiItem",{enumerable:!0,get:function(){return Cr.getAbiItem}});var hn=AX();Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return hn.getContractAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return hn.getCreate2Address}}),Object.defineProperty(t,"getCreateAddress",{enumerable:!0,get:function(){return hn.getCreateAddress}});var ai=nR();Object.defineProperty(t,"getSerializedTransactionType",{enumerable:!0,get:function(){return ai.getSerializedTransactionType}});var fn=lx();Object.defineProperty(t,"getTransactionType",{enumerable:!0,get:function(){return fn.getTransactionType}});var Ms=B2();Object.defineProperty(t,"hashDomain",{enumerable:!0,get:function(){return Ms.hashDomain}}),Object.defineProperty(t,"hashStruct",{enumerable:!0,get:function(){return Ms.hashStruct}}),Object.defineProperty(t,"hashTypedData",{enumerable:!0,get:function(){return Ms.hashTypedData}});var mo=d9e();Object.defineProperty(t,"compactSignatureToSignature",{enumerable:!0,get:function(){return mo.compactSignatureToSignature}});var U2=h9e();Object.defineProperty(t,"hexToCompactSignature",{enumerable:!0,get:function(){return U2.parseCompactSignature}}),Object.defineProperty(t,"parseCompactSignature",{enumerable:!0,get:function(){return U2.parseCompactSignature}});var F2=f9e();Object.defineProperty(t,"hexToSignature",{enumerable:!0,get:function(){return F2.parseSignature}}),Object.defineProperty(t,"parseSignature",{enumerable:!0,get:function(){return F2.parseSignature}});var Px=th();Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return Px.recoverAddress}});var Ox=XO();Object.defineProperty(t,"recoverMessageAddress",{enumerable:!0,get:function(){return Ox.recoverMessageAddress}});var Rx=yO();Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return Rx.recoverPublicKey}});var kx=p9e();Object.defineProperty(t,"recoverTransactionAddress",{enumerable:!0,get:function(){return kx.recoverTransactionAddress}});var H2=eR();Object.defineProperty(t,"recoverTypedDataAddress",{enumerable:!0,get:function(){return H2.recoverTypedDataAddress}});var Nx=g9e();Object.defineProperty(t,"signatureToCompactSignature",{enumerable:!0,get:function(){return Nx.signatureToCompactSignature}});var q2=m9e();Object.defineProperty(t,"compactSignatureToHex",{enumerable:!0,get:function(){return q2.serializeCompactSignature}}),Object.defineProperty(t,"serializeCompactSignature",{enumerable:!0,get:function(){return q2.serializeCompactSignature}});var z2=GX();Object.defineProperty(t,"signatureToHex",{enumerable:!0,get:function(){return z2.serializeSignature}}),Object.defineProperty(t,"serializeSignature",{enumerable:!0,get:function(){return z2.serializeSignature}});var x1=x2();Object.defineProperty(t,"bytesToRlp",{enumerable:!0,get:function(){return x1.bytesToRlp}}),Object.defineProperty(t,"hexToRlp",{enumerable:!0,get:function(){return x1.hexToRlp}}),Object.defineProperty(t,"toRlp",{enumerable:!0,get:function(){return x1.toRlp}});var $x=NX();Object.defineProperty(t,"verifyHash",{enumerable:!0,get:function(){return $x.verifyHash}});var jx=$X();Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return jx.verifyMessage}});var Bx=jX();Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return Bx.verifyTypedData}});var Dx=BX();Object.defineProperty(t,"parseErc6492Signature",{enumerable:!0,get:function(){return Dx.parseErc6492Signature}});var Mx=Cx();Object.defineProperty(t,"isErc6492Signature",{enumerable:!0,get:function(){return Mx.isErc6492Signature}});var Lx=rR();Object.defineProperty(t,"serializeErc6492Signature",{enumerable:!0,get:function(){return Lx.serializeErc6492Signature}});var Ux=sl();Object.defineProperty(t,"assertRequest",{enumerable:!0,get:function(){return Ux.assertRequest}});var S1=_x();Object.defineProperty(t,"assertTransactionEIP1559",{enumerable:!0,get:function(){return S1.assertTransactionEIP1559}}),Object.defineProperty(t,"assertTransactionEIP2930",{enumerable:!0,get:function(){return S1.assertTransactionEIP2930}}),Object.defineProperty(t,"assertTransactionLegacy",{enumerable:!0,get:function(){return S1.assertTransactionLegacy}});var ih=Tr();Object.defineProperty(t,"boolToBytes",{enumerable:!0,get:function(){return ih.boolToBytes}}),Object.defineProperty(t,"hexToBytes",{enumerable:!0,get:function(){return ih.hexToBytes}}),Object.defineProperty(t,"numberToBytes",{enumerable:!0,get:function(){return ih.numberToBytes}}),Object.defineProperty(t,"stringToBytes",{enumerable:!0,get:function(){return ih.stringToBytes}}),Object.defineProperty(t,"toBytes",{enumerable:!0,get:function(){return ih.toBytes}});var sh=ze();Object.defineProperty(t,"boolToHex",{enumerable:!0,get:function(){return sh.boolToHex}}),Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return sh.bytesToHex}}),Object.defineProperty(t,"numberToHex",{enumerable:!0,get:function(){return sh.numberToHex}}),Object.defineProperty(t,"stringToHex",{enumerable:!0,get:function(){return sh.stringToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return sh.toHex}});var gc=mO();Object.defineProperty(t,"bytesToBigInt",{enumerable:!0,get:function(){return gc.bytesToBigInt}}),Object.defineProperty(t,"bytesToBool",{enumerable:!0,get:function(){return gc.bytesToBool}}),Object.defineProperty(t,"bytesToNumber",{enumerable:!0,get:function(){return gc.bytesToNumber}}),Object.defineProperty(t,"bytesToString",{enumerable:!0,get:function(){return gc.bytesToString}}),Object.defineProperty(t,"fromBytes",{enumerable:!0,get:function(){return gc.fromBytes}});var oh=MO();Object.defineProperty(t,"ccipRequest",{enumerable:!0,get:function(){return oh.ccipRequest}}),Object.defineProperty(t,"ccipFetch",{enumerable:!0,get:function(){return oh.ccipRequest}}),Object.defineProperty(t,"offchainLookup",{enumerable:!0,get:function(){return oh.offchainLookup}}),Object.defineProperty(t,"offchainLookupAbiItem",{enumerable:!0,get:function(){return oh.offchainLookupAbiItem}}),Object.defineProperty(t,"offchainLookupSignature",{enumerable:!0,get:function(){return oh.offchainLookupSignature}});var Fx=ax();Object.defineProperty(t,"blobsToCommitments",{enumerable:!0,get:function(){return Fx.blobsToCommitments}});var Hx=xO();Object.defineProperty(t,"commitmentToVersionedHash",{enumerable:!0,get:function(){return Hx.commitmentToVersionedHash}});var qx=SO();Object.defineProperty(t,"commitmentsToVersionedHashes",{enumerable:!0,get:function(){return qx.commitmentsToVersionedHashes}});var zx=w9e();Object.defineProperty(t,"sidecarsToVersionedHashes",{enumerable:!0,get:function(){return zx.sidecarsToVersionedHashes}});var Wx=cx();Object.defineProperty(t,"blobsToProofs",{enumerable:!0,get:function(){return Wx.blobsToProofs}});var Vx=b9e();Object.defineProperty(t,"fromBlobs",{enumerable:!0,get:function(){return Vx.fromBlobs}});var Gx=ux();Object.defineProperty(t,"toBlobSidecars",{enumerable:!0,get:function(){return Gx.toBlobSidecars}});var Kx=GQ();Object.defineProperty(t,"toBlobs",{enumerable:!0,get:function(){return Kx.toBlobs}});var W2=XX();Object.defineProperty(t,"defineKzg",{enumerable:!0,get:function(){return W2.defineKzg}});var Uee=y9e();Object.defineProperty(t,"setupKzg",{enumerable:!0,get:function(){return Uee.setupKzg}});var Zx=oi();Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return Zx.concat}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return Zx.concatBytes}}),Object.defineProperty(t,"concatHex",{enumerable:!0,get:function(){return Zx.concatHex}});var Fee=gx();Object.defineProperty(t,"assertCurrentChain",{enumerable:!0,get:function(){return Fee.assertCurrentChain}});var Hee=wX();Object.defineProperty(t,"defineChain",{enumerable:!0,get:function(){return Hee.defineChain}});var qee=bX();Object.defineProperty(t,"extractChain",{enumerable:!0,get:function(){return qee.extractChain}});var zee=nh();Object.defineProperty(t,"getChainContractAddress",{enumerable:!0,get:function(){return zee.getChainContractAddress}});var Wee=EX();Object.defineProperty(t,"encodePacked",{enumerable:!0,get:function(){return Wee.encodePacked}});var Vee=tX();Object.defineProperty(t,"withCache",{enumerable:!0,get:function(){return Vee.withCache}});var Gee=HO();Object.defineProperty(t,"withRetry",{enumerable:!0,get:function(){return Gee.withRetry}});var Kee=zO();Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return Kee.withTimeout}});var Zee=E2();Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return Zee.formatEther}});var Yee=Fp();Object.defineProperty(t,"formatGwei",{enumerable:!0,get:function(){return Yee.formatGwei}});var Jee=tx();Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return Jee.formatUnits}});var T1=nn();Object.defineProperty(t,"fromHex",{enumerable:!0,get:function(){return T1.fromHex}}),Object.defineProperty(t,"hexToBigInt",{enumerable:!0,get:function(){return T1.hexToBigInt}}),Object.defineProperty(t,"hexToBool",{enumerable:!0,get:function(){return T1.hexToBool}}),Object.defineProperty(t,"hexToNumber",{enumerable:!0,get:function(){return T1.hexToNumber}}),Object.defineProperty(t,"hexToString",{enumerable:!0,get:function(){return T1.hexToString}});var Qee=JO();Object.defineProperty(t,"fromRlp",{enumerable:!0,get:function(){return Qee.fromRlp}});var AR=js();Object.defineProperty(t,"checksumAddress",{enumerable:!0,get:function(){return AR.checksumAddress}}),Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return AR.getAddress}});var Xee=eh();Object.defineProperty(t,"getContractError",{enumerable:!0,get:function(){return Xee.getContractError}});var xR=v1();Object.defineProperty(t,"toEventSelector",{enumerable:!0,get:function(){return xR.toEventSelector}}),Object.defineProperty(t,"getEventSelector",{enumerable:!0,get:function(){return xR.toEventSelector}});var SR=Lp();Object.defineProperty(t,"toFunctionSelector",{enumerable:!0,get:function(){return SR.toFunctionSelector}}),Object.defineProperty(t,"getFunctionSelector",{enumerable:!0,get:function(){return SR.toFunctionSelector}});var TR=xX();Object.defineProperty(t,"toEventSignature",{enumerable:!0,get:function(){return TR.toEventSignature}}),Object.defineProperty(t,"getEventSignature",{enumerable:!0,get:function(){return TR.toEventSignature}});var IR=SX();Object.defineProperty(t,"toFunctionSignature",{enumerable:!0,get:function(){return IR.toFunctionSignature}}),Object.defineProperty(t,"getFunctionSignature",{enumerable:!0,get:function(){return IR.toFunctionSignature}});var ete=TX();Object.defineProperty(t,"toEventHash",{enumerable:!0,get:function(){return ete.toEventHash}});var tte=IX();Object.defineProperty(t,"toFunctionHash",{enumerable:!0,get:function(){return tte.toFunctionHash}});var rte=D2();Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return rte.hashMessage}});var nte=kX();Object.defineProperty(t,"toPrefixedMessage",{enumerable:!0,get:function(){return nte.toPrefixedMessage}});var ite=is();Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return ite.isAddress}});var ste=fa();Object.defineProperty(t,"isAddressEqual",{enumerable:!0,get:function(){return ste.isAddressEqual}});var ote=YO();Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return ote.isBytes}});var ate=QO();Object.defineProperty(t,"isHash",{enumerable:!0,get:function(){return ate.isHash}});var cte=ki();Object.defineProperty(t,"isHex",{enumerable:!0,get:function(){return cte.isHex}});var ute=ns();Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return ute.keccak256}});var lte=AO();Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return lte.sha256}});var dte=OX();Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return dte.ripemd160}});var Yx=Zd();Object.defineProperty(t,"pad",{enumerable:!0,get:function(){return Yx.pad}}),Object.defineProperty(t,"padBytes",{enumerable:!0,get:function(){return Yx.padBytes}}),Object.defineProperty(t,"padHex",{enumerable:!0,get:function(){return Yx.padHex}});var hte=MX();Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return hte.parseEther}});var fte=LX();Object.defineProperty(t,"parseGwei",{enumerable:!0,get:function(){return fte.parseGwei}});var pte=iR();Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return pte.parseTransaction}});var gte=Ax();Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return gte.parseUnits}});var mte=ZO();Object.defineProperty(t,"serializeAccessList",{enumerable:!0,get:function(){return mte.serializeAccessList}});var wte=Ex();Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return wte.serializeTransaction}});var bte=rs();Object.defineProperty(t,"size",{enumerable:!0,get:function(){return bte.size}});var Jx=go();Object.defineProperty(t,"slice",{enumerable:!0,get:function(){return Jx.slice}}),Object.defineProperty(t,"sliceBytes",{enumerable:!0,get:function(){return Jx.sliceBytes}}),Object.defineProperty(t,"sliceHex",{enumerable:!0,get:function(){return Jx.sliceHex}});var yte=Gn();Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return yte.stringify}});var vte=tl();Object.defineProperty(t,"trim",{enumerable:!0,get:function(){return vte.trim}});var V2=vx();Object.defineProperty(t,"serializeTypedData",{enumerable:!0,get:function(){return V2.serializeTypedData}}),Object.defineProperty(t,"validateTypedData",{enumerable:!0,get:function(){return V2.validateTypedData}}),Object.defineProperty(t,"domainSeparator",{enumerable:!0,get:function(){return V2.domainSeparator}}),Object.defineProperty(t,"getTypesForEIP712Domain",{enumerable:!0,get:function(){return V2.getTypesForEIP712Domain}});var PR=UX();Object.defineProperty(t,"createNonceManager",{enumerable:!0,get:function(){return PR.createNonceManager}}),Object.defineProperty(t,"nonceManager",{enumerable:!0,get:function(){return PR.nonceManager}})}(pT)),pT}var Rh={},tW;function _9e(){if(tW)return Rh;tW=1,Object.defineProperty(Rh,"__esModule",{value:!0}),Rh.MAGIC_VALUE_BYTES=Rh.MAGIC_VALUE=void 0;const t="0x1626ba7e";Rh.MAGIC_VALUE=t;const e="0x20c13b0b";return Rh.MAGIC_VALUE_BYTES=e,Rh}var M4={},Qw={},kh={},rW;function eee(){if(rW)return kh;rW=1,Object.defineProperty(kh,"__esModule",{value:!0}),kh.PermissionsError=kh.PERMISSIONS_REQUEST_REJECTED=void 0,kh.PERMISSIONS_REQUEST_REJECTED=4001;class t extends Error{constructor(r,n,i){super(r),this.code=n,this.data=i,Object.setPrototypeOf(this,t.prototype)}}return kh.PermissionsError=t,kh}var nW;function tee(){if(nW)return Qw;nW=1,Object.defineProperty(Qw,"__esModule",{value:!0}),Qw.Wallet=void 0;const t=Mp(),e=eee();class r{constructor(i){this.communicator=i}async getPermissions(){return(await this.communicator.send(t.Methods.wallet_getPermissions,void 0)).data}async requestPermissions(i){if(!this.isPermissionRequestValid(i))throw new e.PermissionsError("Permissions request is invalid",e.PERMISSIONS_REQUEST_REJECTED);try{return(await this.communicator.send(t.Methods.wallet_requestPermissions,i)).data}catch{throw new e.PermissionsError("Permissions rejected",e.PERMISSIONS_REQUEST_REJECTED)}}isPermissionRequestValid(i){return i.every(s=>typeof s=="object"?Object.keys(s).every(o=>!!Object.values(t.RestrictedMethods).includes(o)):!1)}}return Qw.Wallet=r,Qw}var iW;function E9e(){if(iW)return M4;iW=1,Object.defineProperty(M4,"__esModule",{value:!0});const t=tee(),e=eee(),r=(i,s)=>s.some(o=>o.parentCapability===i),n=()=>(i,s,o)=>{const a=o.value;return o.value=async function(){const c=new t.Wallet(this.communicator);let u=await c.getPermissions();if(r(s,u)||(u=await c.requestPermissions([{[s]:{}}])),!r(s,u))throw new e.PermissionsError("Permissions rejected",e.PERMISSIONS_REQUEST_REJECTED);return a.apply(this)},o};return M4.default=n,M4}var sW;function C9e(){if(sW)return Rc;sW=1;var t=Rc&&Rc.__decorate||function(u,l,d,h){var f=arguments.length,g=f<3?l:h===null?h=Object.getOwnPropertyDescriptor(l,d):h,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(u,l,d,h);else for(var m=u.length-1;m>=0;m--)(p=u[m])&&(g=(f<3?p(g):f>3?p(l,d,g):p(l,d))||g);return f>3&&g&&Object.defineProperty(l,d,g),g},e=Rc&&Rc.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.Safe=void 0;const r=v9e(),n=_9e(),i=Mp(),s=dO(),o=lO(),a=e(E9e());class c{constructor(l){this.communicator=l}async getChainInfo(){return(await this.communicator.send(i.Methods.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(i.Methods.getSafeInfo,void 0)).data}async experimental_getBalances({currency:l="usd"}={}){return(await this.communicator.send(i.Methods.getSafeBalances,{currency:l})).data}async check1271Signature(l,d="0x"){const h=await this.getInfo(),f=(0,r.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[l,d]}),g={call:s.RPC_CALLS.eth_call,params:[{to:h.safeAddress,data:f},"latest"]};try{return(await this.communicator.send(i.Methods.rpcCall,g)).data.slice(0,10).toLowerCase()===n.MAGIC_VALUE}catch{return!1}}async check1271SignatureBytes(l,d="0x"){const h=await this.getInfo(),f=(0,r.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[l,d]}),g={call:s.RPC_CALLS.eth_call,params:[{to:h.safeAddress,data:f},"latest"]};try{return(await this.communicator.send(i.Methods.rpcCall,g)).data.slice(0,10).toLowerCase()===n.MAGIC_VALUE_BYTES}catch{return!1}}calculateMessageHash(l){return(0,r.hashMessage)(l)}calculateTypedMessageHash(l){const d=typeof l.domain.chainId=="object"?l.domain.chainId.toNumber():Number(l.domain.chainId);let h=l.primaryType;if(!h){const f=Object.values(l.types),g=Object.keys(l.types).filter(p=>f.every(m=>m.every(({type:b})=>b.replace("[","").replace("]","")!==p)));if(g.length===0||g.length>1)throw new Error("Please specify primaryType");h=g[0]}return(0,r.hashTypedData)({message:l.message,domain:{...l.domain,chainId:d,verifyingContract:l.domain.verifyingContract,salt:l.domain.salt},types:l.types,primaryType:h})}async getOffChainSignature(l){return(await this.communicator.send(i.Methods.getOffChainSignature,l)).data}async isMessageSigned(l,d="0x"){let h;if(typeof l=="string"&&(h=async()=>{const f=this.calculateMessageHash(l);return await this.isMessageHashSigned(f,d)}),(0,o.isObjectEIP712TypedData)(l)&&(h=async()=>{const f=this.calculateTypedMessageHash(l);return await this.isMessageHashSigned(f,d)}),h)return await h();throw new Error("Invalid message type")}async isMessageHashSigned(l,d="0x"){const h=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const f of h)if(await f(l,d))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(i.Methods.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(i.Methods.requestAddressBook,void 0)).data}}return Rc.Safe=c,t([(0,a.default)()],c.prototype,"requestAddressBook",null),Rc}var oW;function aW(){if(oW)return g0;oW=1;var t=g0&&g0.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(g0,"__esModule",{value:!0});const e=t($Te()),r=QTe(),n=XTe(),i=C9e(),s=tee();class o{constructor(c={}){const{allowedDomains:u=null,debug:l=!1}=c;this.communicator=new e.default(u,l),this.eth=new n.Eth(this.communicator),this.txs=new r.TXs(this.communicator),this.safe=new i.Safe(this.communicator),this.wallet=new s.Wallet(this.communicator)}}return g0.default=o,g0}var cW;function A9e(){return cW||(cW=1,function(t){var e=Tc&&Tc.__createBinding||(Object.create?function(o,a,c,u){u===void 0&&(u=c);var l=Object.getOwnPropertyDescriptor(a,c);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(o,u,l)}:function(o,a,c,u){u===void 0&&(u=c),o[u]=a[c]}),r=Tc&&Tc.__exportStar||function(o,a){for(var c in o)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&e(a,o,c)},n=Tc&&Tc.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0}),t.getSDKVersion=void 0;const i=n(aW());t.default=i.default,r(aW(),t),r(lO(),t),r(Mp(),t),r(CQ(),t);var s=EQ();Object.defineProperty(t,"getSDKVersion",{enumerable:!0,get:function(){return s.getSDKVersion}}),r(dO(),t)}(Tc)),Tc}var Nh={},uW;function x9e(){if(uW)return Nh;uW=1,Object.defineProperty(Nh,"__esModule",{value:!0}),Nh.numberToHex=Nh.getLowerCase=void 0;function t(r){return r&&r.toLowerCase()}Nh.getLowerCase=t;function e(r){return`0x${r.toString(16)}`}return Nh.numberToHex=e,Nh}var lW;function S9e(){if(lW)return X1;lW=1,Object.defineProperty(X1,"__esModule",{value:!0}),X1.SafeAppProvider=void 0;const t=A9e(),e=LV(),r=x9e();class n extends e.EventEmitter{constructor(s,o){super(),this.submittedTxs=new Map,this.safe=s,this.sdk=o}async connect(){this.emit("connect",{chainId:this.chainId})}async disconnect(){}get chainId(){return this.safe.chainId}async request(s){var c,u,l,d;const{method:o,params:a=[]}=s;switch(o){case"eth_accounts":return[this.safe.safeAddress];case"net_version":case"eth_chainId":return(0,r.numberToHex)(this.chainId);case"personal_sign":{const[m,b]=a;if(this.safe.safeAddress.toLowerCase()!==b.toLowerCase())throw new Error("The address or message hash is invalid");const v=await this.sdk.txs.signMessage(m);return("signature"in v?v.signature:void 0)||"0x"}case"eth_sign":{const[m,b]=a;if(this.safe.safeAddress.toLowerCase()!==m.toLowerCase()||!b.startsWith("0x"))throw new Error("The address or message hash is invalid");const v=await this.sdk.txs.signMessage(b);return("signature"in v?v.signature:void 0)||"0x"}case"eth_signTypedData":case"eth_signTypedData_v4":{const[m,b]=a,v=typeof b=="string"?JSON.parse(b):b;if(this.safe.safeAddress.toLowerCase()!==m.toLowerCase())throw new Error("The address is invalid");const E=await this.sdk.txs.signTypedMessage(v);return("signature"in E?E.signature:void 0)||"0x"}case"eth_sendTransaction":const h={...a[0],value:a[0].value||"0",data:a[0].data||"0x"};typeof h.gas=="string"&&h.gas.startsWith("0x")&&(h.gas=parseInt(h.gas,16));const f=await this.sdk.txs.send({txs:[h],params:{safeTxGas:h.gas}});return this.submittedTxs.set(f.safeTxHash,{from:this.safe.safeAddress,hash:f.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:h.data,value:h.value,to:h.to,blockHash:null,blockNumber:null,transactionIndex:null}),f.safeTxHash;case"eth_blockNumber":return(await this.sdk.eth.getBlockByNumber(["latest"])).number;case"eth_getBalance":return this.sdk.eth.getBalance([(0,r.getLowerCase)(a[0]),a[1]]);case"eth_getCode":return this.sdk.eth.getCode([(0,r.getLowerCase)(a[0]),a[1]]);case"eth_getTransactionCount":return this.sdk.eth.getTransactionCount([(0,r.getLowerCase)(a[0]),a[1]]);case"eth_getStorageAt":return this.sdk.eth.getStorageAt([(0,r.getLowerCase)(a[0]),a[1],a[2]]);case"eth_getBlockByNumber":return this.sdk.eth.getBlockByNumber([a[0],a[1]]);case"eth_getBlockByHash":return this.sdk.eth.getBlockByHash([a[0],a[1]]);case"eth_getTransactionByHash":let p=a[0];try{p=(await this.sdk.txs.getBySafeTxHash(p)).txHash||p}catch{}return this.submittedTxs.has(p)?this.submittedTxs.get(p):this.sdk.eth.getTransactionByHash([p]).then(m=>(m&&(m.hash=a[0]),m));case"eth_getTransactionReceipt":{let m=a[0];try{m=(await this.sdk.txs.getBySafeTxHash(m)).txHash||m}catch{}return this.sdk.eth.getTransactionReceipt([m]).then(b=>(b&&(b.transactionHash=a[0]),b))}case"eth_estimateGas":return this.sdk.eth.getEstimateGas(a[0]);case"eth_call":return this.sdk.eth.call([a[0],a[1]]);case"eth_getLogs":return this.sdk.eth.getPastLogs([a[0]]);case"eth_gasPrice":return this.sdk.eth.getGasPrice();case"wallet_getPermissions":return this.sdk.wallet.getPermissions();case"wallet_requestPermissions":return this.sdk.wallet.requestPermissions(a[0]);case"safe_setSettings":return this.sdk.eth.setSafeSettings([a[0]]);case"wallet_sendCalls":{const{from:m,calls:b,chainId:v}=a[0];if(v!==(0,r.numberToHex)(this.chainId))throw new Error(`Safe is not on chain ${v}`);if(m!==this.safe.safeAddress)throw Error("Invalid from address");const E=b.map((y,_)=>{if(!y.to)throw new Error(`Invalid call #${_}: missing "to" field`);return{to:y.to,data:y.data??"0x",value:y.value??(0,r.numberToHex)(0)}}),{safeTxHash:w}=await this.sdk.txs.send({txs:E});return{id:w}}case"wallet_getCallsStatus":{const m=a[0],b={[t.TransactionStatus.AWAITING_CONFIRMATIONS]:100,[t.TransactionStatus.AWAITING_EXECUTION]:100,[t.TransactionStatus.SUCCESS]:200,[t.TransactionStatus.CANCELLED]:400,[t.TransactionStatus.FAILED]:500},v=await this.sdk.txs.getBySafeTxHash(m),E={version:"1.0",id:m,chainId:(0,r.numberToHex)(this.chainId),status:b[v.txStatus]};if(!v.txHash)return E;const w=await this.sdk.eth.getTransactionReceipt([v.txHash]);if(!w)return E;const C=((u=(c=v.txData)==null?void 0:c.dataDecoded)==null?void 0:u.method)!=="multiSend"?1:((d=(l=v.txData.dataDecoded.parameters)==null?void 0:l[0].valueDecoded)==null?void 0:d.length)??1,y=Number(w.blockNumber),_=Number(w.gasUsed);return E.receipts=Array(C).fill({logs:w.logs,status:(0,r.numberToHex)(v.txStatus===t.TransactionStatus.SUCCESS?1:0),blockHash:w.blockHash,blockNumber:(0,r.numberToHex)(y),gasUsed:(0,r.numberToHex)(_),transactionHash:v.txHash}),E}case"wallet_showCallsStatus":throw new Error(`"${s.method}" not supported`);case"wallet_getCapabilities":return{[(0,r.numberToHex)(this.chainId)]:{atomicBatch:{supported:!0}}};default:throw Error(`"${s.method}" not implemented`)}}send(s,o){s||o("Undefined request"),this.request(s).then(a=>o(null,{jsonrpc:"2.0",id:s.id,result:a})).catch(a=>o(a,null))}}return X1.SafeAppProvider=n,X1}var dW;function T9e(){return dW||(dW=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SafeAppProvider=void 0;var e=S9e();Object.defineProperty(t,"SafeAppProvider",{enumerable:!0,get:function(){return e.SafeAppProvider}})}(cT)),cT}var I9e=T9e();class P9e extends I9e.SafeAppProvider{request(e){return e.method==="eth_requestAccounts"?this.request({method:"eth_accounts",params:[]}):super.request(e)}}const O9e=Object.freeze(Object.defineProperty({__proto__:null,SafeProvider:P9e},Symbol.toStringTag,{value:"Module"})),ree=()=>"9.1.0",R9e=t=>t.toString(16).padStart(2,"0"),k9e=t=>{const e=new Uint8Array(t/2);return window.crypto.getRandomValues(e),Array.from(e,R9e).join("")},N9e=()=>typeof window<"u"?k9e(10):new Date().getTime().toString(36);class M2{}M2.makeRequest=(t,e)=>({id:N9e(),method:t,params:e,env:{sdkVersion:ree()}});M2.makeResponse=(t,e,r)=>({id:t,success:!0,version:r,data:e});M2.makeErrorResponse=(t,e,r)=>({id:t,success:!1,error:e,version:r});var Cn;(function(t){t.sendTransactions="sendTransactions",t.rpcCall="rpcCall",t.getChainInfo="getChainInfo",t.getSafeInfo="getSafeInfo",t.getTxBySafeTxHash="getTxBySafeTxHash",t.getSafeBalances="getSafeBalances",t.signMessage="signMessage",t.signTypedMessage="signTypedMessage",t.getEnvironmentInfo="getEnvironmentInfo",t.getOffChainSignature="getOffChainSignature",t.requestAddressBook="requestAddressBook",t.wallet_getPermissions="wallet_getPermissions",t.wallet_requestPermissions="wallet_requestPermissions"})(Cn||(Cn={}));var R6;(function(t){t.requestAddressBook="requestAddressBook"})(R6||(R6={}));class $9e{constructor(e=null,r=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:n,data:i,source:s})=>{const o=!i,a=!this.isServer&&s===window.parent,c=typeof i.version<"u"&&parseInt(i.version.split(".")[0]),u=typeof c=="number"&&c>=1;let l=!0;return Array.isArray(this.allowedOrigins)&&(l=this.allowedOrigins.find(d=>d.test(n))!==void 0),!o&&a&&u&&l},this.logIncomingMessage=n=>{console.info(`Safe Apps SDK v1: A message was received from origin ${n.origin}. `,n.data)},this.onParentMessage=n=>{this.isValidMessage(n)&&(this.debugMode&&this.logIncomingMessage(n),this.handleIncomingMessage(n.data))},this.handleIncomingMessage=n=>{const{id:i}=n,s=this.callbacks.get(i);s&&(s(n),this.callbacks.delete(i))},this.send=(n,i)=>{const s=M2.makeRequest(n,i);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(s,"*"),new Promise((o,a)=>{this.callbacks.set(s.id,c=>{if(!c.success){a(new Error(c.error));return}o(c)})})},this.allowedOrigins=e,this.debugMode=r,this.isServer||window.addEventListener("message",this.onParentMessage)}}const lR=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t;AQ();class j9e{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw new Error("Invalid safeTxHash");return(await this.communicator.send(Cn.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){const r={message:e};return(await this.communicator.send(Cn.signMessage,r)).data}async signTypedMessage(e){if(!lR(e))throw new Error("Invalid typed data");return(await this.communicator.send(Cn.signTypedMessage,{typedData:e})).data}async send({txs:e,params:r}){if(!e||!e.length)throw new Error("No transactions were passed");const n={txs:e,params:r};return(await this.communicator.send(Cn.sendTransactions,n)).data}}const Yn={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"},Wc={defaultBlockParam:(t="latest")=>t,returnFullTxObjectParam:(t=!1)=>t,blockNumberToHex:t=>Number.isInteger(t)?`0x${t.toString(16)}`:t};class B9e{constructor(e){this.communicator=e,this.call=this.buildRequest({call:Yn.eth_call,formatters:[null,Wc.defaultBlockParam]}),this.getBalance=this.buildRequest({call:Yn.eth_getBalance,formatters:[null,Wc.defaultBlockParam]}),this.getCode=this.buildRequest({call:Yn.eth_getCode,formatters:[null,Wc.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:Yn.eth_getStorageAt,formatters:[null,Wc.blockNumberToHex,Wc.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:Yn.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:Yn.eth_getBlockByHash,formatters:[null,Wc.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:Yn.eth_getBlockByNumber,formatters:[Wc.blockNumberToHex,Wc.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:Yn.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:Yn.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:Yn.eth_getTransactionCount,formatters:[null,Wc.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:Yn.eth_gasPrice}),this.getEstimateGas=r=>this.buildRequest({call:Yn.eth_estimateGas})([r]),this.setSafeSettings=this.buildRequest({call:Yn.safe_setSettings})}buildRequest(e){const{call:r,formatters:n}=e;return async i=>{n&&Array.isArray(i)&&n.forEach((a,c)=>{a&&(i[c]=a(i[c]))});const s={call:r,params:i||[]};return(await this.communicator.send(Cn.rpcCall,s)).data}}}const D9e="0x1626ba7e",M9e="0x20c13b0b",f9=4001;class ov extends Error{constructor(e,r,n){super(e),this.code=r,this.data=n,Object.setPrototypeOf(this,ov.prototype)}}class nee{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(Cn.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new ov("Permissions request is invalid",f9);try{return(await this.communicator.send(Cn.wallet_requestPermissions,e)).data}catch{throw new ov("Permissions rejected",f9)}}isPermissionRequestValid(e){return e.every(r=>typeof r=="object"?Object.keys(r).every(n=>!!Object.values(R6).includes(n)):!1)}}const hW=(t,e)=>e.some(r=>r.parentCapability===t),L9e=()=>(t,e,r)=>{const n=r.value;return r.value=async function(){const i=new nee(this.communicator);let s=await i.getPermissions();if(hW(e,s)||(s=await i.requestPermissions([{[e]:{}}])),!hW(e,s))throw new ov("Permissions rejected",f9);return n.apply(this)},r};var U9e=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s};class iee{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(Cn.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(Cn.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e="usd"}={}){return(await this.communicator.send(Cn.getSafeBalances,{currency:e})).data}async check1271Signature(e,r="0x"){const n=await this.getInfo(),i=ek({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,r]}),s={call:Yn.eth_call,params:[{to:n.safeAddress,data:i},"latest"]};try{return(await this.communicator.send(Cn.rpcCall,s)).data.slice(0,10).toLowerCase()===D9e}catch{return!1}}async check1271SignatureBytes(e,r="0x"){const n=await this.getInfo(),i=ek({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,r]}),s={call:Yn.eth_call,params:[{to:n.safeAddress,data:i},"latest"]};try{return(await this.communicator.send(Cn.rpcCall,s)).data.slice(0,10).toLowerCase()===M9e}catch{return!1}}calculateMessageHash(e){return Pie(e)}calculateTypedMessageHash(e){const r=typeof e.domain.chainId=="object"?e.domain.chainId.toNumber():Number(e.domain.chainId);let n=e.primaryType;if(!n){const i=Object.values(e.types),s=Object.keys(e.types).filter(o=>i.every(a=>a.every(({type:c})=>c.replace("[","").replace("]","")!==o)));if(s.length===0||s.length>1)throw new Error("Please specify primaryType");n=s[0]}return vie({message:e.message,domain:{...e.domain,chainId:r,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt},types:e.types,primaryType:n})}async getOffChainSignature(e){return(await this.communicator.send(Cn.getOffChainSignature,e)).data}async isMessageSigned(e,r="0x"){let n;if(typeof e=="string"&&(n=async()=>{const i=this.calculateMessageHash(e);return await this.isMessageHashSigned(i,r)}),lR(e)&&(n=async()=>{const i=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(i,r)}),n)return await n();throw new Error("Invalid message type")}async isMessageHashSigned(e,r="0x"){const n=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const i of n)if(await i(e,r))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(Cn.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(Cn.requestAddressBook,void 0)).data}}U9e([L9e()],iee.prototype,"requestAddressBook",null);class F9e{constructor(e={}){const{allowedDomains:r=null,debug:n=!1}=e;this.communicator=new $9e(r,n),this.eth=new B9e(this.communicator),this.txs=new j9e(this.communicator),this.safe=new iee(this.communicator),this.wallet=new nee(this.communicator)}}const H9e=Object.freeze(Object.defineProperty({__proto__:null,MessageFormatter:M2,get Methods(){return Cn},RPC_CALLS:Yn,get RestrictedMethods(){return R6},default:F9e,getSDKVersion:ree,isObjectEIP712TypedData:lR},Symbol.toStringTag,{value:"Module"}));class ac{constructor(e,r){this.scope=e,this.module=r}storeObject(e,r){this.setItem(e,JSON.stringify(r))}loadObject(e){const r=this.getItem(e);return r?JSON.parse(r):void 0}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(e)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new ac("CBWSDK").clear(),new ac("walletlink").clear()}}const Wr={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},p9={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}},see="Unspecified error message.",q9e="Unspecified server error.";function dR(t,e=see){if(t&&Number.isInteger(t)){const r=t.toString();if(g9(p9,r))return p9[r].message;if(oee(t))return q9e}return e}function z9e(t){if(!Number.isInteger(t))return!1;const e=t.toString();return!!(p9[e]||oee(t))}function W9e(t,{shouldIncludeStack:e=!1}={}){const r={};if(t&&typeof t=="object"&&!Array.isArray(t)&&g9(t,"code")&&z9e(t.code)){const n=t;r.code=n.code,n.message&&typeof n.message=="string"?(r.message=n.message,g9(n,"data")&&(r.data=n.data)):(r.message=dR(r.code),r.data={originalError:fW(t)})}else r.code=Wr.rpc.internal,r.message=pW(t,"message")?t.message:see,r.data={originalError:fW(t)};return e&&(r.stack=pW(t,"stack")?t.stack:void 0),r}function oee(t){return t>=-32099&&t<=-32e3}function fW(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function g9(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function pW(t,e){return typeof t=="object"&&t!==null&&e in t&&typeof t[e]=="string"}const Mt={rpc:{parse:t=>Ws(Wr.rpc.parse,t),invalidRequest:t=>Ws(Wr.rpc.invalidRequest,t),invalidParams:t=>Ws(Wr.rpc.invalidParams,t),methodNotFound:t=>Ws(Wr.rpc.methodNotFound,t),internal:t=>Ws(Wr.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ws(e,t)},invalidInput:t=>Ws(Wr.rpc.invalidInput,t),resourceNotFound:t=>Ws(Wr.rpc.resourceNotFound,t),resourceUnavailable:t=>Ws(Wr.rpc.resourceUnavailable,t),transactionRejected:t=>Ws(Wr.rpc.transactionRejected,t),methodNotSupported:t=>Ws(Wr.rpc.methodNotSupported,t),limitExceeded:t=>Ws(Wr.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>j0(Wr.provider.userRejectedRequest,t),unauthorized:t=>j0(Wr.provider.unauthorized,t),unsupportedMethod:t=>j0(Wr.provider.unsupportedMethod,t),disconnected:t=>j0(Wr.provider.disconnected,t),chainDisconnected:t=>j0(Wr.provider.chainDisconnected,t),unsupportedChain:t=>j0(Wr.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new uee(e,r,n)}}};function Ws(t,e){const[r,n]=aee(e);return new cee(t,r||dR(t),n)}function j0(t,e){const[r,n]=aee(e);return new uee(t,r||dR(t),n)}function aee(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}class cee extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}}class uee extends cee{constructor(e,r,n){if(!V9e(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}function V9e(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function hR(){return t=>t}const av=hR(),G9e=hR(),K9e=hR();function eu(t){return Math.floor(t)}const lee=/^[0-9]*$/,dee=/^[a-f0-9]*$/;function Wh(t){return fR(crypto.getRandomValues(new Uint8Array(t)))}function fR(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}function hC(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function Cb(t,e=!1){const r=t.toString("hex");return av(e?`0x${r}`:r)}function DT(t){return Cb(m9(t),!0)}function xa(t){return K9e(t.toString(10))}function od(t){return av(`0x${BigInt(t).toString(16)}`)}function hee(t){return t.startsWith("0x")||t.startsWith("0X")}function pR(t){return hee(t)?t.slice(2):t}function fee(t){return hee(t)?`0x${t.slice(2)}`:`0x${t}`}function xx(t){if(typeof t!="string")return!1;const e=pR(t).toLowerCase();return dee.test(e)}function Z9e(t,e=!1){if(typeof t=="string"){const r=pR(t).toLowerCase();if(dee.test(r))return av(e?`0x${r}`:r)}throw Mt.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}function gR(t,e=!1){let r=Z9e(t,!1);return r.length%2===1&&(r=av(`0${r}`)),e?av(`0x${r}`):r}function kl(t){if(typeof t=="string"){const e=pR(t).toLowerCase();if(xx(e)&&e.length===40)return G9e(fee(e))}throw Mt.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}function m9(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(xx(t)){const e=gR(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw Mt.rpc.invalidParams(`Not binary data: ${String(t)}`)}function Ab(t){if(typeof t=="number"&&Number.isInteger(t))return eu(t);if(typeof t=="string"){if(lee.test(t))return eu(Number(t));if(xx(t))return eu(Number(BigInt(gR(t,!0))))}throw Mt.rpc.invalidParams(`Not an integer: ${String(t)}`)}function Xw(t){if(t!==null&&(typeof t=="bigint"||J9e(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(Ab(t));if(typeof t=="string"){if(lee.test(t))return BigInt(t);if(xx(t))return BigInt(gR(t,!0))}throw Mt.rpc.invalidParams(`Not an integer: ${String(t)}`)}function Y9e(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Mt.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}function J9e(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}async function Q9e(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function X9e(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function e7e(t,e){const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.encrypt({name:"AES-GCM",iv:r},t,new TextEncoder().encode(e));return{iv:r,cipherText:n}}async function t7e(t,{iv:e,cipherText:r}){const n=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,r);return new TextDecoder().decode(n)}function pee(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function gee(t,e){const r=pee(t),n=await crypto.subtle.exportKey(r,e);return fR(new Uint8Array(n))}async function mee(t,e){const r=pee(t),n=hC(e).buffer;return await crypto.subtle.importKey(r,new Uint8Array(n),{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}async function r7e(t,e){const r=JSON.stringify(t,(n,i)=>{if(!(i instanceof Error))return i;const s=i;return Object.assign(Object.assign({},s.code?{code:s.code}:{}),{message:s.message})});return e7e(e,r)}async function n7e(t,e){return JSON.parse(await t7e(e,t))}const MT={storageKey:"ownPrivateKey",keyType:"private"},LT={storageKey:"ownPublicKey",keyType:"public"},UT={storageKey:"peerPublicKey",keyType:"public"};class i7e{constructor(){this.storage=new ac("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(UT,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(LT.storageKey),this.storage.removeItem(MT.storageKey),this.storage.removeItem(UT.storageKey)}async generateKeyPair(){const e=await Q9e();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(MT,e.privateKey),await this.storeKey(LT,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(MT)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(LT)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(UT)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await X9e(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const r=this.storage.getItem(e.storageKey);return r?mee(e.keyType,r):null}async storeKey(e,r){const n=await gee(e.keyType,r);this.storage.setItem(e.storageKey,n)}}const L2="4.3.0",wee="@coinbase/wallet-sdk";async function mR(t,e){const r=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()}),n=await window.fetch(e,{method:"POST",body:JSON.stringify(r),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":L2,"X-Cbw-Sdk-Platform":wee}}),{result:i,error:s}=await n.json();if(s)throw s;return i}function s7e(){return globalThis.coinbaseWalletExtension}function o7e(){var t,e;try{const r=globalThis;return(t=r.ethereum)!==null&&t!==void 0?t:(e=r.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function a7e({metadata:t,preference:e}){var r,n;const{appName:i,appLogoUrl:s,appChainIds:o}=t;if(e.options!=="smartWalletOnly"){const c=s7e();if(c)return(r=c.setAppInfo)===null||r===void 0||r.call(c,i,s,o,e),c}const a=o7e();if(a!=null&&a.isCoinbaseBrowser)return(n=a.setAppInfo)===null||n===void 0||n.call(a,i,s,o,e),a}function c7e(t){if(!t||typeof t!="object"||Array.isArray(t))throw Mt.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:r}=t;if(typeof e!="string"||e.length===0)throw Mt.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))throw Mt.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t});switch(e){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw Mt.provider.unsupportedMethod()}}const gW="accounts",mW="activeChain",wW="availableChains",bW="walletCapabilities";class u7e{constructor(e){var r,n,i;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new i7e,this.storage=new ac("CBWSDK","SCWStateManager"),this.accounts=(r=this.storage.loadObject(gW))!==null&&r!==void 0?r:[],this.chain=this.storage.loadObject(mW)||{id:(i=(n=e.metadata.appChainIds)===null||n===void 0?void 0:n[0])!==null&&i!==void 0?i:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var r,n,i,s;await((n=(r=this.communicator).waitForPopupLoaded)===null||n===void 0?void 0:n.call(r));const o=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,(i=e.params)!==null&&i!==void 0?i:{})}}),a=await this.communicator.postRequestAndWaitForResponse(o);if("failure"in a.content)throw a.content.failure;const c=await mee("public",a.sender);await this.keyManager.setPeerPublicKey(c);const l=(await this.decryptResponseMessage(a)).result;if("error"in l)throw l.error;switch(e.method){case"eth_requestAccounts":{const d=l.value;this.accounts=d,this.storage.storeObject(gW,d),(s=this.callback)===null||s===void 0||s.call(this,"accountsChanged",d);break}}}async request(e){var r;if(this.accounts.length===0)switch(e.method){case"wallet_sendCalls":return this.sendRequestToPopup(e);default:throw Mt.provider.unauthorized()}switch(e.method){case"eth_requestAccounts":return(r=this.callback)===null||r===void 0||r.call(this,"connect",{chainId:od(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return od(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(bW);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"wallet_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw Mt.rpc.internal("No RPC URL set for chain");return mR(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var r,n;await((n=(r=this.communicator).waitForPopupLoaded)===null||n===void 0?void 0:n.call(r));const i=await this.sendEncryptedRequest(e),o=(await this.decryptResponseMessage(i)).result;if("error"in o)throw o.error;return o.value}async cleanup(){var e,r;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:(r=(e=this.metadata.appChainIds)===null||e===void 0?void 0:e[0])!==null&&r!==void 0?r:1}}async handleSwitchChainRequest(e){var r;const n=e.params;if(!n||!(!((r=n[0])===null||r===void 0)&&r.chainId))throw Mt.rpc.invalidParams();const i=Ab(n[0].chainId);if(this.updateChain(i))return null;const o=await this.sendRequestToPopup(e);return o===null&&this.updateChain(i),o}async sendEncryptedRequest(e){const r=await this.keyManager.getSharedSecret();if(!r)throw Mt.provider.unauthorized("No valid session found, try requestAccounts before other methods");const n=await r7e({action:e,chainId:this.chain.id},r),i=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(i)}async createRequestMessage(e){const r=await gee("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:r,content:e,timestamp:new Date}}async decryptResponseMessage(e){var r,n;const i=e.content;if("failure"in i)throw i.failure;const s=await this.keyManager.getSharedSecret();if(!s)throw Mt.provider.unauthorized("Invalid session");const o=await n7e(i.encrypted,s),a=(r=o.data)===null||r===void 0?void 0:r.chains;if(a){const u=Object.entries(a).map(([l,d])=>({id:Number(l),rpcUrl:d}));this.storage.storeObject(wW,u),this.updateChain(this.chain.id,u)}const c=(n=o.data)===null||n===void 0?void 0:n.capabilities;return c&&this.storage.storeObject(bW,c),o}updateChain(e,r){var n;const i=r??this.storage.loadObject(wW),s=i==null?void 0:i.find(o=>o.id===e);return s?(s!==this.chain&&(this.chain=s,this.storage.storeObject(mW,s),(n=this.callback)===null||n===void 0||n.call(this,"chainChanged",od(s.id))),!0):!1}}var FT,yW;function bee(){if(yW)return FT;yW=1;const{keccak_256:t}=fO();function e(f){return Buffer.allocUnsafe(f).fill(0)}function r(f){return f.toString(2).length}function n(f,g){let p=f.toString(16);p.length%2!==0&&(p="0"+p);const m=p.match(/.{1,2}/g).map(b=>parseInt(b,16));for(;m.length<g;)m.unshift(0);return Buffer.from(m)}function i(f,g){const p=f<0n;let m;if(p){const b=(1n<<BigInt(g))-1n;m=(~f&b)+1n}else m=f;return m&=(1n<<BigInt(g))-1n,m}function s(f,g,p){const m=e(g);return f=a(f),p?f.length<g?(f.copy(m),m):f.slice(0,g):f.length<g?(f.copy(m,g-f.length),m):f.slice(-g)}function o(f,g){return s(f,g,!0)}function a(f){if(!Buffer.isBuffer(f))if(Array.isArray(f))f=Buffer.from(f);else if(typeof f=="string")d(f)?f=Buffer.from(l(h(f)),"hex"):f=Buffer.from(f);else if(typeof f=="number")f=intToBuffer(f);else if(f==null)f=Buffer.allocUnsafe(0);else if(typeof f=="bigint")f=n(f);else if(f.toArray)f=Buffer.from(f.toArray());else throw new Error("invalid type");return f}function c(f){return f=a(f),"0x"+f.toString("hex")}function u(f,g){if(f=a(f),g||(g=256),g!==256)throw new Error("unsupported");return Buffer.from(t(new Uint8Array(f)))}function l(f){return f.length%2?"0"+f:f}function d(f){return typeof f=="string"&&f.match(/^0x[0-9A-Fa-f]*$/)}function h(f){return typeof f=="string"&&f.startsWith("0x")?f.slice(2):f}return FT={zeros:e,setLength:s,setLengthRight:o,isHexString:d,stripHexPrefix:h,toBuffer:a,bufferToHex:c,keccak:u,bitLengthFromBigInt:r,bufferBEFromBigInt:n,twosFromBigInt:i},FT}var HT,vW;function l7e(){if(vW)return HT;vW=1;const t=bee();function e(h){return h.startsWith("int[")?"int256"+h.slice(3):h==="int"?"int256":h.startsWith("uint[")?"uint256"+h.slice(4):h==="uint"?"uint256":h.startsWith("fixed[")?"fixed128x128"+h.slice(5):h==="fixed"?"fixed128x128":h.startsWith("ufixed[")?"ufixed128x128"+h.slice(6):h==="ufixed"?"ufixed128x128":h}function r(h){return Number.parseInt(/^\D+(\d+)$/.exec(h)[1],10)}function n(h){var f=/^\D+(\d+)x(\d+)$/.exec(h);return[Number.parseInt(f[1],10),Number.parseInt(f[2],10)]}function i(h){var f=h.match(/(.*)\[(.*?)\]$/);return f?f[2]===""?"dynamic":Number.parseInt(f[2],10):null}function s(h){var f=typeof h;if(f==="string"||f==="number")return BigInt(h);if(f==="bigint")return h;throw new Error("Argument is not a number")}function o(h,f){var g,p,m,b;if(h==="address")return o("uint160",s(f));if(h==="bool")return o("uint8",f?1:0);if(h==="string")return o("bytes",new Buffer(f,"utf8"));if(c(h)){if(typeof f.length>"u")throw new Error("Not an array?");if(g=i(h),g!=="dynamic"&&g!==0&&f.length>g)throw new Error("Elements exceed array size: "+g);m=[],h=h.slice(0,h.lastIndexOf("[")),typeof f=="string"&&(f=JSON.parse(f));for(b in f)m.push(o(h,f[b]));if(g==="dynamic"){var v=o("uint256",f.length);m.unshift(v)}return Buffer.concat(m)}else{if(h==="bytes")return f=new Buffer(f),m=Buffer.concat([o("uint256",f.length),f]),f.length%32!==0&&(m=Buffer.concat([m,t.zeros(32-f.length%32)])),m;if(h.startsWith("bytes")){if(g=r(h),g<1||g>32)throw new Error("Invalid bytes<N> width: "+g);return t.setLengthRight(f,32)}else if(h.startsWith("uint")){if(g=r(h),g%8||g<8||g>256)throw new Error("Invalid uint<N> width: "+g);p=s(f);const E=t.bitLengthFromBigInt(p);if(E>g)throw new Error("Supplied uint exceeds width: "+g+" vs "+E);if(p<0)throw new Error("Supplied uint is negative");return t.bufferBEFromBigInt(p,32)}else if(h.startsWith("int")){if(g=r(h),g%8||g<8||g>256)throw new Error("Invalid int<N> width: "+g);p=s(f);const E=t.bitLengthFromBigInt(p);if(E>g)throw new Error("Supplied int exceeds width: "+g+" vs "+E);const w=t.twosFromBigInt(p,256);return t.bufferBEFromBigInt(w,32)}else if(h.startsWith("ufixed")){if(g=n(h),p=s(f),p<0)throw new Error("Supplied ufixed is negative");return o("uint256",p*BigInt(2)**BigInt(g[1]))}else if(h.startsWith("fixed"))return g=n(h),o("int256",s(f)*BigInt(2)**BigInt(g[1]))}throw new Error("Unsupported or invalid type: "+h)}function a(h){return h==="string"||h==="bytes"||i(h)==="dynamic"}function c(h){return h.lastIndexOf("]")===h.length-1}function u(h,f){var g=[],p=[],m=32*h.length;for(var b in h){var v=e(h[b]),E=f[b],w=o(v,E);a(v)?(g.push(o("uint256",m)),p.push(w),m+=w.length):g.push(w)}return Buffer.concat(g.concat(p))}function l(h,f){if(h.length!==f.length)throw new Error("Number of types are not matching the values");for(var g,p,m=[],b=0;b<h.length;b++){var v=e(h[b]),E=f[b];if(v==="bytes")m.push(E);else if(v==="string")m.push(new Buffer(E,"utf8"));else if(v==="bool")m.push(new Buffer(E?"01":"00","hex"));else if(v==="address")m.push(t.setLength(E,20));else if(v.startsWith("bytes")){if(g=r(v),g<1||g>32)throw new Error("Invalid bytes<N> width: "+g);m.push(t.setLengthRight(E,g))}else if(v.startsWith("uint")){if(g=r(v),g%8||g<8||g>256)throw new Error("Invalid uint<N> width: "+g);p=s(E);const w=t.bitLengthFromBigInt(p);if(w>g)throw new Error("Supplied uint exceeds width: "+g+" vs "+w);m.push(t.bufferBEFromBigInt(p,g/8))}else if(v.startsWith("int")){if(g=r(v),g%8||g<8||g>256)throw new Error("Invalid int<N> width: "+g);p=s(E);const w=t.bitLengthFromBigInt(p);if(w>g)throw new Error("Supplied int exceeds width: "+g+" vs "+w);const C=t.twosFromBigInt(p,g);m.push(t.bufferBEFromBigInt(C,g/8))}else throw new Error("Unsupported or invalid type: "+v)}return Buffer.concat(m)}function d(h,f){return t.keccak(l(h,f))}return HT={rawEncode:u,solidityPack:l,soliditySHA3:d},HT}var qT,_W;function d7e(){if(_W)return qT;_W=1;const t=bee(),e=l7e(),r={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},n={encodeData(s,o,a,c=!0){const u=["bytes32"],l=[this.hashType(s,a)];if(c){const d=(h,f,g)=>{if(a[f]!==void 0)return["bytes32",g==null?"0x0000000000000000000000000000000000000000000000000000000000000000":t.keccak(this.encodeData(f,g,a,c))];if(g===void 0)throw new Error(`missing value for field ${h} of type ${f}`);if(f==="bytes")return["bytes32",t.keccak(g)];if(f==="string")return typeof g=="string"&&(g=Buffer.from(g,"utf8")),["bytes32",t.keccak(g)];if(f.lastIndexOf("]")===f.length-1){const p=f.slice(0,f.lastIndexOf("[")),m=g.map(b=>d(h,p,b));return["bytes32",t.keccak(e.rawEncode(m.map(([b])=>b),m.map(([,b])=>b)))]}return[f,g]};for(const h of a[s]){const[f,g]=d(h.name,h.type,o[h.name]);u.push(f),l.push(g)}}else for(const d of a[s]){let h=o[d.name];if(h!==void 0)if(d.type==="bytes")u.push("bytes32"),h=t.keccak(h),l.push(h);else if(d.type==="string")u.push("bytes32"),typeof h=="string"&&(h=Buffer.from(h,"utf8")),h=t.keccak(h),l.push(h);else if(a[d.type]!==void 0)u.push("bytes32"),h=t.keccak(this.encodeData(d.type,h,a,c)),l.push(h);else{if(d.type.lastIndexOf("]")===d.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");u.push(d.type),l.push(h)}}return e.rawEncode(u,l)},encodeType(s,o){let a="",c=this.findTypeDependencies(s,o).filter(u=>u!==s);c=[s].concat(c.sort());for(const u of c){if(!o[u])throw new Error("No type definition specified: "+u);a+=u+"("+o[u].map(({name:d,type:h})=>h+" "+d).join(",")+")"}return a},findTypeDependencies(s,o,a=[]){if(s=s.match(/^\w*/)[0],a.includes(s)||o[s]===void 0)return a;a.push(s);for(const c of o[s])for(const u of this.findTypeDependencies(c.type,o,a))!a.includes(u)&&a.push(u);return a},hashStruct(s,o,a,c=!0){return t.keccak(this.encodeData(s,o,a,c))},hashType(s,o){return t.keccak(this.encodeType(s,o))},sanitizeData(s){const o={};for(const a in r.properties)s[a]&&(o[a]=s[a]);return o.types&&(o.types=Object.assign({EIP712Domain:[]},o.types)),o},hash(s,o=!0){const a=this.sanitizeData(s),c=[Buffer.from("1901","hex")];return c.push(this.hashStruct("EIP712Domain",a.domain,a.types,o)),a.primaryType!=="EIP712Domain"&&c.push(this.hashStruct(a.primaryType,a.message,a.types,o)),t.keccak(Buffer.concat(c))}};qT={TYPED_MESSAGE_SCHEMA:r,TypedDataUtils:n,hashForSignTypedDataLegacy:function(s){return i(s.data)},hashForSignTypedData_v3:function(s){return n.hash(s.data,!1)},hashForSignTypedData_v4:function(s){return n.hash(s.data)}};function i(s){const o=new Error("Expect argument to be non-empty array");if(typeof s!="object"||!s.length)throw o;const a=s.map(function(l){return l.type==="bytes"?t.toBuffer(l.value):l.value}),c=s.map(function(l){return l.type}),u=s.map(function(l){if(!l.name)throw o;return l.type+" "+l.name});return e.soliditySHA3(["bytes32","bytes32"],[e.soliditySHA3(new Array(s.length).fill("string"),u),e.soliditySHA3(c,a)])}return qT}var h7e=d7e();const L4=cc(h7e),f7e="walletUsername",w9="Addresses",p7e="AppVersion";function Mn(t){return t.errorMessage!==void 0}class g7e{constructor(e){this.secret=e}async encrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",hC(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(e)),a=16,c=o.slice(o.byteLength-a),u=o.slice(0,o.byteLength-a),l=new Uint8Array(c),d=new Uint8Array(u),h=new Uint8Array([...n,...l,...d]);return fR(h)}async decrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",hC(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=hC(e),a=o.slice(0,12),c=o.slice(12,28),u=o.slice(28),l=new Uint8Array([...u,...c]),d={name:"AES-GCM",iv:new Uint8Array(a)};try{const h=await window.crypto.subtle.decrypt(d,s,l),f=new TextDecoder;n(f.decode(h))}catch(h){i(h)}})()})}}class m7e{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var e;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(e=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}var yu;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(yu||(yu={}));class w7e{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,yu.CONNECTING),i.onclose=s=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,yu.DISCONNECTED)},i.onopen=s=>{var o;e(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,yu.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},i.onmessage=s=>{var o,a;if(s.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(s.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,c)}catch{}}})}disconnect(){var e;const{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,yu.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){const{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}const EW=1e4,b7e=6e4;class y7e{constructor({session:e,linkAPIUrl:r,listener:n}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=eu(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=s=>{if(!s)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",a=>s.JsonRpcUrl&&this.handleChainUpdated(a,s.JsonRpcUrl)]]).forEach((a,c)=>{const u=s[c];u!==void 0&&a(u)})},this.handleDestroyed=s=>{var o;s==="1"&&((o=this.listener)===null||o===void 0||o.resetAndReload())},this.handleAccountUpdated=async s=>{var o;const a=await this.cipher.decrypt(s);(o=this.listener)===null||o===void 0||o.accountUpdated(a)},this.handleMetadataUpdated=async(s,o)=>{var a;const c=await this.cipher.decrypt(o);(a=this.listener)===null||a===void 0||a.metadataUpdated(s,c)},this.handleWalletUsernameUpdated=async s=>{this.handleMetadataUpdated(f7e,s)},this.handleAppVersionUpdated=async s=>{this.handleMetadataUpdated(p7e,s)},this.handleChainUpdated=async(s,o)=>{var a;const c=await this.cipher.decrypt(s),u=await this.cipher.decrypt(o);(a=this.listener)===null||a===void 0||a.chainUpdated(c,u)},this.session=e,this.cipher=new g7e(e.secret),this.listener=n;const i=new w7e(`${r}/rpc`,WebSocket);i.setConnectionStateListener(async s=>{let o=!1;switch(s){case yu.DISCONNECTED:if(!this.destroyed){const a=async()=>{await new Promise(c=>setTimeout(c,5e3)),this.destroyed||i.connect().catch(()=>{a()})};a()}break;case yu.CONNECTED:o=await this.handleConnected(),this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},EW),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case yu.CONNECTING:break}this.connected!==o&&(this.connected=o)}),i.setIncomingDataListener(s=>{var o;switch(s.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const a=s.type==="IsLinkedOK"?s.linked:void 0;this.linked=a||s.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(s.metadata);break}case"Event":{this.handleIncomingEvent(s);break}}s.id!==void 0&&((o=this.requestResolutions.get(s.id))===null||o===void 0||o(s))}),this.ws=i,this.http=new m7e(r,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:eu(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.ws.disconnect(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r;if(e.type!=="Event"||e.event!=="Web3Response")return;const n=await this.cipher.decrypt(e.data),i=JSON.parse(n);if(i.type!=="WEB3_RESPONSE")return;const{id:s,response:o}=i;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s,o)}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async publishEvent(e,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,location:location.href,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:eu(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(s);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>EW*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r={timeout:b7e}){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((s,o)=>{i=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r.timeout)}),new Promise(s=>{this.requestResolutions.set(n,o=>{clearTimeout(i),s(o),this.requestResolutions.delete(n)})})])}async handleConnected(){return(await this.makeRequest({type:"HostSession",id:eu(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type==="Fail"?!1:(this.sendData({type:"IsLinked",id:eu(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:eu(this.nextReqId++),sessionId:this.session.id}),!0)}}class v7e{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=fee(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}const CW="session:id",AW="session:secret",xW="session:linked";class pg{constructor(e,r,n,i=!1){this.storage=e,this.id=r,this.secret=n,this.key=Fte(rre(`${r}, ${n} WalletLink`)),this._linked=!!i}static create(e){const r=Wh(16),n=Wh(32);return new pg(e,r,n).save()}static load(e){const r=e.getItem(CW),n=e.getItem(xW),i=e.getItem(AW);return r&&i?new pg(e,r,i,n==="1"):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(CW,this.id),this.storage.setItem(AW,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(xW,this._linked?"1":"0")}}function _7e(){try{return window.frameElement!==null}catch{return!1}}function E7e(){try{return _7e()&&window.top?window.top.location:window.location}catch{return window.location}}function C7e(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}function yee(){var t,e;return(e=(t=window==null?void 0:window.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}const A7e='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';function vee(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(A7e)),document.documentElement.appendChild(t)}function _ee(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=_ee(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function xb(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=_ee(t))&&(n&&(n+=" "),n+=e);return n}var Sx,kr,Eee,Vh,SW,Cee,Aee,xee,wR,b9,y9,cv={},See=[],x7e=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Tx=Array.isArray;function vu(t,e){for(var r in e)t[r]=e[r];return t}function bR(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function or(t,e,r){var n,i,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Sx.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return fC(t,o,n,i,null)}function fC(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Eee,__i:-1,__u:0};return i==null&&kr.vnode!=null&&kr.vnode(s),s}function Ix(t){return t.children}function pC(t,e){this.props=t,this.context=e}function Ym(t,e){if(e==null)return t.__?Ym(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Ym(t):null}function Tee(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return Tee(t)}}function TW(t){(!t.__d&&(t.__d=!0)&&Vh.push(t)&&!k6.__r++||SW!=kr.debounceRendering)&&((SW=kr.debounceRendering)||Cee)(k6)}function k6(){for(var t,e,r,n,i,s,o,a=1;Vh.length;)Vh.length>a&&Vh.sort(Aee),t=Vh.shift(),a=Vh.length,t.__d&&(r=void 0,i=(n=(e=t).__v).__e,s=[],o=[],e.__P&&((r=vu({},n)).__v=n.__v+1,kr.vnode&&kr.vnode(r),yR(e.__P,r,n,e.__n,e.__P.namespaceURI,32&n.__u?[i]:null,s,i??Ym(n),!!(32&n.__u),o),r.__v=n.__v,r.__.__k[r.__i]=r,Oee(s,r,o),r.__e!=i&&Tee(r)));k6.__r=0}function Iee(t,e,r,n,i,s,o,a,c,u,l){var d,h,f,g,p,m,b=n&&n.__k||See,v=e.length;for(c=S7e(r,e,b,c,v),d=0;d<v;d++)(f=r.__k[d])!=null&&(h=f.__i==-1?cv:b[f.__i]||cv,f.__i=d,m=yR(t,f,h,i,s,o,a,c,u,l),g=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&vR(h.ref,null,f),l.push(f.ref,f.__c||g,f)),p==null&&g!=null&&(p=g),4&f.__u||h.__k===f.__k?c=Pee(f,c,t):typeof f.type=="function"&&m!==void 0?c=m:g&&(c=g.nextSibling),f.__u&=-7);return r.__e=p,c}function S7e(t,e,r,n,i){var s,o,a,c,u,l=r.length,d=l,h=0;for(t.__k=new Array(i),s=0;s<i;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(c=s+h,(o=t.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?fC(null,o,null,null,null):Tx(o)?fC(Ix,{children:o},null,null,null):o.constructor==null&&o.__b>0?fC(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,a=null,(u=o.__i=T7e(o,r,c,d))!=-1&&(d--,(a=r[u])&&(a.__u|=2)),a==null||a.__v==null?(u==-1&&(i>l?h--:i<l&&h++),typeof o.type!="function"&&(o.__u|=4)):u!=c&&(u==c-1?h--:u==c+1?h++:(u>c?h--:h++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;s<l;s++)(a=r[s])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=Ym(a)),kee(a,a));return n}function Pee(t,e,r){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,e=Pee(n[i],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=Ym(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function T7e(t,e,r,n){var i,s,o=t.key,a=t.type,c=e[r];if(c===null&&t.key==null||c&&o==c.key&&a==c.type&&(2&c.__u)==0)return r;if(n>(c!=null&&(2&c.__u)==0?1:0))for(i=r-1,s=r+1;i>=0||s<e.length;){if(i>=0){if((c=e[i])&&(2&c.__u)==0&&o==c.key&&a==c.type)return i;i--}if(s<e.length){if((c=e[s])&&(2&c.__u)==0&&o==c.key&&a==c.type)return s;s++}}return-1}function IW(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||x7e.test(e)?r:r+"px"}function U4(t,e,r,n,i){var s,o;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||IW(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||IW(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(xee,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?n?r.u=n.u:(r.u=wR,t.addEventListener(e,s?y9:b9,s)):t.removeEventListener(e,s?y9:b9,s);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function PW(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=wR++;else if(e.t<r.u)return;return r(kr.event?kr.event(e):e)}}}function yR(t,e,r,n,i,s,o,a,c,u){var l,d,h,f,g,p,m,b,v,E,w,C,y,_,x,A,T,O=e.type;if(e.constructor!=null)return null;128&r.__u&&(c=!!(32&r.__u),s=[a=e.__e=r.__e]),(l=kr.__b)&&l(e);e:if(typeof O=="function")try{if(b=e.props,v="prototype"in O&&O.prototype.render,E=(l=O.contextType)&&n[l.__c],w=l?E?E.props.value:l.__:n,r.__c?m=(d=e.__c=r.__c).__=d.__E:(v?e.__c=d=new O(b,w):(e.__c=d=new pC(b,w),d.constructor=O,d.render=P7e),E&&E.sub(d),d.props=b,d.state||(d.state={}),d.context=w,d.__n=n,h=d.__d=!0,d.__h=[],d._sb=[]),v&&d.__s==null&&(d.__s=d.state),v&&O.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=vu({},d.__s)),vu(d.__s,O.getDerivedStateFromProps(b,d.__s))),f=d.props,g=d.state,d.__v=e,h)v&&O.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),v&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(v&&O.getDerivedStateFromProps==null&&b!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(b,w),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(b,d.__s,w)===!1||e.__v==r.__v){for(e.__v!=r.__v&&(d.props=b,d.state=d.__s,d.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(k){k&&(k.__=e)}),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[],d.__h.length&&o.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(b,d.__s,w),v&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,g,p)})}if(d.context=w,d.props=b,d.__P=t,d.__e=!1,y=kr.__r,_=0,v){for(d.state=d.__s,d.__d=!1,y&&y(e),l=d.render(d.props,d.state,d.context),x=0;x<d._sb.length;x++)d.__h.push(d._sb[x]);d._sb=[]}else do d.__d=!1,y&&y(e),l=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++_<25);d.state=d.__s,d.getChildContext!=null&&(n=vu(vu({},n),d.getChildContext())),v&&!h&&d.getSnapshotBeforeUpdate!=null&&(p=d.getSnapshotBeforeUpdate(f,g)),A=l,l!=null&&l.type===Ix&&l.key==null&&(A=Ree(l.props.children)),a=Iee(t,Tx(A)?A:[A],e,r,n,i,s,o,a,c,u),d.base=e.__e,e.__u&=-161,d.__h.length&&o.push(d),m&&(d.__E=d.__=null)}catch(k){if(e.__v=null,c||s!=null)if(k.then){for(e.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else for(T=s.length;T--;)bR(s[T]);else e.__e=r.__e,e.__k=r.__k;kr.__e(k,e,r)}else s==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=I7e(r.__e,e,r,n,i,s,o,c,u);return(l=kr.diffed)&&l(e),128&e.__u?void 0:a}function Oee(t,e,r){for(var n=0;n<r.length;n++)vR(r[n],r[++n],r[++n]);kr.__c&&kr.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){kr.__e(s,i.__v)}})}function Ree(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:Tx(t)?t.map(Ree):vu({},t)}function I7e(t,e,r,n,i,s,o,a,c){var u,l,d,h,f,g,p,m=r.props,b=e.props,v=e.type;if(v=="svg"?i="http://www.w3.org/2000/svg":v=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(u=0;u<s.length;u++)if((f=s[u])&&"setAttribute"in f==!!v&&(v?f.localName==v:f.nodeType==3)){t=f,s[u]=null;break}}if(t==null){if(v==null)return document.createTextNode(b);t=document.createElementNS(i,v,b.is&&b),a&&(kr.__m&&kr.__m(e,s),a=!1),s=null}if(v==null)m===b||a&&t.data==b||(t.data=b);else{if(s=s&&Sx.call(t.childNodes),m=r.props||cv,!a&&s!=null)for(m={},u=0;u<t.attributes.length;u++)m[(f=t.attributes[u]).name]=f.value;for(u in m)if(f=m[u],u!="children"){if(u=="dangerouslySetInnerHTML")d=f;else if(!(u in b)){if(u=="value"&&"defaultValue"in b||u=="checked"&&"defaultChecked"in b)continue;U4(t,u,null,f,i)}}for(u in b)f=b[u],u=="children"?h=f:u=="dangerouslySetInnerHTML"?l=f:u=="value"?g=f:u=="checked"?p=f:a&&typeof f!="function"||m[u]===f||U4(t,u,f,m[u],i);if(l)a||d&&(l.__html==d.__html||l.__html==t.innerHTML)||(t.innerHTML=l.__html),e.__k=[];else if(d&&(t.innerHTML=""),Iee(e.type=="template"?t.content:t,Tx(h)?h:[h],e,r,n,v=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,o,s?s[0]:r.__k&&Ym(r,0),a,c),s!=null)for(u=s.length;u--;)bR(s[u]);a||(u="value",v=="progress"&&g==null?t.removeAttribute("value"):g!=null&&(g!==t[u]||v=="progress"&&!g||v=="option"&&g!=m[u])&&U4(t,u,g,m[u],i),u="checked",p!=null&&p!=t[u]&&U4(t,u,p,m[u],i))}return t}function vR(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(i){kr.__e(i,r)}}function kee(t,e,r){var n,i;if(kr.unmount&&kr.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||vR(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){kr.__e(s,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&kee(n[i],e,r||typeof t.type!="function");r||bR(t.__e),t.__c=t.__=t.__e=void 0}function P7e(t,e,r){return this.constructor(t,r)}function v9(t,e,r){var n,i,s,o;e==document&&(e=document.documentElement),kr.__&&kr.__(t,e),i=(n=!1)?null:e.__k,s=[],o=[],yR(e,t=e.__k=or(Ix,null,[t]),i||cv,cv,e.namespaceURI,i?null:e.firstChild?Sx.call(e.childNodes):null,s,i?i.__e:e.firstChild,n,o),Oee(s,t,o)}Sx=See.slice,kr={__e:function(t,e,r,n){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},Eee=0,pC.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=vu({},this.state),typeof t=="function"&&(t=t(vu({},r),this.props)),t&&vu(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),TW(this))},pC.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),TW(this))},pC.prototype.render=Ix,Vh=[],Cee=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Aee=function(t,e){return t.__v.__b-e.__v.__b},k6.__r=0,xee=/(PointerCapture)$|Capture$/i,wR=0,b9=PW(!1),y9=PW(!0);var N6,Gr,zT,OW,_9=0,Nee=[],an=kr,RW=an.__b,kW=an.__r,NW=an.diffed,$W=an.__c,jW=an.unmount,BW=an.__;function $ee(t,e){an.__h&&an.__h(Gr,t,_9||e),_9=0;var r=Gr.__H||(Gr.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function DW(t){return _9=1,O7e(jee,t)}function O7e(t,e,r){var n=$ee(N6++,2);if(n.t=t,!n.__c&&(n.__=[jee(void 0,e),function(a){var c=n.__N?n.__N[0]:n.__[0],u=n.t(c,a);c!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=Gr,!Gr.__f)){var i=function(a,c,u){if(!n.__c.__H)return!0;var l=n.__c.__H.__.filter(function(h){return!!h.__c});if(l.every(function(h){return!h.__N}))return!s||s.call(this,a,c,u);var d=n.__c.props!==a;return l.forEach(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(d=!0)}}),s&&s.call(this,a,c,u)||d};Gr.__f=!0;var s=Gr.shouldComponentUpdate,o=Gr.componentWillUpdate;Gr.componentWillUpdate=function(a,c,u){if(this.__e){var l=s;s=void 0,i(a,c,u),s=l}o&&o.call(this,a,c,u)},Gr.shouldComponentUpdate=i}return n.__N||n.__}function R7e(t,e){var r=$ee(N6++,3);!an.__s&&$7e(r.__H,e)&&(r.__=t,r.u=e,Gr.__H.__h.push(r))}function k7e(){for(var t;t=Nee.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(gC),t.__H.__h.forEach(E9),t.__H.__h=[]}catch(e){t.__H.__h=[],an.__e(e,t.__v)}}an.__b=function(t){Gr=null,RW&&RW(t)},an.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),BW&&BW(t,e)},an.__r=function(t){kW&&kW(t),N6=0;var e=(Gr=t.__c).__H;e&&(zT===Gr?(e.__h=[],Gr.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.forEach(gC),e.__h.forEach(E9),e.__h=[],N6=0)),zT=Gr},an.diffed=function(t){NW&&NW(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Nee.push(e)!==1&&OW===an.requestAnimationFrame||((OW=an.requestAnimationFrame)||N7e)(k7e)),e.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),zT=Gr=null},an.__c=function(t,e){e.some(function(r){try{r.__h.forEach(gC),r.__h=r.__h.filter(function(n){return!n.__||E9(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],an.__e(n,r.__v)}}),$W&&$W(t,e)},an.unmount=function(t){jW&&jW(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{gC(n)}catch(i){e=i}}),r.__H=void 0,e&&an.__e(e,r.__v))};var MW=typeof requestAnimationFrame=="function";function N7e(t){var e,r=function(){clearTimeout(n),MW&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);MW&&(e=requestAnimationFrame(r))}function gC(t){var e=Gr,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Gr=e}function E9(t){var e=Gr;t.__c=t.__(),Gr=e}function $7e(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function jee(t,e){return typeof e=="function"?e(t):e}const j7e=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}",B7e="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",D7e="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class M7e{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=yee()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const r=this.nextItemKey++;return this.items.set(r,e),this.render(),()=>{this.items.delete(r),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&v9(or("div",null,or(Bee,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,r])=>or(L7e,Object.assign({},r,{key:e}))))),this.root)}}const Bee=t=>or("div",{class:xb("-cbwsdk-snackbar-container")},or("style",null,j7e),or("div",{class:"-cbwsdk-snackbar"},t.children)),L7e=({autoExpand:t,message:e,menuItems:r})=>{const[n,i]=DW(!0),[s,o]=DW(t??!1);R7e(()=>{const c=[window.setTimeout(()=>{i(!1)},1),window.setTimeout(()=>{o(!0)},1e4)];return()=>{c.forEach(window.clearTimeout)}});const a=()=>{o(!s)};return or("div",{class:xb("-cbwsdk-snackbar-instance",n&&"-cbwsdk-snackbar-instance-hidden",s&&"-cbwsdk-snackbar-instance-expanded")},or("div",{class:"-cbwsdk-snackbar-instance-header",onClick:a},or("img",{src:B7e,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",or("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),or("div",{class:"-gear-container"},!s&&or("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},or("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),or("img",{src:D7e,class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&or("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map((c,u)=>or("div",{class:xb("-cbwsdk-snackbar-instance-menu-item",c.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:c.onClick,key:u},or("svg",{width:c.svgWidth,height:c.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},or("path",{"fill-rule":c.defaultFillRule,"clip-rule":c.defaultClipRule,d:c.path,fill:"#AAAAAA"})),or("span",{class:xb("-cbwsdk-snackbar-instance-menu-item-info",c.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},c.info)))))};class U7e{constructor(){this.attached=!1,this.snackbar=new M7e}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.snackbar.attach(r),this.attached=!0,vee()}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}}const F7e=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";class H7e{constructor(){this.root=null,this.darkMode=yee()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),vee()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&(v9(null,this.root),e&&v9(or(q7e,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}const q7e=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return or(Bee,{darkMode:r},or("div",{class:"-cbwsdk-redirect-dialog"},or("style",null,F7e),or("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),or("div",{class:xb("-cbwsdk-redirect-dialog-box",s)},or("p",null,t),or("button",{onClick:n},e))))},z7e="https://keys.coinbase.com/connect",W7e="http://rpc.wallet.coinbase.com",LW="https://www.walletlink.org",V7e="https://go.cb-w.com/walletlink";class UW{constructor(){this.attached=!1,this.redirectDialog=new H7e}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const r=new URL(V7e);r.searchParams.append("redirect_url",E7e().href),e&&r.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class tu{constructor(e){this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=C7e(),this.linkedUpdated=s=>{this.isLinked=s;const o=this.storage.getItem(w9);if(s&&(this._session.linked=s),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";a[0]!==""&&!s&&this._session.linked&&!c&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(s,o)=>{this.storage.setItem(s,o)},this.chainUpdated=(s,o)=>{this.chainCallbackParams.chainId===s&&this.chainCallbackParams.jsonRpcUrl===o||(this.chainCallbackParams={chainId:s,jsonRpcUrl:o},this.chainCallback&&this.chainCallback(o,Number.parseInt(s,10)))},this.accountUpdated=s=>{this.accountsCallback&&this.accountsCallback([s]),tu.accountRequestCallbackIds.size>0&&(Array.from(tu.accountRequestCallbackIds.values()).forEach(o=>{this.invokeCallback(o,{method:"requestEthereumAccounts",result:[s]})}),tu.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;const{session:r,ui:n,connection:i}=this.subscribe();this._session=r,this.connection=i,this.relayEventManager=new v7e,this.ui=n,this.ui.attach()}subscribe(){const e=pg.load(this.storage)||pg.create(this.storage),{linkAPIUrl:r}=this,n=new y7e({session:e,linkAPIUrl:r,listener:this}),i=this.isMobileWeb?new UW:new U7e;return n.connect(),{session:e,ui:i,connection:n}}resetAndReload(){this.connection.destroy().then(()=>{const e=pg.load(this.storage);(e==null?void 0:e.id)===this._session.id&&ac.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:xa(e.weiValue),data:Cb(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?xa(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?xa(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?xa(e.gasPriceInWei):null,gasLimit:e.gasLimit?xa(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:xa(e.weiValue),data:Cb(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?xa(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?xa(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?xa(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?xa(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:Cb(e,!0),chainId:r}})}getWalletLinkSession(){return this._session}sendRequest(e){let r=null;const n=Wh(8),i=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,s),r==null||r()};return new Promise((s,o)=>{r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,a=>{if(r==null||r(),Mn(a))return o(new Error(a.errorMessage));s(a)}),this.publishWeb3RequestEvent(n,e)})}publishWeb3RequestEvent(e,r){const n={type:"WEB3_REQUEST",id:e,request:r};this.publishEvent("Web3Request",n,!0).then(i=>{}).catch(i=>{this.handleWeb3ResponseMessage(n.id,{method:r.method,errorMessage:i.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(r.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof UW)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const r={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(e,r,n){return this.connection.publishEvent(e,r,n)}handleWeb3ResponseMessage(e,r){if(r.method==="requestEthereumAccounts"){tu.accountRequestCallbackIds.forEach(n=>this.invokeCallback(n,r)),tu.accountRequestCallbackIds.clear();return}this.invokeCallback(e,r)}handleErrorResponse(e,r,n){var i;const s=(i=n==null?void 0:n.message)!==null&&i!==void 0?i:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:r,errorMessage:s})}invokeCallback(e,r){const n=this.relayEventManager.callbacks.get(e);n&&(n(r),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){const{appName:e,appLogoUrl:r}=this.metadata,n={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:r}},i=Wh(8);return new Promise((s,o)=>{this.relayEventManager.callbacks.set(i,a=>{if(Mn(a))return o(new Error(a.errorMessage));s(a)}),tu.accountRequestCallbackIds.add(i),this.publishWeb3RequestEvent(i,n)})}watchAsset(e,r,n,i,s,o){const a={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let c=null;const u=Wh(8),l=d=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,d),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}),new Promise((d,h)=>{this.relayEventManager.callbacks.set(u,f=>{if(c==null||c(),Mn(f))return h(new Error(f.errorMessage));d(f)}),this.publishWeb3RequestEvent(u,a)})}addEthereumChain(e,r,n,i,s,o){const a={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let c=null;const u=Wh(8),l=d=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,d),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}),new Promise((d,h)=>{this.relayEventManager.callbacks.set(u,f=>{if(c==null||c(),Mn(f))return h(new Error(f.errorMessage));d(f)}),this.publishWeb3RequestEvent(u,a)})}switchEthereumChain(e,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})};let i=null;const s=Wh(8),o=a=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,n.method,a),i==null||i()};return i=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:o,onResetConnection:this.resetAndReload}),new Promise((a,c)=>{this.relayEventManager.callbacks.set(s,u=>{if(i==null||i(),Mn(u)&&u.errorCode)return c(Mt.provider.custom({code:u.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(Mn(u))return c(new Error(u.errorMessage));a(u)}),this.publishWeb3RequestEvent(s,n)})}}tu.accountRequestCallbackIds=new Set;const FW="DefaultChainId",HW="DefaultJsonRpcUrl";class Dee{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new ac("walletlink",LW),this.callback=e.callback||null;const r=this._storage.getItem(w9);if(r){const n=r.split(" ");n[0]!==""&&(this._addresses=n.map(i=>kl(i)))}this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:r,secret:n}=e.getWalletLinkSession();return{id:r,secret:n}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(HW))!==null&&e!==void 0?e:void 0}set jsonRpcUrl(e){this._storage.setItem(HW,e)}updateProviderInfo(e,r){var n;this.jsonRpcUrl=e;const i=this.getChainId();this._storage.setItem(FW,r.toString(10)),Ab(r)!==i&&((n=this.callback)===null||n===void 0||n.call(this,"chainChanged",od(r)))}async watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw Mt.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw Mt.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw Mt.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw Mt.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=r.options,u=await this.initializeRelay().watchAsset(r.type,i,s,a,o,n==null?void 0:n.toString());return Mn(u)?!1:!!u.result}async addEthereumChain(e){var r,n;const i=e[0];if(((r=i.rpcUrls)===null||r===void 0?void 0:r.length)===0)throw Mt.rpc.invalidParams("please pass in at least 1 rpcUrl");if(!i.chainName||i.chainName.trim()==="")throw Mt.rpc.invalidParams("chainName is a required field");if(!i.nativeCurrency)throw Mt.rpc.invalidParams("nativeCurrency is a required field");const s=Number.parseInt(i.chainId,16);if(s===this.getChainId())return!1;const o=this.initializeRelay(),{rpcUrls:a=[],blockExplorerUrls:c=[],chainName:u,iconUrls:l=[],nativeCurrency:d}=i,h=await o.addEthereumChain(s.toString(),a,l,c,u,d);if(Mn(h))return!1;if(((n=h.result)===null||n===void 0?void 0:n.isApproved)===!0)return this.updateProviderInfo(a[0],s),null;throw Mt.rpc.internal("unable to add ethereum chain")}async switchEthereumChain(e){const r=e[0],n=Number.parseInt(r.chainId,16),s=await this.initializeRelay().switchEthereumChain(n.toString(10),this.selectedAddress||void 0);if(Mn(s))throw s;const o=s.result;return o.isApproved&&o.rpcUrl.length>0&&this.updateProviderInfo(o.rpcUrl,n),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,r){var n;if(!Array.isArray(e))throw new Error("addresses is not an array");const i=e.map(s=>kl(s));JSON.stringify(i)!==JSON.stringify(this._addresses)&&(this._addresses=i,(n=this.callback)===null||n===void 0||n.call(this,"accountsChanged",i),this._storage.setItem(w9,i.join(" ")))}async request(e){const r=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return od(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);case"eth_signTransaction":return this._eth_signTransaction(r);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(r);case"eth_sendTransaction":return this._eth_sendTransaction(r);case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(r);case"wallet_switchEthereumChain":return this.switchEthereumChain(r);case"wallet_watchAsset":return this.watchAsset(r);default:if(!this.jsonRpcUrl)throw Mt.rpc.internal("No RPC URL set for chain");return mR(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){const r=kl(e);if(!this._addresses.map(i=>kl(i)).includes(r))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?kl(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?kl(e.to):null,i=e.value!=null?Xw(e.value):BigInt(0),s=e.data?m9(e.data):Buffer.alloc(0),o=e.nonce!=null?Ab(e.nonce):null,a=e.gasPrice!=null?Xw(e.gasPrice):null,c=e.maxFeePerGas!=null?Xw(e.maxFeePerGas):null,u=e.maxPriorityFeePerGas!=null?Xw(e.maxPriorityFeePerGas):null,l=e.gas!=null?Xw(e.gas):null,d=e.chainId?Ab(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:u,gasLimit:l,chainId:d}}async ecRecover(e){const{method:r,params:n}=e;if(!Array.isArray(n))throw Mt.rpc.invalidParams();const s=await this.initializeRelay().sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:DT(n[0]),signature:DT(n[1]),addPrefix:r==="personal_ecRecover"}});if(Mn(s))throw s;return s.result}getChainId(){var e;return Number.parseInt((e=this._storage.getItem(FW))!==null&&e!==void 0?e:"1",10)}async _eth_requestAccounts(){var e,r;if(this._addresses.length>0)return(e=this.callback)===null||e===void 0||e.call(this,"connect",{chainId:od(this.getChainId())}),this._addresses;const i=await this.initializeRelay().requestEthereumAccounts();if(Mn(i))throw i;if(!i.result)throw new Error("accounts received is empty");return this._setAddresses(i.result),(r=this.callback)===null||r===void 0||r.call(this,"connect",{chainId:od(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw Mt.rpc.invalidParams();const r=e[1],n=e[0];this._ensureKnownAddress(r);const s=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:kl(r),message:DT(n),addPrefix:!0,typedDataJson:null}});if(Mn(s))throw s;return s.result}async _eth_signTransaction(e){const r=this._prepareTransactionParams(e[0]||{}),i=await this.initializeRelay().signEthereumTransaction(r);if(Mn(i))throw i;return i.result}async _eth_sendRawTransaction(e){const r=m9(e[0]),i=await this.initializeRelay().submitEthereumTransaction(r,this.getChainId());if(Mn(i))throw i;return i.result}async _eth_sendTransaction(e){const r=this._prepareTransactionParams(e[0]||{}),i=await this.initializeRelay().signAndSubmitEthereumTransaction(r);if(Mn(i))throw i;return i.result}async signTypedData(e){const{method:r,params:n}=e;if(!Array.isArray(n))throw Mt.rpc.invalidParams();const i=u=>{const l={eth_signTypedData_v1:L4.hashForSignTypedDataLegacy,eth_signTypedData_v3:L4.hashForSignTypedData_v3,eth_signTypedData_v4:L4.hashForSignTypedData_v4,eth_signTypedData:L4.hashForSignTypedData_v4};return Cb(l[r]({data:Y9e(u)}),!0)},s=n[r==="eth_signTypedData_v1"?1:0],o=n[r==="eth_signTypedData_v1"?0:1];this._ensureKnownAddress(s);const c=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:kl(s),message:i(o),typedDataJson:JSON.stringify(o,null,2),addPrefix:!1}});if(Mn(c))throw c;return c.result}initializeRelay(){return this._relay||(this._relay=new tu({linkAPIUrl:LW,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}const Mee="SignerType",Lee=new ac("CBWSDK","SignerConfigurator");function G7e(){return Lee.getItem(Mee)}function K7e(t){Lee.setItem(Mee,t)}async function Z7e(t){const{communicator:e,metadata:r,handshakeRequest:n,callback:i}=t;J7e(e,r,i).catch(()=>{});const s={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},t.preference),{handshakeRequest:n})},{data:o}=await e.postRequestAndWaitForResponse(s);return o}function Y7e(t){const{signerType:e,metadata:r,communicator:n,callback:i}=t;switch(e){case"scw":return new u7e({metadata:r,callback:i,communicator:n});case"walletlink":return new Dee({metadata:r,callback:i})}}async function J7e(t,e,r){await t.onMessage(({event:i})=>i==="WalletLinkSessionRequest");const n=new Dee({metadata:e,callback:r});t.postMessage({event:"WalletLinkUpdate",data:{session:n.getSession()}}),await n.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}const Q7e=`Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app.
- Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,X7e=()=>{let t;return{getCrossOriginOpenerPolicy:()=>t===void 0?"undefined":t,checkCrossOriginOpenerPolicy:async()=>{if(typeof window>"u"){t="non-browser-env";return}try{const e=`${window.location.origin}${window.location.pathname}`,r=await fetch(e,{method:"HEAD"});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const n=r.headers.get("Cross-Origin-Opener-Policy");t=n??"null",t==="same-origin"&&console.error(Q7e)}catch(e){console.error("Error checking Cross-Origin-Opener-Policy:",e.message),t="error"}}}},{checkCrossOriginOpenerPolicy:eOe,getCrossOriginOpenerPolicy:tOe}=X7e(),qW=420,zW=540;function rOe(t){const e=(window.innerWidth-qW)/2+window.screenX,r=(window.innerHeight-zW)/2+window.screenY;iOe(t);const n=`wallet_${crypto.randomUUID()}`,i=window.open(t,n,`width=${qW}, height=${zW}, left=${e}, top=${r}`);if(i==null||i.focus(),!i)throw Mt.rpc.internal("Pop up window failed to open");return i}function nOe(t){t&&!t.closed&&t.close()}function iOe(t){const e={sdkName:wee,sdkVersion:L2,origin:window.location.origin,coop:tOe()};for(const[r,n]of Object.entries(e))t.searchParams.append(r,n.toString())}class sOe{constructor({url:e=z7e,metadata:r,preference:n}){this.popup=null,this.listeners=new Map,this.postMessage=async i=>{(await this.waitForPopupLoaded()).postMessage(i,this.url.origin)},this.postRequestAndWaitForResponse=async i=>{const s=this.onMessage(({requestId:o})=>o===i.id);return this.postMessage(i),await s},this.onMessage=async i=>new Promise((s,o)=>{const a=c=>{if(c.origin!==this.url.origin)return;const u=c.data;i(u)&&(s(u),window.removeEventListener("message",a),this.listeners.delete(a))};window.addEventListener("message",a),this.listeners.set(a,{reject:o})}),this.disconnect=()=>{nOe(this.popup),this.popup=null,this.listeners.forEach(({reject:i},s)=>{i(Mt.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",s)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=rOe(this.url),this.onMessage(({event:i})=>i==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:i})=>i==="PopupLoaded").then(i=>{this.postMessage({requestId:i.id,data:{version:L2,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})}).then(()=>{if(!this.popup)throw Mt.rpc.internal();return this.popup})),this.url=new URL(e),this.metadata=r,this.preference=n}}function oOe(t){const e=W9e(aOe(t),{shouldIncludeStack:!0}),r=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return r.searchParams.set("version",L2),r.searchParams.set("code",e.code.toString()),r.searchParams.set("message",e.message),Object.assign(Object.assign({},e),{docUrl:r.href})}function aOe(t){var e;if(typeof t=="string")return{message:t,code:Wr.rpc.internal};if(Mn(t)){const r=t.errorMessage,n=(e=t.errorCode)!==null&&e!==void 0?e:r.match(/(denied|rejected)/i)?Wr.provider.userRejectedRequest:void 0;return Object.assign(Object.assign({},t),{message:r,code:n,data:{method:t.method}})}return t}var WT={exports:{}},WW;function cOe(){return WW||(WW=1,function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,u,l){this.fn=c,this.context=u,this.once=l||!1}function s(c,u,l,d,h){if(typeof l!="function")throw new TypeError("The listener must be a function");var f=new i(l,d||c,h),g=r?r+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],f]:c._events[g].push(f):(c._events[g]=f,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],l,d;if(this._eventsCount===0)return u;for(d in l=this._events)e.call(l,d)&&u.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(l)):u},a.prototype.listeners=function(u){var l=r?r+u:u,d=this._events[l];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,f=d.length,g=new Array(f);h<f;h++)g[h]=d[h].fn;return g},a.prototype.listenerCount=function(u){var l=r?r+u:u,d=this._events[l];return d?d.fn?1:d.length:0},a.prototype.emit=function(u,l,d,h,f,g){var p=r?r+u:u;if(!this._events[p])return!1;var m=this._events[p],b=arguments.length,v,E;if(m.fn){switch(m.once&&this.removeListener(u,m.fn,void 0,!0),b){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,l),!0;case 3:return m.fn.call(m.context,l,d),!0;case 4:return m.fn.call(m.context,l,d,h),!0;case 5:return m.fn.call(m.context,l,d,h,f),!0;case 6:return m.fn.call(m.context,l,d,h,f,g),!0}for(E=1,v=new Array(b-1);E<b;E++)v[E-1]=arguments[E];m.fn.apply(m.context,v)}else{var w=m.length,C;for(E=0;E<w;E++)switch(m[E].once&&this.removeListener(u,m[E].fn,void 0,!0),b){case 1:m[E].fn.call(m[E].context);break;case 2:m[E].fn.call(m[E].context,l);break;case 3:m[E].fn.call(m[E].context,l,d);break;case 4:m[E].fn.call(m[E].context,l,d,h);break;default:if(!v)for(C=1,v=new Array(b-1);C<b;C++)v[C-1]=arguments[C];m[E].fn.apply(m[E].context,v)}}return!0},a.prototype.on=function(u,l,d){return s(this,u,l,d,!1)},a.prototype.once=function(u,l,d){return s(this,u,l,d,!0)},a.prototype.removeListener=function(u,l,d,h){var f=r?r+u:u;if(!this._events[f])return this;if(!l)return o(this,f),this;var g=this._events[f];if(g.fn)g.fn===l&&(!h||g.once)&&(!d||g.context===d)&&o(this,f);else{for(var p=0,m=[],b=g.length;p<b;p++)(g[p].fn!==l||h&&!g[p].once||d&&g[p].context!==d)&&m.push(g[p]);m.length?this._events[f]=m.length===1?m[0]:m:o(this,f)}return this},a.prototype.removeAllListeners=function(u){var l;return u?(l=r?r+u:u,this._events[l]&&o(this,l)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a}(WT)),WT.exports}var uOe=cOe();const lOe=cc(uOe);class dOe extends lOe{}var hOe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};class fOe extends dOe{constructor(e){var{metadata:r}=e,n=e.preference,{keysUrl:i}=n,s=hOe(n,["keysUrl"]);super(),this.signer=null,this.isCoinbaseWallet=!0,this.metadata=r,this.preference=s,this.communicator=new sOe({url:i,metadata:r,preference:s});const o=G7e();o&&(this.signer=this.initSigner(o))}async request(e){try{if(c7e(e),!this.signer)switch(e.method){case"eth_requestAccounts":{const r=await this.requestSignerSelection(e),n=this.initSigner(r);await n.handshake(e),this.signer=n,K7e(r);break}case"wallet_sendCalls":{const r=this.initSigner("scw");await r.handshake({method:"handshake"});const n=await r.request(e);return await r.cleanup(),n}case"wallet_getCallsStatus":return mR(e,W7e);case"net_version":return 1;case"eth_chainId":return od(1);default:throw Mt.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")}return await this.signer.request(e)}catch(r){const{code:n}=r;return n===Wr.provider.unauthorized&&this.disconnect(),Promise.reject(oOe(r))}}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){var e;await((e=this.signer)===null||e===void 0?void 0:e.cleanup()),this.signer=null,ac.clearAll(),this.emit("disconnect",Mt.provider.disconnected("User initiated disconnection"))}requestSignerSelection(e){return Z7e({communicator:this.communicator,preference:this.preference,metadata:this.metadata,handshakeRequest:e,callback:this.emit.bind(this)})}initSigner(e){return Y7e({signerType:e,metadata:this.metadata,communicator:this.communicator,callback:this.emit.bind(this)})}}function pOe(t){if(t){if(!["all","smartWalletOnly","eoaOnly"].includes(t.options))throw new Error(`Invalid options: ${t.options}`);if(t.attribution&&t.attribution.auto!==void 0&&t.attribution.dataSuffix!==void 0)throw new Error("Attribution cannot contain both auto and dataSuffix properties")}}function gOe(t){var e;const r={metadata:t.metadata,preference:t.preference};return(e=a7e(r))!==null&&e!==void 0?e:new fOe(r)}const mOe={options:"all"};function wOe(t){var e;new ac("CBWSDK").setItem("VERSION",L2),eOe();const n={metadata:{appName:t.appName||"Dapp",appLogoUrl:t.appLogoUrl||"",appChainIds:t.appChainIds||[]},preference:Object.assign(mOe,(e=t.preference)!==null&&e!==void 0?e:{})};pOe(n.preference);let i=null;return{getProvider:()=>(i||(i=gOe(n)),i)}}const bOe=Object.freeze(Object.defineProperty({__proto__:null,createCoinbaseWalletSDK:wOe},Symbol.toStringTag,{value:"Module"})),yOe=Se`<svg
- width="14"
- height="14"
- viewBox="0 0 14 14"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- fill="currentColor"
- fill-rule="evenodd"
- clip-rule="evenodd"
- d="M7.0023 0.875C7.48571 0.875 7.8776 1.26675 7.8776 1.75V6.125H12.2541C12.7375 6.125 13.1294 6.51675 13.1294 7C13.1294 7.48325 12.7375 7.875 12.2541 7.875H7.8776V12.25C7.8776 12.7332 7.48571 13.125 7.0023 13.125C6.51889 13.125 6.12701 12.7332 6.12701 12.25V7.875H1.75054C1.26713 7.875 0.875244 7.48325 0.875244 7C0.875244 6.51675 1.26713 6.125 1.75054 6.125H6.12701V1.75C6.12701 1.26675 6.51889 0.875 7.0023 0.875Z"
- fill="#667dff"
- /></svg
- >`,vOe=Object.freeze(Object.defineProperty({__proto__:null,addSvg:yOe},Symbol.toStringTag,{value:"Module"})),_Oe=Se`<svg fill="none" viewBox="0 0 24 24">
- <path
- style="fill: var(--wui-color-accent-100);"
- d="M10.2 6.6a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM21 6.6a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM10.2 17.4a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM21 17.4a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0Z"
- />
- </svg>`,EOe=Object.freeze(Object.defineProperty({__proto__:null,allWalletsSvg:_Oe},Symbol.toStringTag,{value:"Module"})),COe=Se`<svg
- fill="none"
- viewBox="0 0 21 20"
- >
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M10.5 2.42908C6.31875 2.42908 2.92859 5.81989 2.92859 10.0034C2.92859 14.1869 6.31875 17.5777 10.5 17.5777C14.6813 17.5777 18.0714 14.1869 18.0714 10.0034C18.0714 5.81989 14.6813 2.42908 10.5 2.42908ZM0.928589 10.0034C0.928589 4.71596 5.21355 0.429077 10.5 0.429077C15.7865 0.429077 20.0714 4.71596 20.0714 10.0034C20.0714 15.2908 15.7865 19.5777 10.5 19.5777C5.21355 19.5777 0.928589 15.2908 0.928589 10.0034ZM10.5 5.75003C11.0523 5.75003 11.5 6.19774 11.5 6.75003L11.5 10.8343L12.7929 9.54137C13.1834 9.15085 13.8166 9.15085 14.2071 9.54137C14.5976 9.9319 14.5976 10.5651 14.2071 10.9556L11.2071 13.9556C10.8166 14.3461 10.1834 14.3461 9.79291 13.9556L6.79291 10.9556C6.40239 10.5651 6.40239 9.9319 6.79291 9.54137C7.18343 9.15085 7.8166 9.15085 8.20712 9.54137L9.50002 10.8343L9.50002 6.75003C9.50002 6.19774 9.94773 5.75003 10.5 5.75003Z"
- clip-rule="evenodd"
- /></svg
- >`,AOe=Object.freeze(Object.defineProperty({__proto__:null,arrowBottomCircleSvg:COe},Symbol.toStringTag,{value:"Module"})),xOe=Se`
- <svg width="36" height="36">
- <path
- d="M28.724 0H7.271A7.269 7.269 0 0 0 0 7.272v21.46A7.268 7.268 0 0 0 7.271 36H28.73A7.272 7.272 0 0 0 36 28.728V7.272A7.275 7.275 0 0 0 28.724 0Z"
- fill="url(#a)"
- />
- <path
- d="m17.845 8.271.729-1.26a1.64 1.64 0 1 1 2.843 1.638l-7.023 12.159h5.08c1.646 0 2.569 1.935 1.853 3.276H6.434a1.632 1.632 0 0 1-1.638-1.638c0-.909.73-1.638 1.638-1.638h4.176l5.345-9.265-1.67-2.898a1.642 1.642 0 0 1 2.844-1.638l.716 1.264Zm-6.317 17.5-1.575 2.732a1.64 1.64 0 1 1-2.844-1.638l1.17-2.025c1.323-.41 2.398-.095 3.249.931Zm13.56-4.954h4.262c.909 0 1.638.729 1.638 1.638 0 .909-.73 1.638-1.638 1.638h-2.367l1.597 2.772c.45.788.185 1.782-.602 2.241a1.642 1.642 0 0 1-2.241-.603c-2.69-4.666-4.711-8.159-6.052-10.485-1.372-2.367-.391-4.743.576-5.549 1.075 1.846 2.682 4.631 4.828 8.348Z"
- fill="#fff"
- />
- <defs>
- <linearGradient id="a" x1="18" y1="0" x2="18" y2="36" gradientUnits="userSpaceOnUse">
- <stop stop-color="#18BFFB" />
- <stop offset="1" stop-color="#2072F3" />
- </linearGradient>
- </defs>
- </svg>`,SOe=Object.freeze(Object.defineProperty({__proto__:null,appStoreSvg:xOe},Symbol.toStringTag,{value:"Module"})),TOe=Se`<svg fill="none" viewBox="0 0 40 40">
- <g clip-path="url(#a)">
- <g clip-path="url(#b)">
- <circle cx="20" cy="19.89" r="20" fill="#000" />
- <g clip-path="url(#c)">
- <path
- fill="#fff"
- d="M28.77 23.3c-.69 1.99-2.75 5.52-4.87 5.56-1.4.03-1.86-.84-3.46-.84-1.61 0-2.12.81-3.45.86-2.25.1-5.72-5.1-5.72-9.62 0-4.15 2.9-6.2 5.42-6.25 1.36-.02 2.64.92 3.47.92.83 0 2.38-1.13 4.02-.97.68.03 2.6.28 3.84 2.08-3.27 2.14-2.76 6.61.75 8.25ZM24.2 7.88c-2.47.1-4.49 2.69-4.2 4.84 2.28.17 4.47-2.39 4.2-4.84Z"
- />
- </g>
- </g>
- </g>
- <defs>
- <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
- <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
- <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
- </defs>
- </svg>`,IOe=Object.freeze(Object.defineProperty({__proto__:null,appleSvg:TOe},Symbol.toStringTag,{value:"Module"})),POe=Se`<svg fill="none" viewBox="0 0 14 15">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M7 1.99a1 1 0 0 1 1 1v7.58l2.46-2.46a1 1 0 0 1 1.41 1.42L7.7 13.69a1 1 0 0 1-1.41 0L2.12 9.53A1 1 0 0 1 3.54 8.1L6 10.57V3a1 1 0 0 1 1-1Z"
- clip-rule="evenodd"
- />
- </svg>`,OOe=Object.freeze(Object.defineProperty({__proto__:null,arrowBottomSvg:POe},Symbol.toStringTag,{value:"Module"})),ROe=Se`<svg fill="none" viewBox="0 0 14 15">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M13 7.99a1 1 0 0 1-1 1H4.4l2.46 2.46a1 1 0 1 1-1.41 1.41L1.29 8.7a1 1 0 0 1 0-1.41L5.46 3.1a1 1 0 0 1 1.41 1.42L4.41 6.99H12a1 1 0 0 1 1 1Z"
- clip-rule="evenodd"
- />
- </svg>`,kOe=Object.freeze(Object.defineProperty({__proto__:null,arrowLeftSvg:ROe},Symbol.toStringTag,{value:"Module"})),NOe=Se`<svg fill="none" viewBox="0 0 14 15">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M1 7.99a1 1 0 0 1 1-1h7.58L7.12 4.53A1 1 0 1 1 8.54 3.1l4.16 4.17a1 1 0 0 1 0 1.41l-4.16 4.17a1 1 0 1 1-1.42-1.41l2.46-2.46H2a1 1 0 0 1-1-1Z"
- clip-rule="evenodd"
- />
- </svg>`,$Oe=Object.freeze(Object.defineProperty({__proto__:null,arrowRightSvg:NOe},Symbol.toStringTag,{value:"Module"})),jOe=Se`<svg fill="none" viewBox="0 0 14 15">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M7 13.99a1 1 0 0 1-1-1V5.4L3.54 7.86a1 1 0 0 1-1.42-1.41L6.3 2.28a1 1 0 0 1 1.41 0l4.17 4.17a1 1 0 1 1-1.41 1.41L8 5.4v7.59a1 1 0 0 1-1 1Z"
- clip-rule="evenodd"
- />
- </svg>`,BOe=Object.freeze(Object.defineProperty({__proto__:null,arrowTopSvg:jOe},Symbol.toStringTag,{value:"Module"})),DOe=Se`<svg
- xmlns="http://www.w3.org/2000/svg"
- width="12"
- height="13"
- viewBox="0 0 12 13"
- fill="none"
- >
- <path
- fill-rule="evenodd"
- clip-rule="evenodd"
- d="M5.61391 1.57124C5.85142 1.42873 6.14813 1.42873 6.38564 1.57124L11.0793 4.38749C11.9179 4.89067 11.5612 6.17864 10.5832 6.17864H9.96398V10.0358H10.2854C10.6996 10.0358 11.0354 10.3716 11.0354 10.7858C11.0354 11.2 10.6996 11.5358 10.2854 11.5358H1.71416C1.29995 11.5358 0.964172 11.2 0.964172 10.7858C0.964172 10.3716 1.29995 10.0358 1.71416 10.0358H2.03558L2.03558 6.17864H1.41637C0.438389 6.17864 0.0816547 4.89066 0.920263 4.38749L5.61391 1.57124ZM3.53554 6.17864V10.0358H5.24979V6.17864H3.53554ZM6.74976 6.17864V10.0358H8.46401V6.17864H6.74976ZM8.64913 4.67864H3.35043L5.99978 3.089L8.64913 4.67864Z"
- fill="currentColor"
- /></svg
- >`,MOe=Object.freeze(Object.defineProperty({__proto__:null,bankSvg:DOe},Symbol.toStringTag,{value:"Module"})),LOe=Se`<svg fill="none" viewBox="0 0 20 20">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M4 6.4a1 1 0 0 1-.46.89 6.98 6.98 0 0 0 .38 6.18A7 7 0 0 0 16.46 7.3a1 1 0 0 1-.47-.92 7 7 0 0 0-12 .03Zm-2.02-.5a9 9 0 1 1 16.03 8.2A9 9 0 0 1 1.98 5.9Z"
- clip-rule="evenodd"
- />
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M6.03 8.63c-1.46-.3-2.72-.75-3.6-1.35l-.02-.01-.14-.11a1 1 0 0 1 1.2-1.6l.1.08c.6.4 1.52.74 2.69 1 .16-.99.39-1.88.67-2.65.3-.79.68-1.5 1.15-2.02A2.58 2.58 0 0 1 9.99 1c.8 0 1.45.44 1.92.97.47.52.84 1.23 1.14 2.02.29.77.52 1.66.68 2.64a8 8 0 0 0 2.7-1l.26-.18h.48a1 1 0 0 1 .12 2c-.86.51-2.01.91-3.34 1.18a22.24 22.24 0 0 1-.03 3.19c1.45.29 2.7.73 3.58 1.31a1 1 0 0 1-1.1 1.68c-.6-.4-1.56-.76-2.75-1-.15.8-.36 1.55-.6 2.2-.3.79-.67 1.5-1.14 2.02-.47.53-1.12.97-1.92.97-.8 0-1.45-.44-1.91-.97a6.51 6.51 0 0 1-1.15-2.02c-.24-.65-.44-1.4-.6-2.2-1.18.24-2.13.6-2.73.99a1 1 0 1 1-1.1-1.67c.88-.58 2.12-1.03 3.57-1.31a22.03 22.03 0 0 1-.04-3.2Zm2.2-1.7c.15-.86.34-1.61.58-2.24.24-.65.51-1.12.76-1.4.25-.28.4-.29.42-.29.03 0 .17.01.42.3.25.27.52.74.77 1.4.23.62.43 1.37.57 2.22a19.96 19.96 0 0 1-3.52 0Zm-.18 4.6a20.1 20.1 0 0 1-.03-2.62 21.95 21.95 0 0 0 3.94 0 20.4 20.4 0 0 1-.03 2.63 21.97 21.97 0 0 0-3.88 0Zm.27 2c.13.66.3 1.26.49 1.78.24.65.51 1.12.76 1.4.25.28.4.29.42.29.03 0 .17-.01.42-.3.25-.27.52-.74.77-1.4.19-.5.36-1.1.49-1.78a20.03 20.03 0 0 0-3.35 0Z"
- clip-rule="evenodd"
- />
- </svg>`,UOe=Object.freeze(Object.defineProperty({__proto__:null,browserSvg:LOe},Symbol.toStringTag,{value:"Module"})),FOe=Se`<svg
- xmlns="http://www.w3.org/2000/svg"
- width="12"
- height="13"
- viewBox="0 0 12 13"
- fill="none"
- >
- <path
- fill-rule="evenodd"
- clip-rule="evenodd"
- d="M4.16072 2C4.17367 2 4.18665 2 4.19968 2L7.83857 2C8.36772 1.99998 8.82398 1.99996 9.19518 2.04018C9.5895 2.0829 9.97577 2.17811 10.3221 2.42971C10.5131 2.56849 10.6811 2.73647 10.8198 2.92749C11.0714 3.27379 11.1666 3.66007 11.2094 4.0544C11.2496 4.42561 11.2496 4.88188 11.2495 5.41105V7.58896C11.2496 8.11812 11.2496 8.57439 11.2094 8.94561C11.1666 9.33994 11.0714 9.72621 10.8198 10.0725C10.6811 10.2635 10.5131 10.4315 10.3221 10.5703C9.97577 10.8219 9.5895 10.9171 9.19518 10.9598C8.82398 11 8.36772 11 7.83856 11H4.16073C3.63157 11 3.17531 11 2.80411 10.9598C2.40979 10.9171 2.02352 10.8219 1.67722 10.5703C1.48621 10.4315 1.31824 10.2635 1.17946 10.0725C0.927858 9.72621 0.832652 9.33994 0.78993 8.94561C0.749713 8.5744 0.749733 8.11813 0.749757 7.58896L0.749758 5.45C0.749758 5.43697 0.749758 5.42399 0.749757 5.41104C0.749733 4.88188 0.749713 4.42561 0.78993 4.0544C0.832652 3.66007 0.927858 3.27379 1.17946 2.92749C1.31824 2.73647 1.48621 2.56849 1.67722 2.42971C2.02352 2.17811 2.40979 2.0829 2.80411 2.04018C3.17531 1.99996 3.63157 1.99998 4.16072 2ZM2.96567 3.53145C2.69897 3.56034 2.60687 3.60837 2.55888 3.64324C2.49521 3.6895 2.43922 3.74549 2.39296 3.80916C2.35809 3.85715 2.31007 3.94926 2.28117 4.21597C2.26629 4.35335 2.25844 4.51311 2.25431 4.70832H9.74498C9.74085 4.51311 9.733 4.35335 9.71812 4.21597C9.68922 3.94926 9.6412 3.85715 9.60633 3.80916C9.56007 3.74549 9.50408 3.6895 9.44041 3.64324C9.39242 3.60837 9.30031 3.56034 9.03362 3.53145C8.75288 3.50103 8.37876 3.5 7.79961 3.5H4.19968C3.62053 3.5 3.24641 3.50103 2.96567 3.53145ZM9.74956 6.20832H2.24973V7.55C2.24973 8.12917 2.25076 8.5033 2.28117 8.78404C2.31007 9.05074 2.35809 9.14285 2.39296 9.19084C2.43922 9.25451 2.49521 9.31051 2.55888 9.35677C2.60687 9.39163 2.69897 9.43966 2.96567 9.46856C3.24641 9.49897 3.62053 9.5 4.19968 9.5H7.79961C8.37876 9.5 8.75288 9.49897 9.03362 9.46856C9.30032 9.43966 9.39242 9.39163 9.44041 9.35677C9.50408 9.31051 9.56007 9.25451 9.60633 9.19084C9.6412 9.14285 9.68922 9.05075 9.71812 8.78404C9.74854 8.5033 9.74956 8.12917 9.74956 7.55V6.20832ZM6.74963 8C6.74963 7.58579 7.08541 7.25 7.49961 7.25H8.2496C8.6638 7.25 8.99958 7.58579 8.99958 8C8.99958 8.41422 8.6638 8.75 8.2496 8.75H7.49961C7.08541 8.75 6.74963 8.41422 6.74963 8Z"
- fill="currentColor"
- /></svg
- >`,HOe=Object.freeze(Object.defineProperty({__proto__:null,cardSvg:FOe},Symbol.toStringTag,{value:"Module"})),qOe=Se`<svg
- width="28"
- height="28"
- viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path
- fill-rule="evenodd"
- clip-rule="evenodd"
- d="M25.5297 4.92733C26.1221 5.4242 26.1996 6.30724 25.7027 6.89966L12.2836 22.8997C12.0316 23.2001 11.6652 23.3811 11.2735 23.3986C10.8817 23.4161 10.5006 23.2686 10.2228 22.9919L2.38218 15.1815C1.83439 14.6358 1.83268 13.7494 2.37835 13.2016C2.92403 12.6538 3.81046 12.6521 4.35825 13.1978L11.1183 19.9317L23.5573 5.10036C24.0542 4.50794 24.9372 4.43047 25.5297 4.92733Z"
- fill="currentColor"/>
- </svg>
- `,zOe=Object.freeze(Object.defineProperty({__proto__:null,checkmarkSvg:qOe},Symbol.toStringTag,{value:"Module"})),WOe=Se`<svg fill="none" viewBox="0 0 14 14">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M12.9576 2.23383C13.3807 2.58873 13.4361 3.21947 13.0812 3.64263L6.37159 11.6426C6.19161 11.8572 5.92989 11.9865 5.65009 11.999C5.3703 12.0115 5.09808 11.9062 4.89965 11.7085L0.979321 7.80331C0.588042 7.41354 0.586817 6.78038 0.976585 6.3891C1.36635 5.99782 1.99952 5.99659 2.3908 6.38636L5.53928 9.52268L11.5488 2.35742C11.9037 1.93426 12.5344 1.87893 12.9576 2.23383Z"
- clip-rule="evenodd"
- />
- </svg>`,VOe=Object.freeze(Object.defineProperty({__proto__:null,checkmarkBoldSvg:WOe},Symbol.toStringTag,{value:"Module"})),GOe=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M1.46 4.96a1 1 0 0 1 1.41 0L8 10.09l5.13-5.13a1 1 0 1 1 1.41 1.41l-5.83 5.84a1 1 0 0 1-1.42 0L1.46 6.37a1 1 0 0 1 0-1.41Z"
- clip-rule="evenodd"
- />
- </svg>`,KOe=Object.freeze(Object.defineProperty({__proto__:null,chevronBottomSvg:GOe},Symbol.toStringTag,{value:"Module"})),ZOe=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M11.04 1.46a1 1 0 0 1 0 1.41L5.91 8l5.13 5.13a1 1 0 1 1-1.41 1.41L3.79 8.71a1 1 0 0 1 0-1.42l5.84-5.83a1 1 0 0 1 1.41 0Z"
- clip-rule="evenodd"
- />
- </svg>`,YOe=Object.freeze(Object.defineProperty({__proto__:null,chevronLeftSvg:ZOe},Symbol.toStringTag,{value:"Module"})),JOe=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M4.96 14.54a1 1 0 0 1 0-1.41L10.09 8 4.96 2.87a1 1 0 0 1 1.41-1.41l5.84 5.83a1 1 0 0 1 0 1.42l-5.84 5.83a1 1 0 0 1-1.41 0Z"
- clip-rule="evenodd"
- />
- </svg>`,QOe=Object.freeze(Object.defineProperty({__proto__:null,chevronRightSvg:JOe},Symbol.toStringTag,{value:"Module"})),XOe=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M14.54 11.04a1 1 0 0 1-1.41 0L8 5.92l-5.13 5.12a1 1 0 1 1-1.41-1.41l5.83-5.84a1 1 0 0 1 1.42 0l5.83 5.84a1 1 0 0 1 0 1.41Z"
- clip-rule="evenodd"
- />
- </svg>`,eRe=Object.freeze(Object.defineProperty({__proto__:null,chevronTopSvg:XOe},Symbol.toStringTag,{value:"Module"})),tRe=Se`<svg width="36" height="36" fill="none">
- <path
- fill="#fff"
- fill-opacity=".05"
- d="M0 14.94c0-5.55 0-8.326 1.182-10.4a9 9 0 0 1 3.359-3.358C6.614 0 9.389 0 14.94 0h6.12c5.55 0 8.326 0 10.4 1.182a9 9 0 0 1 3.358 3.359C36 6.614 36 9.389 36 14.94v6.12c0 5.55 0 8.326-1.182 10.4a9 9 0 0 1-3.359 3.358C29.386 36 26.611 36 21.06 36h-6.12c-5.55 0-8.326 0-10.4-1.182a9 9 0 0 1-3.358-3.359C0 29.386 0 26.611 0 21.06v-6.12Z"
- />
- <path
- stroke="#fff"
- stroke-opacity=".05"
- d="M14.94.5h6.12c2.785 0 4.84 0 6.46.146 1.612.144 2.743.43 3.691.97a8.5 8.5 0 0 1 3.172 3.173c.541.948.826 2.08.971 3.692.145 1.62.146 3.675.146 6.459v6.12c0 2.785 0 4.84-.146 6.46-.145 1.612-.43 2.743-.97 3.691a8.5 8.5 0 0 1-3.173 3.172c-.948.541-2.08.826-3.692.971-1.62.145-3.674.146-6.459.146h-6.12c-2.784 0-4.84 0-6.46-.146-1.612-.145-2.743-.43-3.691-.97a8.5 8.5 0 0 1-3.172-3.173c-.541-.948-.827-2.08-.971-3.692C.5 25.9.5 23.845.5 21.06v-6.12c0-2.784 0-4.84.146-6.46.144-1.612.43-2.743.97-3.691A8.5 8.5 0 0 1 4.79 1.617C5.737 1.076 6.869.79 8.48.646 10.1.5 12.156.5 14.94.5Z"
- />
- <path
- fill="url(#a)"
- d="M17.998 10.8h12.469a14.397 14.397 0 0 0-24.938.001l6.234 10.798.006-.001a7.19 7.19 0 0 1 6.23-10.799Z"
- />
- <path
- fill="url(#b)"
- d="m24.237 21.598-6.234 10.798A14.397 14.397 0 0 0 30.47 10.798H18.002l-.002.006a7.191 7.191 0 0 1 6.237 10.794Z"
- />
- <path
- fill="url(#c)"
- d="M11.765 21.601 5.531 10.803A14.396 14.396 0 0 0 18.001 32.4l6.235-10.798-.004-.004a7.19 7.19 0 0 1-12.466.004Z"
- />
- <path fill="#fff" d="M18 25.2a7.2 7.2 0 1 0 0-14.4 7.2 7.2 0 0 0 0 14.4Z" />
- <path fill="#1A73E8" d="M18 23.7a5.7 5.7 0 1 0 0-11.4 5.7 5.7 0 0 0 0 11.4Z" />
- <defs>
- <linearGradient
- id="a"
- x1="6.294"
- x2="41.1"
- y1="5.995"
- y2="5.995"
- gradientUnits="userSpaceOnUse"
- >
- <stop stop-color="#D93025" />
- <stop offset="1" stop-color="#EA4335" />
- </linearGradient>
- <linearGradient
- id="b"
- x1="20.953"
- x2="37.194"
- y1="32.143"
- y2="2.701"
- gradientUnits="userSpaceOnUse"
- >
- <stop stop-color="#FCC934" />
- <stop offset="1" stop-color="#FBBC04" />
- </linearGradient>
- <linearGradient
- id="c"
- x1="25.873"
- x2="9.632"
- y1="31.2"
- y2="1.759"
- gradientUnits="userSpaceOnUse"
- >
- <stop stop-color="#1E8E3E" />
- <stop offset="1" stop-color="#34A853" />
- </linearGradient>
- </defs>
- </svg>`,rRe=Object.freeze(Object.defineProperty({__proto__:null,chromeStoreSvg:tRe},Symbol.toStringTag,{value:"Module"})),nRe=Se`<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
- <path
- fill-rule="evenodd"
- clip-rule="evenodd"
- d="M7.00235 2C4.24 2 2.00067 4.23858 2.00067 7C2.00067 9.76142 4.24 12 7.00235 12C9.7647 12 12.004 9.76142 12.004 7C12.004 4.23858 9.7647 2 7.00235 2ZM0 7C0 3.13401 3.13506 0 7.00235 0C10.8696 0 14.0047 3.13401 14.0047 7C14.0047 10.866 10.8696 14 7.00235 14C3.13506 14 0 10.866 0 7ZM7.00235 3C7.55482 3 8.00269 3.44771 8.00269 4V6.58579L9.85327 8.43575C10.2439 8.82627 10.2439 9.45944 9.85327 9.84996C9.46262 10.2405 8.82924 10.2405 8.43858 9.84996L6.29501 7.70711C6.10741 7.51957 6.00201 7.26522 6.00201 7V4C6.00201 3.44771 6.44988 3 7.00235 3Z"
- fill="currentColor"
- />
- </svg>`,iRe=Object.freeze(Object.defineProperty({__proto__:null,clockSvg:nRe},Symbol.toStringTag,{value:"Module"})),sRe=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M2.54 2.54a1 1 0 0 1 1.42 0L8 6.6l4.04-4.05a1 1 0 1 1 1.42 1.42L9.4 8l4.05 4.04a1 1 0 0 1-1.42 1.42L8 9.4l-4.04 4.05a1 1 0 0 1-1.42-1.42L6.6 8 2.54 3.96a1 1 0 0 1 0-1.42Z"
- clip-rule="evenodd"
- />
- </svg>`,oRe=Object.freeze(Object.defineProperty({__proto__:null,closeSvg:sRe},Symbol.toStringTag,{value:"Module"})),aRe=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm10.66-2.65a1 1 0 0 1 .23 1.06L9.83 9.24a1 1 0 0 1-.59.58l-2.83 1.06A1 1 0 0 1 5.13 9.6l1.06-2.82a1 1 0 0 1 .58-.59L9.6 5.12a1 1 0 0 1 1.06.23ZM7.9 7.89l-.13.35.35-.13.12-.35-.34.13Z"
- clip-rule="evenodd"
- />
- </svg>`,cRe=Object.freeze(Object.defineProperty({__proto__:null,compassSvg:aRe},Symbol.toStringTag,{value:"Module"})),uRe=Se`<svg fill="none" viewBox="0 0 20 20">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M10 3a7 7 0 0 0-6.85 8.44l8.29-8.3C10.97 3.06 10.49 3 10 3Zm3.49.93-9.56 9.56c.32.55.71 1.06 1.16 1.5L15 5.1a7.03 7.03 0 0 0-1.5-1.16Zm2.7 2.8-9.46 9.46a7 7 0 0 0 9.46-9.46ZM1.99 5.9A9 9 0 1 1 18 14.09 9 9 0 0 1 1.98 5.91Z"
- clip-rule="evenodd"
- />
- </svg>`,lRe=Object.freeze(Object.defineProperty({__proto__:null,coinPlaceholderSvg:uRe},Symbol.toStringTag,{value:"Module"})),dRe=Se`<svg
- xmlns="http://www.w3.org/2000/svg"
- width="16"
- height="16"
- viewBox="0 0 16 16"
- fill="none"
- >
- <path
- fill="currentColor"
- fill-rule="evenodd"
- clip-rule="evenodd"
- d="M9.21498 1.28565H10.5944C11.1458 1.28562 11.6246 1.2856 12.0182 1.32093C12.4353 1.35836 12.853 1.44155 13.2486 1.66724C13.7005 1.92498 14.0749 2.29935 14.3326 2.75122C14.5583 3.14689 14.6415 3.56456 14.6789 3.9817C14.7143 4.37531 14.7142 4.85403 14.7142 5.40545V6.78489C14.7142 7.33631 14.7143 7.81503 14.6789 8.20865C14.6415 8.62578 14.5583 9.04345 14.3326 9.43912C14.0749 9.89099 13.7005 10.2654 13.2486 10.5231C12.853 10.7488 12.4353 10.832 12.0182 10.8694C11.7003 10.8979 11.3269 10.9034 10.9045 10.9045C10.9034 11.3269 10.8979 11.7003 10.8694 12.0182C10.832 12.4353 10.7488 12.853 10.5231 13.2486C10.2654 13.7005 9.89099 14.0749 9.43912 14.3326C9.04345 14.5583 8.62578 14.6415 8.20865 14.6789C7.81503 14.7143 7.33631 14.7142 6.78489 14.7142H5.40545C4.85403 14.7142 4.37531 14.7143 3.9817 14.6789C3.56456 14.6415 3.14689 14.5583 2.75122 14.3326C2.29935 14.0749 1.92498 13.7005 1.66724 13.2486C1.44155 12.853 1.35836 12.4353 1.32093 12.0182C1.2856 11.6246 1.28562 11.1458 1.28565 10.5944V9.21498C1.28562 8.66356 1.2856 8.18484 1.32093 7.79122C1.35836 7.37409 1.44155 6.95642 1.66724 6.56074C1.92498 6.10887 2.29935 5.73451 2.75122 5.47677C3.14689 5.25108 3.56456 5.16789 3.9817 5.13045C4.2996 5.10192 4.67301 5.09645 5.09541 5.09541C5.09645 4.67302 5.10192 4.2996 5.13045 3.9817C5.16789 3.56456 5.25108 3.14689 5.47676 2.75122C5.73451 2.29935 6.10887 1.92498 6.56074 1.66724C6.95642 1.44155 7.37409 1.35836 7.79122 1.32093C8.18484 1.2856 8.66356 1.28562 9.21498 1.28565ZM5.09541 7.09552C4.68397 7.09667 4.39263 7.10161 4.16046 7.12245C3.88053 7.14757 3.78516 7.18949 3.74214 7.21403C3.60139 7.29431 3.48478 7.41091 3.4045 7.55166C3.37997 7.59468 3.33804 7.69005 3.31292 7.96999C3.28659 8.26345 3.28565 8.65147 3.28565 9.25708V10.5523C3.28565 11.1579 3.28659 11.5459 3.31292 11.8394C3.33804 12.1193 3.37997 12.2147 3.4045 12.2577C3.48478 12.3985 3.60139 12.5151 3.74214 12.5954C3.78516 12.6199 3.88053 12.6618 4.16046 12.6869C4.45393 12.7133 4.84195 12.7142 5.44755 12.7142H6.74279C7.3484 12.7142 7.73641 12.7133 8.02988 12.6869C8.30981 12.6618 8.40518 12.6199 8.44821 12.5954C8.58895 12.5151 8.70556 12.3985 8.78584 12.2577C8.81038 12.2147 8.8523 12.1193 8.87742 11.8394C8.89825 11.6072 8.90319 11.3159 8.90435 10.9045C8.48219 10.9034 8.10898 10.8979 7.79122 10.8694C7.37409 10.832 6.95641 10.7488 6.56074 10.5231C6.10887 10.2654 5.73451 9.89099 5.47676 9.43912C5.25108 9.04345 5.16789 8.62578 5.13045 8.20865C5.10194 7.89089 5.09645 7.51767 5.09541 7.09552ZM7.96999 3.31292C7.69005 3.33804 7.59468 3.37997 7.55166 3.4045C7.41091 3.48478 7.29431 3.60139 7.21403 3.74214C7.18949 3.78516 7.14757 3.88053 7.12245 4.16046C7.09611 4.45393 7.09517 4.84195 7.09517 5.44755V6.74279C7.09517 7.3484 7.09611 7.73641 7.12245 8.02988C7.14757 8.30981 7.18949 8.40518 7.21403 8.4482C7.29431 8.58895 7.41091 8.70556 7.55166 8.78584C7.59468 8.81038 7.69005 8.8523 7.96999 8.87742C8.26345 8.90376 8.65147 8.9047 9.25708 8.9047H10.5523C11.1579 8.9047 11.5459 8.90376 11.8394 8.87742C12.1193 8.8523 12.2147 8.81038 12.2577 8.78584C12.3985 8.70556 12.5151 8.58895 12.5954 8.4482C12.6199 8.40518 12.6618 8.30981 12.6869 8.02988C12.7133 7.73641 12.7142 7.3484 12.7142 6.74279V5.44755C12.7142 4.84195 12.7133 4.45393 12.6869 4.16046C12.6618 3.88053 12.6199 3.78516 12.5954 3.74214C12.5151 3.60139 12.3985 3.48478 12.2577 3.4045C12.2147 3.37997 12.1193 3.33804 11.8394 3.31292C11.5459 3.28659 11.1579 3.28565 10.5523 3.28565H9.25708C8.65147 3.28565 8.26345 3.28659 7.96999 3.31292Z"
- fill="#788181"
- /></svg
- >`,hRe=Object.freeze(Object.defineProperty({__proto__:null,copySvg:dRe},Symbol.toStringTag,{value:"Module"})),fRe=Se` <svg fill="none" viewBox="0 0 13 4">
- <path fill="currentColor" d="M.5 0h12L8.9 3.13a3.76 3.76 0 0 1-4.8 0L.5 0Z" />
- </svg>`,pRe=Object.freeze(Object.defineProperty({__proto__:null,cursorSvg:fRe},Symbol.toStringTag,{value:"Module"})),gRe=Se`<svg fill="none" viewBox="0 0 14 6">
- <path style="fill: var(--wui-color-bg-150);" d="M0 1h14L9.21 5.12a3.31 3.31 0 0 1-4.49 0L0 1Z" />
- <path
- style="stroke: var(--wui-color-inverse-100);"
- stroke-opacity=".05"
- d="M1.33 1.5h11.32L8.88 4.75l-.01.01a2.81 2.81 0 0 1-3.8 0l-.02-.01L1.33 1.5Z"
- />
- <path
- style="fill: var(--wui-color-bg-150);"
- d="M1.25.71h11.5L9.21 3.88a3.31 3.31 0 0 1-4.49 0L1.25.71Z"
- />
- </svg> `,mRe=Object.freeze(Object.defineProperty({__proto__:null,cursorTransparentSvg:gRe},Symbol.toStringTag,{value:"Module"})),wRe=Se`<svg fill="none" viewBox="0 0 20 20">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M13.66 2H6.34c-1.07 0-1.96 0-2.68.08-.74.08-1.42.25-2.01.68a4 4 0 0 0-.89.89c-.43.6-.6 1.27-.68 2.01C0 6.38 0 7.26 0 8.34v.89c0 1.07 0 1.96.08 2.68.08.74.25 1.42.68 2.01a4 4 0 0 0 .89.89c.6.43 1.27.6 2.01.68a27 27 0 0 0 2.68.08h7.32a27 27 0 0 0 2.68-.08 4.03 4.03 0 0 0 2.01-.68 4 4 0 0 0 .89-.89c.43-.6.6-1.27.68-2.01.08-.72.08-1.6.08-2.68v-.89c0-1.07 0-1.96-.08-2.68a4.04 4.04 0 0 0-.68-2.01 4 4 0 0 0-.89-.89c-.6-.43-1.27-.6-2.01-.68C15.62 2 14.74 2 13.66 2ZM2.82 4.38c.2-.14.48-.25 1.06-.31C4.48 4 5.25 4 6.4 4h7.2c1.15 0 1.93 0 2.52.07.58.06.86.17 1.06.31a2 2 0 0 1 .44.44c.14.2.25.48.31 1.06.07.6.07 1.37.07 2.52v.77c0 1.15 0 1.93-.07 2.52-.06.58-.17.86-.31 1.06a2 2 0 0 1-.44.44c-.2.14-.48.25-1.06.32-.6.06-1.37.06-2.52.06H6.4c-1.15 0-1.93 0-2.52-.06-.58-.07-.86-.18-1.06-.32a2 2 0 0 1-.44-.44c-.14-.2-.25-.48-.31-1.06C2 11.1 2 10.32 2 9.17V8.4c0-1.15 0-1.93.07-2.52.06-.58.17-.86.31-1.06a2 2 0 0 1 .44-.44Z"
- clip-rule="evenodd"
- />
- <path fill="currentColor" d="M6.14 17.57a1 1 0 1 0 0 2h7.72a1 1 0 1 0 0-2H6.14Z" />
- </svg>`,bRe=Object.freeze(Object.defineProperty({__proto__:null,desktopSvg:wRe},Symbol.toStringTag,{value:"Module"})),yRe=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M6.07 1h.57a1 1 0 0 1 0 2h-.52c-.98 0-1.64 0-2.14.06-.48.05-.7.14-.84.24-.13.1-.25.22-.34.35-.1.14-.2.35-.25.83-.05.5-.05 1.16-.05 2.15v2.74c0 .99 0 1.65.05 2.15.05.48.14.7.25.83.1.14.2.25.34.35.14.1.36.2.84.25.5.05 1.16.05 2.14.05h.52a1 1 0 0 1 0 2h-.57c-.92 0-1.69 0-2.3-.07a3.6 3.6 0 0 1-1.8-.61c-.3-.22-.57-.49-.8-.8a3.6 3.6 0 0 1-.6-1.79C.5 11.11.5 10.35.5 9.43V6.58c0-.92 0-1.7.06-2.31a3.6 3.6 0 0 1 .62-1.8c.22-.3.48-.57.79-.79a3.6 3.6 0 0 1 1.8-.61C4.37 1 5.14 1 6.06 1ZM9.5 3a1 1 0 0 1 1.42 0l4.28 4.3a1 1 0 0 1 0 1.4L10.93 13a1 1 0 0 1-1.42-1.42L12.1 9H6.8a1 1 0 1 1 0-2h5.3L9.51 4.42a1 1 0 0 1 0-1.41Z"
- clip-rule="evenodd"
- />
- </svg>`,vRe=Object.freeze(Object.defineProperty({__proto__:null,disconnectSvg:yRe},Symbol.toStringTag,{value:"Module"})),_Re=Se`<svg fill="none" viewBox="0 0 40 40">
- <g clip-path="url(#a)">
- <g clip-path="url(#b)">
- <circle cx="20" cy="19.89" r="20" fill="#5865F2" />
- <path
- fill="#fff"
- fill-rule="evenodd"
- d="M25.71 28.15C30.25 28 32 25.02 32 25.02c0-6.61-2.96-11.98-2.96-11.98-2.96-2.22-5.77-2.15-5.77-2.15l-.29.32c3.5 1.07 5.12 2.61 5.12 2.61a16.75 16.75 0 0 0-10.34-1.93l-.35.04a15.43 15.43 0 0 0-5.88 1.9s1.71-1.63 5.4-2.7l-.2-.24s-2.81-.07-5.77 2.15c0 0-2.96 5.37-2.96 11.98 0 0 1.73 2.98 6.27 3.13l1.37-1.7c-2.6-.79-3.6-2.43-3.6-2.43l.58.35.09.06.08.04.02.01.08.05a17.25 17.25 0 0 0 4.52 1.58 14.4 14.4 0 0 0 8.3-.86c.72-.27 1.52-.66 2.37-1.21 0 0-1.03 1.68-3.72 2.44.61.78 1.35 1.67 1.35 1.67Zm-9.55-9.6c-1.17 0-2.1 1.03-2.1 2.28 0 1.25.95 2.28 2.1 2.28 1.17 0 2.1-1.03 2.1-2.28.01-1.25-.93-2.28-2.1-2.28Zm7.5 0c-1.17 0-2.1 1.03-2.1 2.28 0 1.25.95 2.28 2.1 2.28 1.17 0 2.1-1.03 2.1-2.28 0-1.25-.93-2.28-2.1-2.28Z"
- clip-rule="evenodd"
- />
- </g>
- </g>
- <defs>
- <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
- <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
- </defs>
- </svg>`,ERe=Object.freeze(Object.defineProperty({__proto__:null,discordSvg:_Re},Symbol.toStringTag,{value:"Module"})),CRe=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- d="M4.25 7a.63.63 0 0 0-.63.63v3.97c0 .28-.2.51-.47.54l-.75.07a.93.93 0 0 1-.9-.47A7.51 7.51 0 0 1 5.54.92a7.5 7.5 0 0 1 9.54 4.62c.12.35.06.72-.16 1-.74.97-1.68 1.78-2.6 2.44V4.44a.64.64 0 0 0-.63-.64h-1.06c-.35 0-.63.3-.63.64v5.5c0 .23-.12.42-.32.5l-.52.23V6.05c0-.36-.3-.64-.64-.64H7.45c-.35 0-.64.3-.64.64v4.97c0 .25-.17.46-.4.52a5.8 5.8 0 0 0-.45.11v-4c0-.36-.3-.65-.64-.65H4.25ZM14.07 12.4A7.49 7.49 0 0 1 3.6 14.08c4.09-.58 9.14-2.5 11.87-6.6v.03a7.56 7.56 0 0 1-1.41 4.91Z"
- />
- </svg>`,ARe=Object.freeze(Object.defineProperty({__proto__:null,etherscanSvg:CRe},Symbol.toStringTag,{value:"Module"})),xRe=Se`<svg fill="none" viewBox="0 0 14 15">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M6.71 2.99a.57.57 0 0 0-.57.57 1 1 0 0 1-1 1c-.58 0-.96 0-1.24.03-.27.03-.37.07-.42.1a.97.97 0 0 0-.36.35c-.04.08-.09.21-.11.67a2.57 2.57 0 0 1 0 5.13c.02.45.07.6.11.66.09.15.21.28.36.36.07.04.21.1.67.12a2.57 2.57 0 0 1 5.12 0c.46-.03.6-.08.67-.12a.97.97 0 0 0 .36-.36c.03-.04.07-.14.1-.41.02-.29.03-.66.03-1.24a1 1 0 0 1 1-1 .57.57 0 0 0 0-1.15 1 1 0 0 1-1-1c0-.58 0-.95-.03-1.24a1.04 1.04 0 0 0-.1-.42.97.97 0 0 0-.36-.36 1.04 1.04 0 0 0-.42-.1c-.28-.02-.65-.02-1.24-.02a1 1 0 0 1-1-1 .57.57 0 0 0-.57-.57ZM5.15 13.98a1 1 0 0 0 .99-1v-.78a.57.57 0 0 1 1.14 0v.78a1 1 0 0 0 .99 1H8.36a66.26 66.26 0 0 0 .73 0 3.78 3.78 0 0 0 1.84-.38c.46-.26.85-.64 1.1-1.1.23-.4.32-.8.36-1.22.02-.2.03-.4.03-.63a2.57 2.57 0 0 0 0-4.75c0-.23-.01-.44-.03-.63a2.96 2.96 0 0 0-.35-1.22 2.97 2.97 0 0 0-1.1-1.1c-.4-.22-.8-.31-1.22-.35a8.7 8.7 0 0 0-.64-.04 2.57 2.57 0 0 0-4.74 0c-.23 0-.44.02-.63.04-.42.04-.83.13-1.22.35-.46.26-.84.64-1.1 1.1-.33.57-.37 1.2-.39 1.84a21.39 21.39 0 0 0 0 .72v.1a1 1 0 0 0 1 .99h.78a.57.57 0 0 1 0 1.15h-.77a1 1 0 0 0-1 .98v.1a63.87 63.87 0 0 0 0 .73c0 .64.05 1.27.38 1.83.26.47.64.85 1.1 1.11.56.32 1.2.37 1.84.38a20.93 20.93 0 0 0 .72 0h.1Z"
- clip-rule="evenodd"
- />
- </svg>`,SRe=Object.freeze(Object.defineProperty({__proto__:null,extensionSvg:xRe},Symbol.toStringTag,{value:"Module"})),TRe=Se`<svg fill="none" viewBox="0 0 14 15">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M3.74 3.99a1 1 0 0 1 1-1H11a1 1 0 0 1 1 1v6.26a1 1 0 0 1-2 0V6.4l-6.3 6.3a1 1 0 0 1-1.4-1.42l6.29-6.3H4.74a1 1 0 0 1-1-1Z"
- clip-rule="evenodd"
- />
- </svg>`,IRe=Object.freeze(Object.defineProperty({__proto__:null,externalLinkSvg:TRe},Symbol.toStringTag,{value:"Module"})),PRe=Se`<svg fill="none" viewBox="0 0 40 40">
- <g clip-path="url(#a)">
- <g clip-path="url(#b)">
- <circle cx="20" cy="19.89" r="20" fill="#1877F2" />
- <g clip-path="url(#c)">
- <path
- fill="#fff"
- d="M26 12.38h-2.89c-.92 0-1.61.38-1.61 1.34v1.66H26l-.36 4.5H21.5v12H17v-12h-3v-4.5h3V12.5c0-3.03 1.6-4.62 5.2-4.62H26v4.5Z"
- />
- </g>
- </g>
- <path
- fill="#1877F2"
- d="M40 20a20 20 0 1 0-23.13 19.76V25.78H11.8V20h5.07v-4.4c0-5.02 3-7.79 7.56-7.79 2.19 0 4.48.4 4.48.4v4.91h-2.53c-2.48 0-3.25 1.55-3.25 3.13V20h5.54l-.88 5.78h-4.66v13.98A20 20 0 0 0 40 20Z"
- />
- <path
- fill="#fff"
- d="m27.79 25.78.88-5.78h-5.55v-3.75c0-1.58.78-3.13 3.26-3.13h2.53V8.2s-2.3-.39-4.48-.39c-4.57 0-7.55 2.77-7.55 7.78V20H11.8v5.78h5.07v13.98a20.15 20.15 0 0 0 6.25 0V25.78h4.67Z"
- />
- </g>
- <defs>
- <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
- <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
- <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
- </defs>
- </svg>`,ORe=Object.freeze(Object.defineProperty({__proto__:null,facebookSvg:PRe},Symbol.toStringTag,{value:"Module"})),RRe=Se`<svg style="border-radius: 9999px; overflow: hidden;" fill="none" viewBox="0 0 1000 1000">
- <rect width="1000" height="1000" rx="9999" ry="9999" fill="#855DCD"/>
- <path fill="#855DCD" d="M0 0h1000v1000H0V0Z" />
- <path
- fill="#fff"
- d="M320 248h354v504h-51.96V521.13h-.5c-5.76-63.8-59.31-113.81-124.54-113.81s-118.78 50-124.53 113.81h-.5V752H320V248Z"
- />
- <path
- fill="#fff"
- d="m225 320 21.16 71.46h17.9v289.09a16.29 16.29 0 0 0-16.28 16.24v19.49h-3.25a16.3 16.3 0 0 0-16.28 16.24V752h182.26v-19.48a16.22 16.22 0 0 0-16.28-16.24h-3.25v-19.5a16.22 16.22 0 0 0-16.28-16.23h-19.52V320H225Zm400.3 360.55a16.3 16.3 0 0 0-15.04 10.02 16.2 16.2 0 0 0-1.24 6.22v19.49h-3.25a16.29 16.29 0 0 0-16.27 16.24V752h182.24v-19.48a16.23 16.23 0 0 0-16.27-16.24h-3.25v-19.5a16.2 16.2 0 0 0-10.04-15 16.3 16.3 0 0 0-6.23-1.23v-289.1h17.9L775 320H644.82v360.55H625.3Z"
- />
- </svg>`,kRe=Object.freeze(Object.defineProperty({__proto__:null,farcasterSvg:RRe},Symbol.toStringTag,{value:"Module"})),NRe=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M0 3a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H1a1 1 0 0 1-1-1Zm2.63 5.25a1 1 0 0 1 1-1h8.75a1 1 0 1 1 0 2H3.63a1 1 0 0 1-1-1Zm2.62 5.25a1 1 0 0 1 1-1h3.5a1 1 0 0 1 0 2h-3.5a1 1 0 0 1-1-1Z"
- clip-rule="evenodd"
- />
- </svg>`,$Re=Object.freeze(Object.defineProperty({__proto__:null,filtersSvg:NRe},Symbol.toStringTag,{value:"Module"})),jRe=Se`<svg fill="none" viewBox="0 0 40 40">
- <g clip-path="url(#a)">
- <g clip-path="url(#b)">
- <circle cx="20" cy="19.89" r="20" fill="#1B1F23" />
- <g clip-path="url(#c)">
- <path
- fill="#fff"
- d="M8 19.89a12 12 0 1 1 15.8 11.38c-.6.12-.8-.26-.8-.57v-3.3c0-1.12-.4-1.85-.82-2.22 2.67-.3 5.48-1.31 5.48-5.92 0-1.31-.47-2.38-1.24-3.22.13-.3.54-1.52-.12-3.18 0 0-1-.32-3.3 1.23a11.54 11.54 0 0 0-6 0c-2.3-1.55-3.3-1.23-3.3-1.23a4.32 4.32 0 0 0-.12 3.18 4.64 4.64 0 0 0-1.24 3.22c0 4.6 2.8 5.63 5.47 5.93-.34.3-.65.83-.76 1.6-.69.31-2.42.84-3.5-1 0 0-.63-1.15-1.83-1.23 0 0-1.18-.02-.09.73 0 0 .8.37 1.34 1.76 0 0 .7 2.14 4.03 1.41v2.24c0 .31-.2.68-.8.57A12 12 0 0 1 8 19.9Z"
- />
- </g>
- </g>
- </g>
- <defs>
- <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
- <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
- <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
- </defs>
- </svg>`,BRe=Object.freeze(Object.defineProperty({__proto__:null,githubSvg:jRe},Symbol.toStringTag,{value:"Module"})),DRe=Se`<svg fill="none" viewBox="0 0 40 40">
- <path
- fill="#4285F4"
- d="M32.74 20.3c0-.93-.08-1.81-.24-2.66H20.26v5.03h7a6 6 0 0 1-2.62 3.91v3.28h4.22c2.46-2.27 3.88-5.6 3.88-9.56Z"
- />
- <path
- fill="#34A853"
- d="M20.26 33a12.4 12.4 0 0 0 8.6-3.14l-4.22-3.28a7.74 7.74 0 0 1-4.38 1.26 7.76 7.76 0 0 1-7.28-5.36H8.65v3.36A12.99 12.99 0 0 0 20.26 33Z"
- />
- <path
- fill="#FBBC05"
- d="M12.98 22.47a7.79 7.79 0 0 1 0-4.94v-3.36H8.65a12.84 12.84 0 0 0 0 11.66l3.37-2.63.96-.73Z"
- />
- <path
- fill="#EA4335"
- d="M20.26 12.18a7.1 7.1 0 0 1 4.98 1.93l3.72-3.72A12.47 12.47 0 0 0 20.26 7c-5.08 0-9.47 2.92-11.6 7.17l4.32 3.36a7.76 7.76 0 0 1 7.28-5.35Z"
- />
- </svg>`,MRe=Object.freeze(Object.defineProperty({__proto__:null,googleSvg:DRe},Symbol.toStringTag,{value:"Module"})),LRe=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- d="M8.51 5.66a.83.83 0 0 0-.57-.2.83.83 0 0 0-.52.28.8.8 0 0 0-.25.52 1 1 0 0 1-2 0c0-.75.34-1.43.81-1.91a2.75 2.75 0 0 1 4.78 1.92c0 1.24-.8 1.86-1.25 2.2l-.04.03c-.47.36-.5.43-.5.65a1 1 0 1 1-2 0c0-1.25.8-1.86 1.24-2.2l.04-.04c.47-.36.5-.43.5-.65 0-.3-.1-.49-.24-.6ZM9.12 11.87a1.13 1.13 0 1 1-2.25 0 1.13 1.13 0 0 1 2.25 0Z"
- />
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6a6 6 0 1 0 0 12A6 6 0 0 0 8 2Z"
- clip-rule="evenodd"
- />
- </svg>`,URe=Object.freeze(Object.defineProperty({__proto__:null,helpCircleSvg:LRe},Symbol.toStringTag,{value:"Module"})),FRe=Se`<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
- <path d="M4.98926 3.73932C4.2989 3.73932 3.73926 4.29896 3.73926 4.98932C3.73926 5.67968 4.2989 6.23932 4.98926 6.23932C5.67962 6.23932 6.23926 5.67968 6.23926 4.98932C6.23926 4.29896 5.67962 3.73932 4.98926 3.73932Z" fill="currentColor"/>
- <path fill-rule="evenodd" clip-rule="evenodd" d="M7.60497 0.500001H6.39504C5.41068 0.499977 4.59185 0.499958 3.93178 0.571471C3.24075 0.64634 2.60613 0.809093 2.04581 1.21619C1.72745 1.44749 1.44749 1.72745 1.21619 2.04581C0.809093 2.60613 0.64634 3.24075 0.571471 3.93178C0.499958 4.59185 0.499977 5.41065 0.500001 6.39501V7.57815C0.499998 8.37476 0.499995 9.05726 0.534869 9.62725C0.570123 10.2034 0.644114 10.7419 0.828442 11.2302C0.925651 11.4877 1.05235 11.7287 1.21619 11.9542C1.44749 12.2726 1.72745 12.5525 2.04581 12.7838C2.60613 13.1909 3.24075 13.3537 3.93178 13.4285C4.59185 13.5001 5.41066 13.5 6.39503 13.5H7.60496C8.58933 13.5 9.40815 13.5001 10.0682 13.4285C10.7593 13.3537 11.3939 13.1909 11.9542 12.7838C12.2726 12.5525 12.5525 12.2726 12.7838 11.9542C13.1909 11.3939 13.3537 10.7593 13.4285 10.0682C13.5 9.40816 13.5 8.58935 13.5 7.60497V6.39505C13.5 5.41068 13.5 4.59185 13.4285 3.93178C13.3537 3.24075 13.1909 2.60613 12.7838 2.04581C12.5525 1.72745 12.2726 1.44749 11.9542 1.21619C11.3939 0.809093 10.7593 0.64634 10.0682 0.571471C9.40816 0.499958 8.58933 0.499977 7.60497 0.500001ZM3.22138 2.83422C3.38394 2.71612 3.62634 2.61627 4.14721 2.55984C4.68679 2.50138 5.39655 2.5 6.45 2.5H7.55C8.60345 2.5 9.31322 2.50138 9.8528 2.55984C10.3737 2.61627 10.6161 2.71612 10.7786 2.83422C10.9272 2.94216 11.0578 3.07281 11.1658 3.22138C11.2839 3.38394 11.3837 3.62634 11.4402 4.14721C11.4986 4.68679 11.5 5.39655 11.5 6.45V6.49703C10.9674 6.11617 10.386 5.84936 9.74213 5.81948C8.40536 5.75745 7.3556 6.73051 6.40509 7.84229C6.33236 7.92737 6.27406 7.98735 6.22971 8.02911L6.1919 8.00514L6.17483 7.99427C6.09523 7.94353 5.98115 7.87083 5.85596 7.80302C5.56887 7.64752 5.18012 7.4921 4.68105 7.4921C4.66697 7.4921 4.6529 7.49239 4.63884 7.49299C3.79163 7.52878 3.09922 8.1106 2.62901 8.55472C2.58751 8.59392 2.54594 8.6339 2.50435 8.6745C2.50011 8.34653 2.5 7.97569 2.5 7.55V6.45C2.5 5.39655 2.50138 4.68679 2.55984 4.14721C2.61627 3.62634 2.71612 3.38394 2.83422 3.22138C2.94216 3.07281 3.07281 2.94216 3.22138 2.83422ZM10.3703 8.14825C10.6798 8.37526 11.043 8.71839 11.4832 9.20889C11.4744 9.44992 11.4608 9.662 11.4402 9.8528C11.3837 10.3737 11.2839 10.6161 11.1658 10.7786C11.0578 10.9272 10.9272 11.0578 10.7786 11.1658C10.6161 11.2839 10.3737 11.3837 9.8528 11.4402C9.31322 11.4986 8.60345 11.5 7.55 11.5H6.45C5.39655 11.5 4.68679 11.4986 4.14721 11.4402C3.62634 11.3837 3.38394 11.2839 3.22138 11.1658C3.15484 11.1174 3.0919 11.0645 3.03298 11.0075C3.10126 10.9356 3.16806 10.8649 3.23317 10.7959L3.29772 10.7276C3.55763 10.4525 3.78639 10.2126 4.00232 10.0087C4.22016 9.80294 4.39412 9.66364 4.53524 9.57742C4.63352 9.51738 4.69022 9.49897 4.71275 9.49345C4.76387 9.49804 4.81803 9.51537 4.90343 9.56162C4.96409 9.59447 5.02355 9.63225 5.11802 9.69238L5.12363 9.69595C5.20522 9.74789 5.32771 9.82587 5.46078 9.89278C5.76529 10.0459 6.21427 10.186 6.74977 10.0158C7.21485 9.86796 7.59367 9.52979 7.92525 9.14195C8.91377 7.98571 9.38267 7.80495 9.64941 7.81733C9.7858 7.82366 10.0101 7.884 10.3703 8.14825Z" fill="currentColor"/>
- </svg>`,HRe=Object.freeze(Object.defineProperty({__proto__:null,imageSvg:FRe},Symbol.toStringTag,{value:"Module"})),qRe=Se`<svg
- xmlns="http://www.w3.org/2000/svg"
- width="28"
- height="28"
- viewBox="0 0 28 28"
- fill="none">
- <path
- fill="#949E9E"
- fill-rule="evenodd"
- d="M7.974 2.975h12.052c1.248 0 2.296 0 3.143.092.89.096 1.723.307 2.461.844a4.9 4.9 0 0 1 1.084 1.084c.537.738.748 1.57.844 2.461.092.847.092 1.895.092 3.143v6.802c0 1.248 0 2.296-.092 3.143-.096.89-.307 1.723-.844 2.461a4.9 4.9 0 0 1-1.084 1.084c-.738.537-1.57.748-2.461.844-.847.092-1.895.092-3.143.092H7.974c-1.247 0-2.296 0-3.143-.092-.89-.096-1.723-.307-2.461-.844a4.901 4.901 0 0 1-1.084-1.084c-.537-.738-.748-1.571-.844-2.461C.35 19.697.35 18.649.35 17.4v-6.802c0-1.248 0-2.296.092-3.143.096-.89.307-1.723.844-2.461A4.9 4.9 0 0 1 2.37 3.91c.738-.537 1.571-.748 2.461-.844.847-.092 1.895-.092 3.143-.092ZM5.133 5.85c-.652.071-.936.194-1.117.326a2.1 2.1 0 0 0-.465.465c-.132.181-.255.465-.325 1.117-.074.678-.076 1.573-.076 2.917v6.65c0 1.344.002 2.239.076 2.917.07.652.193.936.325 1.117a2.1 2.1 0 0 0 .465.465c.181.132.465.255 1.117.326.678.073 1.574.075 2.917.075h11.9c1.344 0 2.239-.002 2.917-.075.652-.071.936-.194 1.117-.326.179-.13.335-.286.465-.465.132-.181.255-.465.326-1.117.073-.678.075-1.573.075-2.917v-6.65c0-1.344-.002-2.239-.075-2.917-.071-.652-.194-.936-.326-1.117a2.1 2.1 0 0 0-.465-.465c-.181-.132-.465-.255-1.117-.326-.678-.073-1.573-.075-2.917-.075H8.05c-1.343 0-2.239.002-2.917.075Zm.467 7.275a3.15 3.15 0 1 1 6.3 0 3.15 3.15 0 0 1-6.3 0Zm8.75-1.75a1.4 1.4 0 0 1 1.4-1.4h3.5a1.4 1.4 0 0 1 0 2.8h-3.5a1.4 1.4 0 0 1-1.4-1.4Zm0 5.25a1.4 1.4 0 0 1 1.4-1.4H21a1.4 1.4 0 1 1 0 2.8h-5.25a1.4 1.4 0 0 1-1.4-1.4Z"
- clip-rule="evenodd"/>
- </svg>`,zRe=Object.freeze(Object.defineProperty({__proto__:null,idSvg:qRe},Symbol.toStringTag,{value:"Module"})),WRe=Se`<svg fill="none" viewBox="0 0 14 15">
- <path
- fill="currentColor"
- d="M6 10.49a1 1 0 1 0 2 0v-2a1 1 0 0 0-2 0v2ZM7 4.49a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"
- />
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M7 14.99a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5-7a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"
- clip-rule="evenodd"
- />
- </svg>`,VRe=Object.freeze(Object.defineProperty({__proto__:null,infoCircleSvg:WRe},Symbol.toStringTag,{value:"Module"})),GRe=Se`<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path fill-rule="evenodd" clip-rule="evenodd" d="M5.00177 1.78569C3.8179 1.78569 2.85819 2.74508 2.85819 3.92855C2.85819 4.52287 3.09928 5.05956 3.49077 5.4485L3.5005 5.45817C3.64381 5.60054 3.76515 5.72108 3.85631 5.81845C3.93747 5.90512 4.05255 6.03218 4.12889 6.1805C4.16999 6.26034 4.19 6.30843 4.21768 6.39385C4.22145 6.40546 4.22499 6.41703 4.22833 6.42855H5.77521C5.77854 6.41703 5.78208 6.40547 5.78585 6.39385C5.81353 6.30843 5.83354 6.26034 5.87464 6.1805C5.95098 6.03218 6.06606 5.90512 6.14722 5.81845C6.23839 5.72108 6.35973 5.60053 6.50304 5.45816L6.51276 5.4485C6.90425 5.05956 7.14534 4.52287 7.14534 3.92855C7.14534 2.74508 6.18563 1.78569 5.00177 1.78569ZM5.71629 7.85712H4.28724C4.28724 8.21403 4.28876 8.40985 4.30703 8.54571C4.30727 8.54748 4.30751 8.54921 4.30774 8.55091C4.30944 8.55115 4.31118 8.55138 4.31295 8.55162C4.44884 8.56989 4.64474 8.5714 5.00177 8.5714C5.3588 8.5714 5.55469 8.56989 5.69059 8.55162C5.69236 8.55138 5.69409 8.55115 5.69579 8.55091C5.69603 8.54921 5.69627 8.54748 5.6965 8.54571C5.71477 8.40985 5.71629 8.21403 5.71629 7.85712ZM2.85819 7.14283C2.85819 6.9948 2.85796 6.91114 2.8548 6.85032C2.85461 6.84656 2.85441 6.84309 2.85421 6.83988C2.84393 6.8282 2.83047 6.81334 2.81301 6.79469C2.74172 6.71856 2.63908 6.61643 2.48342 6.46178C1.83307 5.81566 1.42914 4.91859 1.42914 3.92855C1.42914 1.9561 3.02866 0.357117 5.00177 0.357117C6.97487 0.357117 8.57439 1.9561 8.57439 3.92855C8.57439 4.91859 8.17047 5.81566 7.52012 6.46178C7.36445 6.61643 7.26182 6.71856 7.19053 6.79469C7.17306 6.81334 7.1596 6.8282 7.14932 6.83988C7.14912 6.84309 7.14892 6.84656 7.14873 6.85032C7.14557 6.91114 7.14534 6.9948 7.14534 7.14283V7.85712C7.14534 7.87009 7.14535 7.88304 7.14535 7.89598C7.14541 8.19889 7.14547 8.49326 7.11281 8.73606C7.076 9.00978 6.98631 9.32212 6.72678 9.58156C6.46726 9.841 6.15481 9.93065 5.881 9.96745C5.63813 10.0001 5.34365 10 5.04064 9.99998C5.0277 9.99998 5.01474 9.99998 5.00177 9.99998C4.98879 9.99998 4.97583 9.99998 4.96289 9.99998C4.65988 10 4.36541 10.0001 4.12253 9.96745C3.84872 9.93065 3.53628 9.841 3.27675 9.58156C3.01722 9.32212 2.92753 9.00978 2.89072 8.73606C2.85807 8.49326 2.85812 8.19889 2.85818 7.89598C2.85819 7.88304 2.85819 7.87008 2.85819 7.85712V7.14283ZM7.1243 6.86977C7.12366 6.87069 7.1233 6.87116 7.12327 6.87119C7.12323 6.87123 7.12356 6.87076 7.1243 6.86977ZM2.88027 6.8712C2.88025 6.87119 2.87988 6.8707 2.87921 6.86975C2.87995 6.87072 2.88028 6.8712 2.88027 6.8712Z" fill="#949E9E"/>
- </svg>`,KRe=Object.freeze(Object.defineProperty({__proto__:null,lightbulbSvg:GRe},Symbol.toStringTag,{value:"Module"})),ZRe=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M4.83 1.34h6.34c.68 0 1.26 0 1.73.04.5.05.97.15 1.42.4.52.3.95.72 1.24 1.24.26.45.35.92.4 1.42.04.47.04 1.05.04 1.73v3.71c0 .69 0 1.26-.04 1.74-.05.5-.14.97-.4 1.41-.3.52-.72.95-1.24 1.25-.45.25-.92.35-1.42.4-.47.03-1.05.03-1.73.03H4.83c-.68 0-1.26 0-1.73-.04-.5-.04-.97-.14-1.42-.4-.52-.29-.95-.72-1.24-1.24a3.39 3.39 0 0 1-.4-1.41A20.9 20.9 0 0 1 0 9.88v-3.7c0-.7 0-1.27.04-1.74.05-.5.14-.97.4-1.42.3-.52.72-.95 1.24-1.24.45-.25.92-.35 1.42-.4.47-.04 1.05-.04 1.73-.04ZM3.28 3.38c-.36.03-.51.08-.6.14-.21.11-.39.29-.5.5a.8.8 0 0 0-.08.19l5.16 3.44c.45.3 1.03.3 1.48 0L13.9 4.2a.79.79 0 0 0-.08-.2c-.11-.2-.29-.38-.5-.5-.09-.05-.24-.1-.6-.13-.37-.04-.86-.04-1.6-.04H4.88c-.73 0-1.22 0-1.6.04ZM14 6.54 9.85 9.31a3.33 3.33 0 0 1-3.7 0L2 6.54v3.3c0 .74 0 1.22.03 1.6.04.36.1.5.15.6.11.2.29.38.5.5.09.05.24.1.6.14.37.03.86.03 1.6.03h6.25c.73 0 1.22 0 1.6-.03.35-.03.5-.09.6-.14.2-.12.38-.3.5-.5.05-.1.1-.24.14-.6.03-.38.03-.86.03-1.6v-3.3Z"
- clip-rule="evenodd"
- />
- </svg>`,YRe=Object.freeze(Object.defineProperty({__proto__:null,mailSvg:ZRe},Symbol.toStringTag,{value:"Module"})),JRe=Se`<svg fill="none" viewBox="0 0 20 20">
- <path fill="currentColor" d="M10.81 5.81a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" />
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M3 4.75A4.75 4.75 0 0 1 7.75 0h4.5A4.75 4.75 0 0 1 17 4.75v10.5A4.75 4.75 0 0 1 12.25 20h-4.5A4.75 4.75 0 0 1 3 15.25V4.75ZM7.75 2A2.75 2.75 0 0 0 5 4.75v10.5A2.75 2.75 0 0 0 7.75 18h4.5A2.75 2.75 0 0 0 15 15.25V4.75A2.75 2.75 0 0 0 12.25 2h-4.5Z"
- clip-rule="evenodd"
- />
- </svg>`,QRe=Object.freeze(Object.defineProperty({__proto__:null,mobileSvg:JRe},Symbol.toStringTag,{value:"Module"})),XRe=Se`<svg fill="none" viewBox="0 0 41 40">
- <path
- style="fill: var(--wui-color-fg-100);"
- fill-opacity=".05"
- d="M.6 20a20 20 0 1 1 40 0 20 20 0 0 1-40 0Z"
- />
- <path
- fill="#949E9E"
- d="M15.6 20.31a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0ZM23.1 20.31a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0ZM28.1 22.81a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"
- />
- </svg>`,eke=Object.freeze(Object.defineProperty({__proto__:null,moreSvg:XRe},Symbol.toStringTag,{value:"Module"})),tke=Se`<svg fill="none" viewBox="0 0 22 20">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M16.32 13.62a3.14 3.14 0 1 1-.99 1.72l-1.6-.93a3.83 3.83 0 0 1-3.71 1 3.66 3.66 0 0 1-1.74-1l-1.6.94a3.14 3.14 0 1 1-1-1.73l1.6-.94a3.7 3.7 0 0 1 0-2 3.81 3.81 0 0 1 1.8-2.33c.29-.17.6-.3.92-.38V6.1a3.14 3.14 0 1 1 2 0l-.01.02v1.85H12a3.82 3.82 0 0 1 2.33 1.8 3.7 3.7 0 0 1 .39 2.91l1.6.93ZM2.6 16.54a1.14 1.14 0 0 0 1.98-1.14 1.14 1.14 0 0 0-1.98 1.14ZM11 2.01a1.14 1.14 0 1 0 0 2.28 1.14 1.14 0 0 0 0-2.28Zm1.68 10.45c.08-.19.14-.38.16-.58v-.05l.02-.13v-.13a1.92 1.92 0 0 0-.24-.8l-.11-.15a1.89 1.89 0 0 0-.74-.6 1.86 1.86 0 0 0-.77-.17h-.19a1.97 1.97 0 0 0-.89.34 1.98 1.98 0 0 0-.61.74 1.99 1.99 0 0 0-.16.9v.05a1.87 1.87 0 0 0 .24.74l.1.15c.12.16.26.3.42.42l.16.1.13.07.04.02a1.84 1.84 0 0 0 .76.17h.17a2 2 0 0 0 .91-.35 1.78 1.78 0 0 0 .52-.58l.03-.05a.84.84 0 0 0 .05-.11Zm5.15 4.5a1.14 1.14 0 0 0 1.14-1.97 1.13 1.13 0 0 0-1.55.41c-.32.55-.13 1.25.41 1.56Z"
- clip-rule="evenodd"
- />
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M4.63 9.43a1.5 1.5 0 1 0 1.5-2.6 1.5 1.5 0 0 0-1.5 2.6Zm.32-1.55a.5.5 0 0 1 .68-.19.5.5 0 0 1 .18.68.5.5 0 0 1-.68.19.5.5 0 0 1-.18-.68ZM17.94 8.88a1.5 1.5 0 1 1-2.6-1.5 1.5 1.5 0 1 1 2.6 1.5ZM16.9 7.69a.5.5 0 0 0-.68.19.5.5 0 0 0 .18.68.5.5 0 0 0 .68-.19.5.5 0 0 0-.18-.68ZM9.75 17.75a1.5 1.5 0 1 1 2.6 1.5 1.5 1.5 0 1 1-2.6-1.5Zm1.05 1.18a.5.5 0 0 0 .68-.18.5.5 0 0 0-.18-.68.5.5 0 0 0-.68.18.5.5 0 0 0 .18.68Z"
- clip-rule="evenodd"
- />
- </svg>`,rke=Object.freeze(Object.defineProperty({__proto__:null,networkPlaceholderSvg:tke},Symbol.toStringTag,{value:"Module"})),nke=Se`<svg fill="none" viewBox="0 0 20 20">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M9.13 1h1.71c1.46 0 2.63 0 3.56.1.97.1 1.8.33 2.53.85a5 5 0 0 1 1.1 1.11c.53.73.75 1.56.86 2.53.1.93.1 2.1.1 3.55v1.72c0 1.45 0 2.62-.1 3.55-.1.97-.33 1.8-.86 2.53a5 5 0 0 1-1.1 1.1c-.73.53-1.56.75-2.53.86-.93.1-2.1.1-3.55.1H9.13c-1.45 0-2.62 0-3.56-.1-.96-.1-1.8-.33-2.52-.85a5 5 0 0 1-1.1-1.11 5.05 5.05 0 0 1-.86-2.53c-.1-.93-.1-2.1-.1-3.55V9.14c0-1.45 0-2.62.1-3.55.1-.97.33-1.8.85-2.53a5 5 0 0 1 1.1-1.1 5.05 5.05 0 0 1 2.53-.86C6.51 1 7.67 1 9.13 1ZM5.79 3.09a3.1 3.1 0 0 0-1.57.48 3 3 0 0 0-.66.67c-.24.32-.4.77-.48 1.56-.1.82-.1 1.88-.1 3.4v1.6c0 1.15 0 2.04.05 2.76l.41-.42c.5-.5.93-.92 1.32-1.24.41-.33.86-.6 1.43-.7a3 3 0 0 1 .94 0c.35.06.66.2.95.37a17.11 17.11 0 0 0 .8.45c.1-.08.2-.2.41-.4l.04-.03a27 27 0 0 1 1.95-1.84 4.03 4.03 0 0 1 1.91-.94 4 4 0 0 1 1.25 0c.73.11 1.33.46 1.91.94l.64.55V9.2c0-1.52 0-2.58-.1-3.4a3.1 3.1 0 0 0-.48-1.56 3 3 0 0 0-.66-.67 3.1 3.1 0 0 0-1.56-.48C13.37 3 12.3 3 10.79 3h-1.6c-1.52 0-2.59 0-3.4.09Zm11.18 10-.04-.05a26.24 26.24 0 0 0-1.83-1.74c-.45-.36-.73-.48-.97-.52a2 2 0 0 0-.63 0c-.24.04-.51.16-.97.52-.46.38-1.01.93-1.83 1.74l-.02.02c-.17.18-.34.34-.49.47a2.04 2.04 0 0 1-1.08.5 1.97 1.97 0 0 1-1.25-.27l-.79-.46-.02-.02a.65.65 0 0 0-.24-.1 1 1 0 0 0-.31 0c-.08.02-.21.06-.49.28-.3.24-.65.59-1.2 1.14l-.56.56-.65.66a3 3 0 0 0 .62.6c.33.24.77.4 1.57.49.81.09 1.88.09 3.4.09h1.6c1.52 0 2.58 0 3.4-.09a3.1 3.1 0 0 0 1.56-.48 3 3 0 0 0 .66-.67c.24-.32.4-.77.49-1.56l.07-1.12Zm-8.02-1.03ZM4.99 7a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"
- clip-rule="evenodd"
- />
- </svg>`,ike=Object.freeze(Object.defineProperty({__proto__:null,nftPlaceholderSvg:nke},Symbol.toStringTag,{value:"Module"})),ske=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M8 0a1 1 0 0 1 1 1v5.38a1 1 0 0 1-2 0V1a1 1 0 0 1 1-1ZM5.26 2.6a1 1 0 0 1-.28 1.39 5.46 5.46 0 1 0 6.04 0 1 1 0 1 1 1.1-1.67 7.46 7.46 0 1 1-8.25 0 1 1 0 0 1 1.4.28Z"
- clip-rule="evenodd"
- />
- </svg>`,oke=Object.freeze(Object.defineProperty({__proto__:null,offSvg:ske},Symbol.toStringTag,{value:"Module"})),ake=Se` <svg
- width="36"
- height="36"
- fill="none"
- >
- <path
- d="M0 8a8 8 0 0 1 8-8h20a8 8 0 0 1 8 8v20a8 8 0 0 1-8 8H8a8 8 0 0 1-8-8V8Z"
- fill="#fff"
- fill-opacity=".05"
- />
- <path
- d="m18.262 17.513-8.944 9.49v.01a2.417 2.417 0 0 0 3.56 1.452l.026-.017 10.061-5.803-4.703-5.132Z"
- fill="#EA4335"
- />
- <path
- d="m27.307 15.9-.008-.008-4.342-2.52-4.896 4.36 4.913 4.912 4.325-2.494a2.42 2.42 0 0 0 .008-4.25Z"
- fill="#FBBC04"
- />
- <path
- d="M9.318 8.997c-.05.202-.084.403-.084.622V26.39c0 .218.025.42.084.621l9.246-9.247-9.246-8.768Z"
- fill="#4285F4"
- />
- <path
- d="m18.33 18 4.627-4.628-10.053-5.828a2.427 2.427 0 0 0-3.586 1.444L18.329 18Z"
- fill="#34A853"
- />
- <path
- d="M8 .5h20A7.5 7.5 0 0 1 35.5 8v20a7.5 7.5 0 0 1-7.5 7.5H8A7.5 7.5 0 0 1 .5 28V8A7.5 7.5 0 0 1 8 .5Z"
- stroke="#fff"
- stroke-opacity=".05"
- />
- </svg>`,cke=Object.freeze(Object.defineProperty({__proto__:null,playStoreSvg:ake},Symbol.toStringTag,{value:"Module"})),uke=Se`<svg
- width="13"
- height="12"
- viewBox="0 0 13 12"
- fill="none"
- >
- <path
- fill="currentColor"
- fill-rule="evenodd"
- clip-rule="evenodd"
- d="M0.794373 5.99982C0.794373 5.52643 1.17812 5.14268 1.6515 5.14268H5.643V1.15109C5.643 0.677701 6.02675 0.293946 6.50012 0.293945C6.9735 0.293946 7.35725 0.677701 7.35725 1.15109V5.14268H11.3488C11.8221 5.14268 12.2059 5.52643 12.2059 5.99982C12.2059 6.47321 11.8221 6.85696 11.3488 6.85696H7.35725V10.8486C7.35725 11.3219 6.9735 11.7057 6.50012 11.7057C6.02675 11.7057 5.643 11.3219 5.643 10.8486V6.85696H1.6515C1.17812 6.85696 0.794373 6.47321 0.794373 5.99982Z"
- /></svg
- >`,lke=Object.freeze(Object.defineProperty({__proto__:null,plusSvg:uke},Symbol.toStringTag,{value:"Module"})),dke=Se`<svg fill="none" viewBox="0 0 20 20">
- <path
- fill="currentColor"
- d="M3 6a3 3 0 0 1 3-3h1a1 1 0 1 0 0-2H6a5 5 0 0 0-5 5v1a1 1 0 0 0 2 0V6ZM13 1a1 1 0 1 0 0 2h1a3 3 0 0 1 3 3v1a1 1 0 1 0 2 0V6a5 5 0 0 0-5-5h-1ZM3 13a1 1 0 1 0-2 0v1a5 5 0 0 0 5 5h1a1 1 0 1 0 0-2H6a3 3 0 0 1-3-3v-1ZM19 13a1 1 0 1 0-2 0v1a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1.01a5 5 0 0 0 5-5v-1ZM5.3 6.36c-.04.2-.04.43-.04.89s0 .7.05.89c.14.52.54.92 1.06 1.06.19.05.42.05.89.05.46 0 .7 0 .88-.05A1.5 1.5 0 0 0 9.2 8.14c.06-.2.06-.43.06-.89s0-.7-.06-.89A1.5 1.5 0 0 0 8.14 5.3c-.19-.05-.42-.05-.88-.05-.47 0-.7 0-.9.05a1.5 1.5 0 0 0-1.05 1.06ZM10.8 6.36c-.04.2-.04.43-.04.89s0 .7.05.89c.14.52.54.92 1.06 1.06.19.05.42.05.89.05.46 0 .7 0 .88-.05a1.5 1.5 0 0 0 1.06-1.06c.06-.2.06-.43.06-.89s0-.7-.06-.89a1.5 1.5 0 0 0-1.06-1.06c-.19-.05-.42-.05-.88-.05-.47 0-.7 0-.9.05a1.5 1.5 0 0 0-1.05 1.06ZM5.26 12.75c0-.46 0-.7.05-.89a1.5 1.5 0 0 1 1.06-1.06c.19-.05.42-.05.89-.05.46 0 .7 0 .88.05.52.14.93.54 1.06 1.06.06.2.06.43.06.89s0 .7-.06.89a1.5 1.5 0 0 1-1.06 1.06c-.19.05-.42.05-.88.05-.47 0-.7 0-.9-.05a1.5 1.5 0 0 1-1.05-1.06c-.05-.2-.05-.43-.05-.89ZM10.8 11.86c-.04.2-.04.43-.04.89s0 .7.05.89c.14.52.54.92 1.06 1.06.19.05.42.05.89.05.46 0 .7 0 .88-.05a1.5 1.5 0 0 0 1.06-1.06c.06-.2.06-.43.06-.89s0-.7-.06-.89a1.5 1.5 0 0 0-1.06-1.06c-.19-.05-.42-.05-.88-.05-.47 0-.7 0-.9.05a1.5 1.5 0 0 0-1.05 1.06Z"
- />
- </svg>`,hke=Object.freeze(Object.defineProperty({__proto__:null,qrCodeIcon:dke},Symbol.toStringTag,{value:"Module"})),fke=Se`<svg
- fill="none"
- viewBox="0 0 21 20"
- >
- <path
- fill="currentColor"
- d="M8.8071 0.292893C9.19763 0.683417 9.19763 1.31658 8.8071 1.70711L6.91421 3.6H11.8404C14.3368 3.6 16.5533 5.1975 17.3427 7.56588L17.4487 7.88377C17.6233 8.40772 17.3402 8.97404 16.8162 9.14868C16.2923 9.32333 15.726 9.04017 15.5513 8.51623L15.4453 8.19834C14.9281 6.64664 13.476 5.6 11.8404 5.6H6.91421L8.8071 7.49289C9.19763 7.88342 9.19763 8.51658 8.8071 8.90711C8.41658 9.29763 7.78341 9.29763 7.39289 8.90711L3.79289 5.30711C3.40236 4.91658 3.40236 4.28342 3.79289 3.89289L7.39289 0.292893C7.78341 -0.0976311 8.41658 -0.0976311 8.8071 0.292893ZM4.18377 10.8513C4.70771 10.6767 5.27403 10.9598 5.44868 11.4838L5.55464 11.8017C6.07188 13.3534 7.52401 14.4 9.15964 14.4L14.0858 14.4L12.1929 12.5071C11.8024 12.1166 11.8024 11.4834 12.1929 11.0929C12.5834 10.7024 13.2166 10.7024 13.6071 11.0929L17.2071 14.6929C17.5976 15.0834 17.5976 15.7166 17.2071 16.1071L13.6071 19.7071C13.2166 20.0976 12.5834 20.0976 12.1929 19.7071C11.8024 19.3166 11.8024 18.6834 12.1929 18.2929L14.0858 16.4L9.15964 16.4C6.66314 16.4 4.44674 14.8025 3.65728 12.4341L3.55131 12.1162C3.37667 11.5923 3.65983 11.026 4.18377 10.8513Z"
- /></svg
- >`,pke=Object.freeze(Object.defineProperty({__proto__:null,recycleHorizontalSvg:fke},Symbol.toStringTag,{value:"Module"})),gke=Se`<svg fill="none" viewBox="0 0 14 16">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M3.94 1.04a1 1 0 0 1 .7 1.23l-.48 1.68a5.85 5.85 0 0 1 8.53 4.32 5.86 5.86 0 0 1-11.4 2.56 1 1 0 0 1 1.9-.57 3.86 3.86 0 1 0 1.83-4.5l1.87.53a1 1 0 0 1-.55 1.92l-4.1-1.15a1 1 0 0 1-.69-1.23l1.16-4.1a1 1 0 0 1 1.23-.7Z"
- clip-rule="evenodd"
- />
- </svg>`,mke=Object.freeze(Object.defineProperty({__proto__:null,refreshSvg:gke},Symbol.toStringTag,{value:"Module"})),wke=Se`<svg fill="none" viewBox="0 0 20 20">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M9.36 4.21a5.14 5.14 0 1 0 0 10.29 5.14 5.14 0 0 0 0-10.29ZM1.64 9.36a7.71 7.71 0 1 1 14 4.47l2.52 2.5a1.29 1.29 0 1 1-1.82 1.83l-2.51-2.51A7.71 7.71 0 0 1 1.65 9.36Z"
- clip-rule="evenodd"
- />
- </svg>`,bke=Object.freeze(Object.defineProperty({__proto__:null,searchSvg:wke},Symbol.toStringTag,{value:"Module"})),yke=Se`<svg fill="none" viewBox="0 0 21 20">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M14.3808 4.34812C13.72 4.47798 12.8501 4.7587 11.5748 5.17296L9.00869 6.00646C6.90631 6.68935 5.40679 7.17779 4.38121 7.63178C3.87166 7.85734 3.5351 8.05091 3.32022 8.22035C3.11183 8.38466 3.07011 8.48486 3.05969 8.51817C2.98058 8.77103 2.98009 9.04195 3.05831 9.29509C3.06861 9.32844 3.10998 9.42878 3.31777 9.59384C3.53205 9.76404 3.86792 9.95881 4.37667 10.1862C5.29287 10.5957 6.58844 11.0341 8.35529 11.6164L10.8876 8.59854C11.2426 8.17547 11.8733 8.12028 12.2964 8.47528C12.7195 8.83029 12.7746 9.46104 12.4196 9.88412L9.88738 12.9019C10.7676 14.5408 11.4244 15.7406 11.9867 16.5718C12.299 17.0333 12.5491 17.3303 12.7539 17.5117C12.9526 17.6877 13.0586 17.711 13.0932 17.7154C13.3561 17.7484 13.6228 17.7009 13.8581 17.5791C13.8891 17.563 13.9805 17.5046 14.1061 17.2708C14.2357 17.0298 14.3679 16.6647 14.5015 16.1237C14.7705 15.0349 14.9912 13.4733 15.2986 11.2843L15.6738 8.61249C15.8603 7.28456 15.9857 6.37917 15.9989 5.7059C16.012 5.03702 15.9047 4.8056 15.8145 4.69183C15.7044 4.55297 15.5673 4.43792 15.4114 4.35365C15.2837 4.28459 15.0372 4.2191 14.3808 4.34812ZM7.99373 13.603C6.11919 12.9864 4.6304 12.4902 3.5606 12.0121C2.98683 11.7557 2.4778 11.4808 2.07383 11.1599C1.66337 10.8339 1.31312 10.4217 1.14744 9.88551C0.949667 9.24541 0.950886 8.56035 1.15094 7.92096C1.31852 7.38534 1.67024 6.97442 2.08185 6.64985C2.48697 6.33041 2.99697 6.05734 3.57166 5.80295C4.70309 5.3021 6.30179 4.78283 8.32903 4.12437L11.0196 3.25042C12.2166 2.86159 13.2017 2.54158 13.9951 2.38566C14.8065 2.22618 15.6202 2.19289 16.3627 2.59437C16.7568 2.80747 17.1035 3.09839 17.3818 3.4495C17.9062 4.111 18.0147 4.91815 17.9985 5.74496C17.9827 6.55332 17.8386 7.57903 17.6636 8.82534L17.2701 11.6268C16.9737 13.7376 16.7399 15.4022 16.4432 16.6034C16.2924 17.2135 16.1121 17.7632 15.8678 18.2176C15.6197 18.6794 15.2761 19.0971 14.7777 19.3551C14.1827 19.6632 13.5083 19.7833 12.8436 19.6997C12.2867 19.6297 11.82 19.3563 11.4277 19.0087C11.0415 18.6666 10.6824 18.213 10.3302 17.6925C9.67361 16.722 8.92648 15.342 7.99373 13.603Z"
- clip-rule="evenodd"
- />
- <svg
- xmlns="http://www.w3.org/2000/svg"
- width="21"
- height="20"
- viewBox="0 0 21 20"
- fill="none"
- ></svg></svg
- >`,vke=Object.freeze(Object.defineProperty({__proto__:null,sendSvg:yke},Symbol.toStringTag,{value:"Module"})),_ke=Se`<svg fill="none" viewBox="0 0 20 20">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M6.76.3a1 1 0 0 1 0 1.4L4.07 4.4h9a1 1 0 1 1 0 2h-9l2.69 2.68a1 1 0 1 1-1.42 1.42L.95 6.09a1 1 0 0 1 0-1.4l4.4-4.4a1 1 0 0 1 1.4 0Zm6.49 9.21a1 1 0 0 1 1.41 0l4.39 4.4a1 1 0 0 1 0 1.4l-4.39 4.4a1 1 0 0 1-1.41-1.42l2.68-2.68h-9a1 1 0 0 1 0-2h9l-2.68-2.68a1 1 0 0 1 0-1.42Z"
- clip-rule="evenodd"
- />
- </svg>`,Eke=Object.freeze(Object.defineProperty({__proto__:null,swapHorizontalSvg:_ke},Symbol.toStringTag,{value:"Module"})),Cke=Se`<svg
- width="14"
- height="14"
- viewBox="0 0 14 14"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- fill-rule="evenodd"
- clip-rule="evenodd"
- d="M13.7306 3.24213C14.0725 3.58384 14.0725 4.13786 13.7306 4.47957L10.7418 7.46737C10.4 7.80908 9.84581 7.80908 9.50399 7.46737C9.16216 7.12567 9.16216 6.57165 9.50399 6.22994L10.9986 4.73585H5.34082C4.85741 4.73585 4.46553 4.3441 4.46553 3.86085C4.46553 3.3776 4.85741 2.98585 5.34082 2.98585L10.9986 2.98585L9.50399 1.49177C9.16216 1.15006 9.16216 0.596037 9.50399 0.254328C9.84581 -0.0873803 10.4 -0.0873803 10.7418 0.254328L13.7306 3.24213ZM9.52515 10.1352C9.52515 10.6185 9.13327 11.0102 8.64986 11.0102L2.9921 11.0102L4.48669 12.5043C4.82852 12.846 4.82852 13.4001 4.48669 13.7418C4.14487 14.0835 3.59066 14.0835 3.24884 13.7418L0.26003 10.754C0.0958806 10.5899 0.0036621 10.3673 0.00366211 10.1352C0.00366212 9.90318 0.0958806 9.68062 0.26003 9.51652L3.24884 6.52872C3.59066 6.18701 4.14487 6.18701 4.48669 6.52872C4.82851 6.87043 4.82851 7.42445 4.48669 7.76616L2.9921 9.26024L8.64986 9.26024C9.13327 9.26024 9.52515 9.65199 9.52515 10.1352Z"
- fill="currentColor"
- />
- </svg>
- `,Ake=Object.freeze(Object.defineProperty({__proto__:null,swapHorizontalMediumSvg:Cke},Symbol.toStringTag,{value:"Module"})),xke=Se`<svg width="10" height="10" viewBox="0 0 10 10">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M3.77986 0.566631C4.0589 0.845577 4.0589 1.29784 3.77986 1.57678L3.08261 2.2738H6.34184C6.73647 2.2738 7.05637 2.5936 7.05637 2.98808C7.05637 3.38257 6.73647 3.70237 6.34184 3.70237H3.08261L3.77986 4.39938C4.0589 4.67833 4.0589 5.13059 3.77986 5.40954C3.50082 5.68848 3.04841 5.68848 2.76937 5.40954L0.852346 3.49316C0.573306 3.21421 0.573306 2.76195 0.852346 2.48301L2.76937 0.566631C3.04841 0.287685 3.50082 0.287685 3.77986 0.566631ZM6.22 4.59102C6.49904 4.31208 6.95145 4.31208 7.23049 4.59102L9.14751 6.5074C9.42655 6.78634 9.42655 7.23861 9.14751 7.51755L7.23049 9.43393C6.95145 9.71287 6.49904 9.71287 6.22 9.43393C5.94096 9.15498 5.94096 8.70272 6.22 8.42377L6.91725 7.72676L3.65802 7.72676C3.26339 7.72676 2.94349 7.40696 2.94349 7.01247C2.94349 6.61798 3.26339 6.29819 3.65802 6.29819L6.91725 6.29819L6.22 5.60117C5.94096 5.32223 5.94096 4.86997 6.22 4.59102Z"
- clip-rule="evenodd"
- />
- </svg>`,Ske=Object.freeze(Object.defineProperty({__proto__:null,swapHorizontalBoldSvg:xke},Symbol.toStringTag,{value:"Module"})),Tke=Se`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- clip-rule="evenodd"
- d="M8.3071 0.292893C8.69763 0.683417 8.69763 1.31658 8.3071 1.70711L6.41421 3.6H11.3404C13.8368 3.6 16.0533 5.1975 16.8427 7.56588L16.9487 7.88377C17.1233 8.40772 16.8402 8.97404 16.3162 9.14868C15.7923 9.32333 15.226 9.04017 15.0513 8.51623L14.9453 8.19834C14.4281 6.64664 12.976 5.6 11.3404 5.6H6.41421L8.3071 7.49289C8.69763 7.88342 8.69763 8.51658 8.3071 8.90711C7.91658 9.29763 7.28341 9.29763 6.89289 8.90711L3.29289 5.30711C2.90236 4.91658 2.90236 4.28342 3.29289 3.89289L6.89289 0.292893C7.28341 -0.0976311 7.91658 -0.0976311 8.3071 0.292893ZM3.68377 10.8513C4.20771 10.6767 4.77403 10.9598 4.94868 11.4838L5.05464 11.8017C5.57188 13.3534 7.024 14.4 8.65964 14.4L13.5858 14.4L11.6929 12.5071C11.3024 12.1166 11.3024 11.4834 11.6929 11.0929C12.0834 10.7024 12.7166 10.7024 13.1071 11.0929L16.7071 14.6929C17.0976 15.0834 17.0976 15.7166 16.7071 16.1071L13.1071 19.7071C12.7166 20.0976 12.0834 20.0976 11.6929 19.7071C11.3024 19.3166 11.3024 18.6834 11.6929 18.2929L13.5858 16.4L8.65964 16.4C6.16314 16.4 3.94674 14.8025 3.15728 12.4341L3.05131 12.1162C2.87667 11.5923 3.15983 11.026 3.68377 10.8513Z"
- />
- </svg>`,Ike=Object.freeze(Object.defineProperty({__proto__:null,swapHorizontalRoundedBoldSvg:Tke},Symbol.toStringTag,{value:"Module"})),Pke=Se`<svg fill="none" viewBox="0 0 14 14">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M3.48 2.18a1 1 0 0 1 1.41 0l2.68 2.68a1 1 0 1 1-1.41 1.42l-.98-.98v4.56a1 1 0 0 1-2 0V5.3l-.97.98A1 1 0 0 1 .79 4.86l2.69-2.68Zm6.34 2.93a1 1 0 0 1 1 1v4.56l.97-.98a1 1 0 1 1 1.42 1.42l-2.69 2.68a1 1 0 0 1-1.41 0l-2.68-2.68a1 1 0 0 1 1.41-1.42l.98.98V6.1a1 1 0 0 1 1-1Z"
- clip-rule="evenodd"
- />
- </svg>`,Oke=Object.freeze(Object.defineProperty({__proto__:null,swapVerticalSvg:Pke},Symbol.toStringTag,{value:"Module"})),Rke=Se`<svg width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
- <g clip-path="url(#a)">
- <path fill="url(#b)" d="M0 0h32v32H0z"/>
- <path fill-rule="evenodd" clip-rule="evenodd" d="M7.034 15.252c4.975-2.167 8.293-3.596 9.953-4.287 4.74-1.971 5.725-2.314 6.366-2.325.142-.002.457.033.662.198.172.14.22.33.243.463.022.132.05.435.028.671-.257 2.7-1.368 9.248-1.933 12.27-.24 1.28-.71 1.708-1.167 1.75-.99.091-1.743-.655-2.703-1.284-1.502-.985-2.351-1.598-3.81-2.558-1.684-1.11-.592-1.721.368-2.718.252-.261 4.619-4.233 4.703-4.594.01-.045.02-.213-.08-.301-.1-.09-.246-.059-.353-.035-.15.034-2.55 1.62-7.198 4.758-.682.468-1.298.696-1.851.684-.61-.013-1.782-.344-2.653-.628-1.069-.347-1.918-.53-1.845-1.12.039-.308.462-.623 1.27-.944Z" fill="#fff"/>
- </g>
- <path d="M.5 16C.5 7.44 7.44.5 16 .5 24.56.5 31.5 7.44 31.5 16c0 8.56-6.94 15.5-15.5 15.5C7.44 31.5.5 24.56.5 16Z" stroke="#141414" stroke-opacity=".05"/>
- <defs>
- <linearGradient id="b" x1="1600" y1="0" x2="1600" y2="3176.27" gradientUnits="userSpaceOnUse">
- <stop stop-color="#2AABEE"/>
- <stop offset="1" stop-color="#229ED9"/>
- </linearGradient>
- <clipPath id="a">
- <path d="M0 16C0 7.163 7.163 0 16 0s16 7.163 16 16-7.163 16-16 16S0 24.837 0 16Z" fill="#fff"/>
- </clipPath>
- </defs>
- </svg>`,kke=Object.freeze(Object.defineProperty({__proto__:null,telegramSvg:Rke},Symbol.toStringTag,{value:"Module"})),Nke=Se`<svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M7 3.71875C6.0335 3.71875 5.25 2.93525 5.25 1.96875C5.25 1.00225 6.0335 0.21875 7 0.21875C7.9665 0.21875 8.75 1.00225 8.75 1.96875C8.75 2.93525 7.9665 3.71875 7 3.71875Z" fill="#949E9E"/>
- <path d="M7 8.96875C6.0335 8.96875 5.25 8.18525 5.25 7.21875C5.25 6.25225 6.0335 5.46875 7 5.46875C7.9665 5.46875 8.75 6.25225 8.75 7.21875C8.75 8.18525 7.9665 8.96875 7 8.96875Z" fill="#949E9E"/>
- <path d="M5.25 12.4688C5.25 13.4352 6.0335 14.2187 7 14.2187C7.9665 14.2187 8.75 13.4352 8.75 12.4688C8.75 11.5023 7.9665 10.7188 7 10.7188C6.0335 10.7188 5.25 11.5023 5.25 12.4688Z" fill="#949E9E"/>
- </svg>`,$ke=Object.freeze(Object.defineProperty({__proto__:null,threeDotsSvg:Nke},Symbol.toStringTag,{value:"Module"})),jke=Se`<svg fill="none" viewBox="0 0 40 40">
- <g clip-path="url(#a)">
- <g clip-path="url(#b)">
- <circle cx="20" cy="19.89" r="20" fill="#5A3E85" />
- <g clip-path="url(#c)">
- <path
- fill="#fff"
- d="M18.22 25.7 20 23.91h3.34l2.1-2.1v-6.68H15.4v8.78h2.82v1.77Zm3.87-8.16h1.25v3.66H22.1v-3.66Zm-3.34 0H20v3.66h-1.25v-3.66ZM20 7.9a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.69 14.56-3.66 3.66h-2.72l-1.77 1.78h-1.88V26.1H13.3v-9.82l.94-2.4H26.7v8.56Z"
- />
- </g>
- </g>
- </g>
- <defs>
- <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
- <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
- <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
- </defs>
- </svg>`,Bke=Object.freeze(Object.defineProperty({__proto__:null,twitchSvg:jke},Symbol.toStringTag,{value:"Module"})),Dke=Se`<svg fill="none" viewBox="0 0 41 40">
- <g clip-path="url(#a)">
- <path fill="#000" d="M.8 0h40v40H.8z" />
- <path
- fill="#fff"
- d="m22.63 18.46 7.14-8.3h-1.69l-6.2 7.2-4.96-7.2H11.2l7.5 10.9-7.5 8.71h1.7l6.55-7.61 5.23 7.61h5.72l-7.77-11.31Zm-9.13-7.03h2.6l11.98 17.13h-2.6L13.5 11.43Z"
- />
- </g>
- <defs>
- <clipPath id="a"><path fill="#fff" d="M.8 20a20 20 0 1 1 40 0 20 20 0 0 1-40 0Z" /></clipPath>
- </defs>
- </svg>`,VW=Object.freeze(Object.defineProperty({__proto__:null,xSvg:Dke},Symbol.toStringTag,{value:"Module"})),Mke=Se`<svg fill="none" viewBox="0 0 16 16">
- <path
- fill="currentColor"
- d="m14.36 4.74.01.42c0 4.34-3.3 9.34-9.34 9.34A9.3 9.3 0 0 1 0 13.03a6.6 6.6 0 0 0 4.86-1.36 3.29 3.29 0 0 1-3.07-2.28c.5.1 1 .07 1.48-.06A3.28 3.28 0 0 1 .64 6.11v-.04c.46.26.97.4 1.49.41A3.29 3.29 0 0 1 1.11 2.1a9.32 9.32 0 0 0 6.77 3.43 3.28 3.28 0 0 1 5.6-3 6.59 6.59 0 0 0 2.08-.8 3.3 3.3 0 0 1-1.45 1.82A6.53 6.53 0 0 0 16 3.04c-.44.66-1 1.23-1.64 1.7Z"
- />
- </svg>`,Lke=Object.freeze(Object.defineProperty({__proto__:null,twitterIconSvg:Mke},Symbol.toStringTag,{value:"Module"})),Uke=Se`<svg fill="none" viewBox="0 0 28 28">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M18.1 4.76c-.42-.73-1.33-1.01-2.09-.66l-1.42.66c-.37.18-.8.18-1.18 0l-1.4-.65a1.63 1.63 0 0 0-2.1.66l-.84 1.45c-.2.34-.53.59-.92.67l-1.7.35c-.83.17-1.39.94-1.3 1.78l.19 1.56c.04.39-.08.78-.33 1.07l-1.12 1.3c-.52.6-.52 1.5 0 2.11L5 16.38c.25.3.37.68.33 1.06l-.18 1.57c-.1.83.46 1.6 1.28 1.78l1.7.35c.4.08.73.32.93.66l.84 1.43a1.63 1.63 0 0 0 2.09.66l1.41-.66c.37-.17.8-.17 1.18 0l1.43.67c.76.35 1.66.07 2.08-.65l.86-1.45c.2-.34.54-.58.92-.66l1.68-.35A1.63 1.63 0 0 0 22.84 19l-.18-1.57a1.4 1.4 0 0 1 .33-1.06l1.12-1.32c.52-.6.52-1.5 0-2.11l-1.12-1.3a1.4 1.4 0 0 1-.33-1.07l.18-1.57c.1-.83-.46-1.6-1.28-1.77l-1.68-.35a1.4 1.4 0 0 1-.92-.66l-.86-1.47Zm-3.27-3.2a4.43 4.43 0 0 1 5.69 1.78l.54.93 1.07.22a4.43 4.43 0 0 1 3.5 4.84l-.11.96.7.83a4.43 4.43 0 0 1 .02 5.76l-.72.85.1.96a4.43 4.43 0 0 1-3.5 4.84l-1.06.22-.54.92a4.43 4.43 0 0 1-5.68 1.77l-.84-.4-.82.39a4.43 4.43 0 0 1-5.7-1.79l-.51-.89-1.09-.22a4.43 4.43 0 0 1-3.5-4.84l.1-.96-.72-.85a4.43 4.43 0 0 1 .01-5.76l.71-.83-.1-.95a4.43 4.43 0 0 1 3.5-4.84l1.08-.23.53-.9a4.43 4.43 0 0 1 5.7-1.8l.81.38.83-.39ZM18.2 9.4c.65.42.84 1.28.42 1.93l-4.4 6.87a1.4 1.4 0 0 1-2.26.14L9.5 15.39a1.4 1.4 0 0 1 2.15-1.8l1.23 1.48 3.38-5.26a1.4 1.4 0 0 1 1.93-.42Z"
- clip-rule="evenodd"
- />
- </svg>`,Fke=Object.freeze(Object.defineProperty({__proto__:null,verifySvg:Uke},Symbol.toStringTag,{value:"Module"})),Hke=Se`<svg fill="none" viewBox="0 0 14 14">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="m4.1 12.43-.45-.78-.93-.2a1.65 1.65 0 0 1-1.31-1.8l.1-.86-.61-.71a1.65 1.65 0 0 1 0-2.16l.6-.7-.09-.85c-.1-.86.47-1.64 1.3-1.81l.94-.2.45-.78A1.65 1.65 0 0 1 6.23.9l.77.36.78-.36c.77-.36 1.69-.07 2.12.66l.47.8.91.2c.84.17 1.4.95 1.31 1.8l-.1.86.6.7c.54.62.54 1.54.01 2.16l-.6.71.09.86c.1.85-.47 1.63-1.3 1.8l-.92.2-.47.79a1.65 1.65 0 0 1-2.12.66L7 12.74l-.77.36c-.78.35-1.7.07-2.13-.67Zm5.74-6.9a1 1 0 1 0-1.68-1.07L6.32 7.3l-.55-.66a1 1 0 0 0-1.54 1.28l1.43 1.71a1 1 0 0 0 1.61-.1l2.57-4Z"
- clip-rule="evenodd"
- />
- </svg>`,qke=Object.freeze(Object.defineProperty({__proto__:null,verifyFilledSvg:Hke},Symbol.toStringTag,{value:"Module"})),zke=Se`<svg fill="none" viewBox="0 0 20 20">
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M0 5.5c0-1.8 1.46-3.25 3.25-3.25H14.5c1.8 0 3.25 1.46 3.25 3.25v.28A3.25 3.25 0 0 1 20 8.88v2.24c0 1.45-.94 2.68-2.25 3.1v.28c0 1.8-1.46 3.25-3.25 3.25H3.25A3.25 3.25 0 0 1 0 14.5v-9Zm15.75 8.88h-2.38a4.38 4.38 0 0 1 0-8.76h2.38V5.5c0-.69-.56-1.25-1.25-1.25H3.25C2.56 4.25 2 4.81 2 5.5v9c0 .69.56 1.25 1.25 1.25H14.5c.69 0 1.25-.56 1.25-1.25v-.13Zm-2.38-6.76a2.37 2.37 0 1 0 0 4.75h3.38c.69 0 1.25-.55 1.25-1.24V8.87c0-.69-.56-1.24-1.25-1.24h-3.38Z"
- clip-rule="evenodd"
- />
- </svg>`,Wke=Object.freeze(Object.defineProperty({__proto__:null,walletSvg:zke},Symbol.toStringTag,{value:"Module"})),Vke=Se`<svg fill="none" viewBox="0 0 96 67">
- <path
- fill="currentColor"
- d="M25.32 18.8a32.56 32.56 0 0 1 45.36 0l1.5 1.47c.63.62.63 1.61 0 2.22l-5.15 5.05c-.31.3-.82.3-1.14 0l-2.07-2.03a22.71 22.71 0 0 0-31.64 0l-2.22 2.18c-.31.3-.82.3-1.14 0l-5.15-5.05a1.55 1.55 0 0 1 0-2.22l1.65-1.62Zm56.02 10.44 4.59 4.5c.63.6.63 1.6 0 2.21l-20.7 20.26c-.62.61-1.63.61-2.26 0L48.28 41.83a.4.4 0 0 0-.56 0L33.03 56.21c-.63.61-1.64.61-2.27 0L10.07 35.95a1.55 1.55 0 0 1 0-2.22l4.59-4.5a1.63 1.63 0 0 1 2.27 0L31.6 43.63a.4.4 0 0 0 .57 0l14.69-14.38a1.63 1.63 0 0 1 2.26 0l14.69 14.38a.4.4 0 0 0 .57 0l14.68-14.38a1.63 1.63 0 0 1 2.27 0Z"
- />
- <path
- stroke="#000"
- stroke-opacity=".1"
- d="M25.67 19.15a32.06 32.06 0 0 1 44.66 0l1.5 1.48c.43.42.43 1.09 0 1.5l-5.15 5.05a.31.31 0 0 1-.44 0l-2.07-2.03a23.21 23.21 0 0 0-32.34 0l-2.22 2.18a.31.31 0 0 1-.44 0l-5.15-5.05a1.05 1.05 0 0 1 0-1.5l1.65-1.63ZM81 29.6l4.6 4.5c.42.41.42 1.09 0 1.5l-20.7 20.26c-.43.43-1.14.43-1.57 0L48.63 41.47a.9.9 0 0 0-1.26 0L32.68 55.85c-.43.43-1.14.43-1.57 0L10.42 35.6a1.05 1.05 0 0 1 0-1.5l4.59-4.5a1.13 1.13 0 0 1 1.57 0l14.68 14.38a.9.9 0 0 0 1.27 0l-.35-.35.35.35L47.22 29.6a1.13 1.13 0 0 1 1.56 0l14.7 14.38a.9.9 0 0 0 1.26 0L79.42 29.6a1.13 1.13 0 0 1 1.57 0Z"
- />
- </svg>`,Gke=Se`
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
- <g clip-path="url(#clip0_22274_4692)">
- <path d="M0 6.64C0 4.17295 0 2.93942 0.525474 2.01817C0.880399 1.39592 1.39592 0.880399 2.01817 0.525474C2.93942 0 4.17295 0 6.64 0H9.36C11.8271 0 13.0606 0 13.9818 0.525474C14.6041 0.880399 15.1196 1.39592 15.4745 2.01817C16 2.93942 16 4.17295 16 6.64V9.36C16 11.8271 16 13.0606 15.4745 13.9818C15.1196 14.6041 14.6041 15.1196 13.9818 15.4745C13.0606 16 11.8271 16 9.36 16H6.64C4.17295 16 2.93942 16 2.01817 15.4745C1.39592 15.1196 0.880399 14.6041 0.525474 13.9818C0 13.0606 0 11.8271 0 9.36V6.64Z" fill="#C7B994"/>
- <path d="M4.49038 5.76609C6.42869 3.86833 9.5713 3.86833 11.5096 5.76609L11.7429 5.99449C11.8398 6.08938 11.8398 6.24323 11.7429 6.33811L10.9449 7.11942C10.8964 7.16686 10.8179 7.16686 10.7694 7.11942L10.4484 6.80512C9.09617 5.48119 6.90381 5.48119 5.5516 6.80512L5.20782 7.14171C5.15936 7.18915 5.08079 7.18915 5.03234 7.14171L4.23434 6.3604C4.13742 6.26552 4.13742 6.11167 4.23434 6.01678L4.49038 5.76609ZM13.1599 7.38192L13.8702 8.07729C13.9671 8.17217 13.9671 8.32602 13.8702 8.4209L10.6677 11.5564C10.5708 11.6513 10.4137 11.6513 10.3168 11.5564L8.04388 9.33105C8.01965 9.30733 7.98037 9.30733 7.95614 9.33105L5.6833 11.5564C5.58638 11.6513 5.42925 11.6513 5.33234 11.5564L2.12982 8.42087C2.0329 8.32598 2.0329 8.17213 2.12982 8.07724L2.84004 7.38188C2.93695 7.28699 3.09408 7.28699 3.191 7.38188L5.46392 9.60726C5.48815 9.63098 5.52743 9.63098 5.55166 9.60726L7.82447 7.38188C7.92138 7.28699 8.07851 7.28699 8.17543 7.38187L10.4484 9.60726C10.4726 9.63098 10.5119 9.63098 10.5361 9.60726L12.809 7.38192C12.9059 7.28703 13.063 7.28703 13.1599 7.38192Z" fill="#202020"/>
- </g>
- <defs>
- <clipPath id="clip0_22274_4692">
- <path d="M0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8Z" fill="white"/>
- </clipPath>
- </defs>
- </svg>
- `,Kke=Se`
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
- <circle cx="11" cy="11" r="11" transform="matrix(-1 0 0 1 23 1)" fill="#202020"/>
- <circle cx="11" cy="11" r="11.5" transform="matrix(-1 0 0 1 23 1)" stroke="#C7B994" stroke-opacity="0.7"/>
- <path d="M15.4523 11.0686L16.7472 9.78167C13.8205 6.87297 10.1838 6.87297 7.25708 9.78167L8.55201 11.0686C10.7779 8.85645 13.2279 8.85645 15.4538 11.0686H15.4523Z" fill="#C7B994"/>
- <path d="M15.0199 14.067L12 11.0656L8.98 14.067L5.96004 11.0656L4.66663 12.3511L8.98 16.6393L12 13.638L15.0199 16.6393L19.3333 12.3511L18.0399 11.0656L15.0199 14.067Z" fill="#C7B994"/>
- </svg>
- `,VT=Object.freeze(Object.defineProperty({__proto__:null,walletConnectBrownSvg:Kke,walletConnectLightBrownSvg:Gke,walletConnectSvg:Vke},Symbol.toStringTag,{value:"Module"})),Zke=Se`
- <svg fill="none" viewBox="0 0 48 44">
- <path
- style="fill: var(--wui-color-bg-300);"
- d="M4.56 8.64c-1.23 1.68-1.23 4.08-1.23 8.88v8.96c0 4.8 0 7.2 1.23 8.88.39.55.87 1.02 1.41 1.42C7.65 38 10.05 38 14.85 38h14.3c4.8 0 7.2 0 8.88-1.22a6.4 6.4 0 0 0 1.41-1.42c.83-1.14 1.1-2.6 1.19-4.92a6.4 6.4 0 0 0 5.16-4.65c.21-.81.21-1.8.21-3.79 0-1.98 0-2.98-.22-3.79a6.4 6.4 0 0 0-5.15-4.65c-.1-2.32-.36-3.78-1.19-4.92a6.4 6.4 0 0 0-1.41-1.42C36.35 6 33.95 6 29.15 6h-14.3c-4.8 0-7.2 0-8.88 1.22a6.4 6.4 0 0 0-1.41 1.42Z"
- />
- <path
- style="fill: var(--wui-color-fg-200);"
- fill-rule="evenodd"
- d="M2.27 11.33a6.4 6.4 0 0 1 6.4-6.4h26.66a6.4 6.4 0 0 1 6.4 6.4v1.7a6.4 6.4 0 0 1 5.34 6.3v5.34a6.4 6.4 0 0 1-5.34 6.3v1.7a6.4 6.4 0 0 1-6.4 6.4H8.67a6.4 6.4 0 0 1-6.4-6.4V11.33ZM39.6 31.07h-6.93a9.07 9.07 0 1 1 0-18.14h6.93v-1.6a4.27 4.27 0 0 0-4.27-4.26H8.67a4.27 4.27 0 0 0-4.27 4.26v21.34a4.27 4.27 0 0 0 4.27 4.26h26.66a4.27 4.27 0 0 0 4.27-4.26v-1.6Zm-6.93-16a6.93 6.93 0 0 0 0 13.86h8a4.27 4.27 0 0 0 4.26-4.26v-5.34a4.27 4.27 0 0 0-4.26-4.26h-8Z"
- clip-rule="evenodd"
- />
- </svg>
- `,Yke=Object.freeze(Object.defineProperty({__proto__:null,walletPlaceholderSvg:Zke},Symbol.toStringTag,{value:"Module"})),Jke=Se`<svg fill="none" viewBox="0 0 20 20">
- <path
- fill="currentColor"
- d="M11 6.67a1 1 0 1 0-2 0v2.66a1 1 0 0 0 2 0V6.67ZM10 14.5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"
- />
- <path
- fill="currentColor"
- fill-rule="evenodd"
- d="M10 1a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm-7 9a7 7 0 1 1 14 0 7 7 0 0 1-14 0Z"
- clip-rule="evenodd"
- />
- </svg>`,Qke=Object.freeze(Object.defineProperty({__proto__:null,warningCircleSvg:Jke},Symbol.toStringTag,{value:"Module"})),Xke=Se`<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M9.125 6.875C9.125 6.57833 9.21298 6.28832 9.3778 6.04165C9.54262 5.79497 9.77689 5.60271 10.051 5.48918C10.3251 5.37565 10.6267 5.34594 10.9176 5.40382C11.2086 5.4617 11.4759 5.60456 11.6857 5.81434C11.8954 6.02412 12.0383 6.29139 12.0962 6.58236C12.1541 6.87334 12.1244 7.17494 12.0108 7.44903C11.8973 7.72311 11.705 7.95738 11.4584 8.1222C11.2117 8.28703 10.9217 8.375 10.625 8.375C10.2272 8.375 9.84565 8.21696 9.56434 7.93566C9.28304 7.65436 9.125 7.27282 9.125 6.875ZM21.125 11C21.125 13.0025 20.5312 14.9601 19.4186 16.6251C18.3061 18.2902 16.7248 19.5879 14.8747 20.3543C13.0246 21.1206 10.9888 21.3211 9.02471 20.9305C7.06066 20.5398 5.25656 19.5755 3.84055 18.1595C2.42454 16.7435 1.46023 14.9393 1.06955 12.9753C0.678878 11.0112 0.879387 8.97543 1.64572 7.12533C2.41206 5.27523 3.70981 3.69392 5.37486 2.58137C7.0399 1.46882 8.99747 0.875 11 0.875C13.6844 0.877978 16.258 1.94567 18.1562 3.84383C20.0543 5.74199 21.122 8.3156 21.125 11ZM18.875 11C18.875 9.44247 18.4131 7.91992 17.5478 6.62488C16.6825 5.32985 15.4526 4.32049 14.0136 3.72445C12.5747 3.12841 10.9913 2.97246 9.46367 3.27632C7.93607 3.58017 6.53288 4.3302 5.43154 5.43153C4.3302 6.53287 3.58018 7.93606 3.27632 9.46366C2.97246 10.9913 3.12841 12.5747 3.72445 14.0136C4.32049 15.4526 5.32985 16.6825 6.62489 17.5478C7.91993 18.4131 9.44248 18.875 11 18.875C13.0879 18.8728 15.0896 18.0424 16.566 16.566C18.0424 15.0896 18.8728 13.0879 18.875 11ZM12.125 14.4387V11.375C12.125 10.8777 11.9275 10.4008 11.5758 10.0492C11.2242 9.69754 10.7473 9.5 10.25 9.5C9.98433 9.4996 9.72708 9.59325 9.52383 9.76435C9.32058 9.93544 9.18444 10.173 9.13952 10.4348C9.09461 10.6967 9.14381 10.966 9.27843 11.195C9.41304 11.4241 9.62438 11.5981 9.875 11.6863V14.75C9.875 15.2473 10.0725 15.7242 10.4242 16.0758C10.7758 16.4275 11.2527 16.625 11.75 16.625C12.0157 16.6254 12.2729 16.5318 12.4762 16.3607C12.6794 16.1896 12.8156 15.952 12.8605 15.6902C12.9054 15.4283 12.8562 15.159 12.7216 14.93C12.587 14.7009 12.3756 14.5269 12.125 14.4387Z" fill="currentColor"/>
- </svg>`,eNe=Object.freeze(Object.defineProperty({__proto__:null,infoSvg:Xke},Symbol.toStringTag,{value:"Module"})),tNe=Se`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M15.0162 11.6312L9.55059 2.13937C9.39228 1.86862 9.16584 1.64405 8.8938 1.48798C8.62176 1.33192 8.3136 1.2498 7.99997 1.2498C7.68634 1.2498 7.37817 1.33192 7.10613 1.48798C6.83409 1.64405 6.60765 1.86862 6.44934 2.13937L0.983716 11.6312C0.830104 11.894 0.749146 12.1928 0.749146 12.4972C0.749146 12.8015 0.830104 13.1004 0.983716 13.3631C1.14027 13.6352 1.3664 13.8608 1.63889 14.0166C1.91139 14.1725 2.22044 14.253 2.53434 14.25H13.4656C13.7793 14.2528 14.0881 14.1721 14.3603 14.0163C14.6326 13.8604 14.8585 13.635 15.015 13.3631C15.1688 13.1005 15.2499 12.8017 15.2502 12.4973C15.2504 12.193 15.1696 11.8941 15.0162 11.6312ZM13.7162 12.6125C13.6908 12.6558 13.6541 12.6914 13.6101 12.7157C13.5661 12.7399 13.5164 12.7517 13.4662 12.75H2.53434C2.48415 12.7517 2.43442 12.7399 2.39042 12.7157C2.34641 12.6914 2.30976 12.6558 2.28434 12.6125C2.26278 12.5774 2.25137 12.5371 2.25137 12.4959C2.25137 12.4548 2.26278 12.4144 2.28434 12.3794L7.74997 2.88749C7.77703 2.84583 7.81408 2.8116 7.85774 2.7879C7.9014 2.7642 7.95029 2.75178 7.99997 2.75178C8.04964 2.75178 8.09854 2.7642 8.1422 2.7879C8.18586 2.8116 8.2229 2.84583 8.24997 2.88749L13.715 12.3794C13.7367 12.4143 13.7483 12.4546 13.7486 12.4958C13.7488 12.5369 13.7376 12.5773 13.7162 12.6125ZM7.24997 8.49999V6.49999C7.24997 6.30108 7.32898 6.11031 7.46964 5.96966C7.61029 5.82901 7.80105 5.74999 7.99997 5.74999C8.19888 5.74999 8.38964 5.82901 8.5303 5.96966C8.67095 6.11031 8.74997 6.30108 8.74997 6.49999V8.49999C8.74997 8.6989 8.67095 8.88967 8.5303 9.03032C8.38964 9.17097 8.19888 9.24999 7.99997 9.24999C7.80105 9.24999 7.61029 9.17097 7.46964 9.03032C7.32898 8.88967 7.24997 8.6989 7.24997 8.49999ZM8.99997 11C8.99997 11.1978 8.94132 11.3911 8.83144 11.5556C8.72155 11.72 8.56538 11.8482 8.38265 11.9239C8.19992 11.9996 7.99886 12.0194 7.80488 11.9808C7.6109 11.9422 7.43271 11.847 7.29286 11.7071C7.15301 11.5672 7.05777 11.3891 7.01918 11.1951C6.9806 11.0011 7.0004 10.8 7.07609 10.6173C7.15177 10.4346 7.27995 10.2784 7.4444 10.1685C7.60885 10.0586 7.80219 9.99999 7.99997 9.99999C8.26518 9.99999 8.51954 10.1053 8.70707 10.2929C8.89461 10.4804 8.99997 10.7348 8.99997 11Z" fill="currentColor"/>
- </svg>
- `,rNe=Object.freeze(Object.defineProperty({__proto__:null,exclamationTriangleSvg:tNe},Symbol.toStringTag,{value:"Module"})),nNe=Se`<svg width="60" height="16" viewBox="0 0 60 16" fill="none"">
- <path d="M9.3335 4.66667C9.3335 2.08934 11.4229 0 14.0002 0H20.6669C23.2442 0 25.3335 2.08934 25.3335 4.66667V11.3333C25.3335 13.9106 23.2442 16 20.6669 16H14.0002C11.4229 16 9.3335 13.9106 9.3335 11.3333V4.66667Z" fill="#363636"/>
- <path d="M15.6055 11.0003L17.9448 4.66699H18.6316L16.2923 11.0003H15.6055Z" fill="#F6F6F6"/>
- <path d="M0 4.33333C0 1.9401 1.9401 0 4.33333 0C6.72657 0 8.66669 1.9401 8.66669 4.33333V11.6667C8.66669 14.0599 6.72657 16 4.33333 16C1.9401 16 0 14.0599 0 11.6667V4.33333Z" fill="#363636"/>
- <path d="M3.9165 9.99934V9.16602H4.74983V9.99934H3.9165Z" fill="#F6F6F6"/>
- <path d="M26 8C26 3.58172 29.3517 0 33.4863 0H52.5137C56.6483 0 60 3.58172 60 8C60 12.4183 56.6483 16 52.5137 16H33.4863C29.3517 16 26 12.4183 26 8Z" fill="#363636"/>
- <path d="M49.3687 9.95834V6.26232H50.0213V6.81966C50.256 6.40899 50.7326 6.16699 51.2606 6.16699C52.0599 6.16699 52.6173 6.67299 52.6173 7.65566V9.95834H51.972V7.69234C51.972 7.04696 51.6053 6.70966 51.07 6.70966C50.4906 6.70966 50.0213 7.17168 50.0213 7.82433V9.95834H49.3687Z" fill="#F6F6F6"/>
- <path d="M45.2538 9.95773L44.5718 6.26172H45.1877L45.6717 9.31242L46.3098 7.30306H46.9184L47.5491 9.29041L48.0404 6.26172H48.6564L47.9744 9.95773H47.2411L46.6178 8.03641L45.9871 9.95773H45.2538Z" fill="#F6F6F6"/>
- <path d="M42.3709 10.0536C41.2489 10.0536 40.5889 9.21765 40.5889 8.1103C40.5889 7.01035 41.2489 6.16699 42.3709 6.16699C43.4929 6.16699 44.1529 7.01035 44.1529 8.1103C44.1529 9.21765 43.4929 10.0536 42.3709 10.0536ZM42.3709 9.51096C43.1775 9.51096 43.4856 8.82164 43.4856 8.10296C43.4856 7.39163 43.1775 6.70966 42.3709 6.70966C41.5642 6.70966 41.2562 7.39163 41.2562 8.10296C41.2562 8.82164 41.5642 9.51096 42.3709 9.51096Z" fill="#F6F6F6"/>
- <path d="M38.2805 10.0536C37.1952 10.0536 36.5132 9.22499 36.5132 8.1103C36.5132 7.00302 37.1952 6.16699 38.2805 6.16699C39.1972 6.16699 40.0038 6.68766 39.9159 8.27896H37.1805C37.2319 8.96103 37.5472 9.5183 38.2805 9.5183C38.7718 9.5183 39.0945 9.21765 39.2045 8.87299H39.8499C39.7472 9.48903 39.1679 10.0536 38.2805 10.0536ZM37.1952 7.78765H39.2852C39.2338 7.04696 38.8892 6.70232 38.2805 6.70232C37.6132 6.70232 37.2832 7.18635 37.1952 7.78765Z" fill="#F6F6F6"/>
- <path d="M33.3828 9.95773V6.26172H34.0501V6.88506C34.2848 6.47439 34.6882 6.26172 35.1061 6.26172H35.9935V6.88506H35.0548C34.4682 6.88506 34.0501 7.26638 34.0501 8.00706V9.95773H33.3828Z" fill="#F6F6F6"/>
- </svg>`,iNe=Object.freeze(Object.defineProperty({__proto__:null,reownSvg:nNe},Symbol.toStringTag,{value:"Module"}))});export default sNe();
|